From: wessels <> Date: Sat, 14 Sep 1996 14:45:32 +0000 (+0000) Subject: ANSIFY X-Git-Tag: SQUID_3_0_PRE1~5803 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8203a13276d30fbcbaaee6a38978ca5eabc9a9e6;p=thirdparty%2Fsquid.git ANSIFY --- diff --git a/src/acl.cc b/src/acl.cc index 10d5c1134f..2a875a7f19 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -1,5 +1,5 @@ /* - * $Id: acl.cc,v 1.33 1996/09/13 19:11:13 wessels Exp $ + * $Id: acl.cc,v 1.34 1996/09/14 08:45:32 wessels Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -41,32 +41,32 @@ struct _acl_access *ICPAccessList = NULL; static struct _acl *AclList = NULL; static struct _acl **AclListTail = &AclList; -static void aclDestroyAclList _PARAMS((struct _acl_list * list)); -static void aclDestroyIpList _PARAMS((struct _acl_ip_data * data)); -static void aclDestroyRegexList _PARAMS((struct _relist * data)); -static void aclDestroyTimeList _PARAMS((struct _acl_time_data * data)); -static int aclMatchDomainList _PARAMS((wordlist *, char *)); -static int aclMatchAclList _PARAMS((struct _acl_list *, aclCheck_t *)); -static int aclMatchInteger _PARAMS((intlist * data, int i)); -static int aclMatchIp _PARAMS((struct _acl_ip_data * data, struct in_addr c)); -static int aclMatchRegex _PARAMS((relist * data, char *word)); -static int aclMatchTime _PARAMS((struct _acl_time_data * data, time_t when)); +static void aclDestroyAclList(struct _acl_list *list); +static void aclDestroyIpList(struct _acl_ip_data *data); +static void aclDestroyRegexList(struct _relist *data); +static void aclDestroyTimeList(struct _acl_time_data *data); +static int aclMatchDomainList(wordlist *, char *); +static int aclMatchAclList(struct _acl_list *, aclCheck_t *); +static int aclMatchInteger(intlist * data, int i); +static int aclMatchIp(struct _acl_ip_data *data, struct in_addr c); +static int aclMatchRegex(relist * data, char *word); +static int aclMatchTime(struct _acl_time_data *data, time_t when); #ifdef UNUSED_CODE -static int aclMatchEndOfWord _PARAMS((wordlist * data, char *word)); +static int aclMatchEndOfWord(wordlist * data, char *word); #endif -static intlist *aclParseIntlist _PARAMS((void)); -static struct _acl_ip_data *aclParseIpList _PARAMS((void)); -static intlist *aclParseMethodList _PARAMS((void)); -static intlist *aclParseProtoList _PARAMS((void)); -static struct _relist *aclParseRegexList _PARAMS((void)); -static struct _acl_time_data *aclParseTimeSpec _PARAMS((void)); -static wordlist *aclParseWordList _PARAMS((void)); -static wordlist *aclParseDomainList _PARAMS((void)); -static squid_acl aclType _PARAMS((char *s)); -static int decode_addr _PARAMS((char *, struct in_addr *, struct in_addr *)); - -static squid_acl aclType(s) - char *s; +static intlist *aclParseIntlist(void); +static struct _acl_ip_data *aclParseIpList(void); +static intlist *aclParseMethodList(void); +static intlist *aclParseProtoList(void); +static struct _relist *aclParseRegexList(void); +static struct _acl_time_data *aclParseTimeSpec(void); +static wordlist *aclParseWordList(void); +static wordlist *aclParseDomainList(void); +static squid_acl aclType(char *s); +static int decode_addr(char *, struct in_addr *, struct in_addr *); + +static squid_acl +aclType(char *s) { if (!strcmp(s, "src")) return ACL_SRC_IP; @@ -97,8 +97,8 @@ static squid_acl aclType(s) return ACL_NONE; } -struct _acl *aclFindByName(name) - char *name; +struct _acl * +aclFindByName(char *name) { struct _acl *a; for (a = AclList; a; a = a->next) @@ -108,7 +108,8 @@ struct _acl *aclFindByName(name) } -static intlist *aclParseIntlist() +static intlist * +aclParseIntlist() { intlist *head = NULL; intlist **Tail = &head; @@ -123,7 +124,8 @@ static intlist *aclParseIntlist() return head; } -static intlist *aclParseProtoList() +static intlist * +aclParseProtoList() { intlist *head = NULL; intlist **Tail = &head; @@ -138,7 +140,8 @@ static intlist *aclParseProtoList() return head; } -static intlist *aclParseMethodList() +static intlist * +aclParseMethodList() { intlist *head = NULL; intlist **Tail = &head; @@ -156,9 +159,8 @@ static intlist *aclParseMethodList() /* Decode a ascii representation (asc) of a IP adress, and place * adress and netmask information in addr and mask. */ -static int decode_addr(asc, addr, mask) - char *asc; - struct in_addr *addr, *mask; +static int +decode_addr(char *asc, struct in_addr *addr, struct in_addr *mask) { struct hostent *hp = NULL; u_num32 a; @@ -210,7 +212,8 @@ static int decode_addr(asc, addr, mask) } -static struct _acl_ip_data *aclParseIpList() +static struct _acl_ip_data * +aclParseIpList() { char *t = NULL, *p = NULL; struct _acl_ip_data *head = NULL; @@ -275,7 +278,8 @@ static struct _acl_ip_data *aclParseIpList() return head; } -static struct _acl_time_data *aclParseTimeSpec() +static struct _acl_time_data * +aclParseTimeSpec() { struct _acl_time_data *data = NULL; int h1, m1, h2, m2; @@ -348,7 +352,8 @@ static struct _acl_time_data *aclParseTimeSpec() return data; } -static struct _relist *aclParseRegexList() +static struct _relist * +aclParseRegexList() { relist *head = NULL; relist **Tail = &head; @@ -371,7 +376,8 @@ static struct _relist *aclParseRegexList() return head; } -static wordlist *aclParseWordList() +static wordlist * +aclParseWordList() { wordlist *head = NULL; wordlist **Tail = &head; @@ -386,7 +392,8 @@ static wordlist *aclParseWordList() return head; } -static wordlist *aclParseDomainList() +static wordlist * +aclParseDomainList() { wordlist *head = NULL; wordlist **Tail = &head; @@ -403,7 +410,8 @@ static wordlist *aclParseDomainList() } -void aclParseAclLine() +void +aclParseAclLine() { /* we're already using strtok() to grok the line */ char *t = NULL; @@ -479,9 +487,8 @@ void aclParseAclLine() /* maex@space.net (06.09.96) * get (if any) the URL from deny_info for a certain acl */ -char *aclGetDenyInfoUrl(head, name) - struct _acl_deny_info_list **head; - char *name; +char * +aclGetDenyInfoUrl(struct _acl_deny_info_list **head, char *name) { struct _acl_deny_info_list *A = NULL; struct _acl_name_list *L = NULL; @@ -510,8 +517,8 @@ char *aclGetDenyInfoUrl(head, name) * - a check, whether the given acl really is defined * - a check, whether an acl is added more than once for the same url */ -void aclParseDenyInfoLine(head) - struct _acl_deny_info_list **head; +void +aclParseDenyInfoLine(struct _acl_deny_info_list **head) { char *t = NULL; struct _acl_deny_info_list *A = NULL; @@ -551,8 +558,8 @@ void aclParseDenyInfoLine(head) *T = A; } -void aclParseAccessLine(head) - struct _acl_access **head; +void +aclParseAccessLine(struct _acl_access **head) { char *t = NULL; struct _acl_access *A = NULL; @@ -618,9 +625,8 @@ void aclParseAccessLine(head) *T = A; } -static int aclMatchIp(data, c) - struct _acl_ip_data *data; - struct in_addr c; +static int +aclMatchIp(struct _acl_ip_data *data, struct in_addr c) { struct in_addr h; unsigned long lh, la1, la2; @@ -652,9 +658,8 @@ static int aclMatchIp(data, c) } #ifdef UNUSED_CODE -static int aclMatchWord(data, word) - wordlist *data; - char *word; +static int +aclMatchWord(wordlist * data, char *word) { if (word == NULL) return 0; @@ -668,9 +673,8 @@ static int aclMatchWord(data, word) return 0; } -static int aclMatchEndOfWord(data, word) - wordlist *data; - char *word; +static int +aclMatchEndOfWord(wordlist * data, char *word) { int offset; if (word == NULL) @@ -687,9 +691,8 @@ static int aclMatchEndOfWord(data, word) } #endif -static int aclMatchDomainList(data, host) - wordlist *data; - char *host; +static int +aclMatchDomainList(wordlist * data, char *host) { if (host == NULL) return 0; @@ -702,9 +705,8 @@ static int aclMatchDomainList(data, host) return 0; } -static int aclMatchRegex(data, word) - relist *data; - char *word; +static int +aclMatchRegex(relist * data, char *word) { if (word == NULL) return 0; @@ -718,9 +720,8 @@ static int aclMatchRegex(data, word) return 0; } -static int aclMatchInteger(data, i) - intlist *data; - int i; +static int +aclMatchInteger(intlist * data, int i) { while (data) { if (data->i == i) @@ -730,9 +731,8 @@ static int aclMatchInteger(data, i) return 0; } -static int aclMatchTime(data, when) - struct _acl_time_data *data; - time_t when; +static int +aclMatchTime(struct _acl_time_data *data, time_t when) { static time_t last_when = 0; static struct tm tm; @@ -751,9 +751,8 @@ static int aclMatchTime(data, when) return data->weekbits & (1 << tm.tm_wday) ? 1 : 0; } -int aclMatchAcl(acl, checklist) - struct _acl *acl; - aclCheck_t *checklist; +int +aclMatchAcl(struct _acl *acl, aclCheck_t * checklist) { request_t *r = checklist->request; struct hostent *hp = NULL; @@ -833,9 +832,8 @@ int aclMatchAcl(acl, checklist) /* NOTREACHED */ } -static int aclMatchAclList(list, checklist) - struct _acl_list *list; - aclCheck_t *checklist; +static int +aclMatchAclList(struct _acl_list *list, aclCheck_t * checklist) { while (list) { AclMatchedName = list->acl->name; @@ -851,9 +849,8 @@ static int aclMatchAclList(list, checklist) return 1; } -int aclCheck(A, checklist) - struct _acl_access *A; - aclCheck_t *checklist; +int +aclCheck(struct _acl_access *A, aclCheck_t * checklist) { int allow = 0; @@ -869,8 +866,8 @@ int aclCheck(A, checklist) return !allow; } -static void aclDestroyIpList(data) - struct _acl_ip_data *data; +static void +aclDestroyIpList(struct _acl_ip_data *data) { struct _acl_ip_data *next; for (; data; data = next) { @@ -879,8 +876,8 @@ static void aclDestroyIpList(data) } } -static void aclDestroyTimeList(data) - struct _acl_time_data *data; +static void +aclDestroyTimeList(struct _acl_time_data *data) { struct _acl_time_data *next; for (; data; data = next) { @@ -889,8 +886,8 @@ static void aclDestroyTimeList(data) } } -static void aclDestroyRegexList(data) - struct _relist *data; +static void +aclDestroyRegexList(struct _relist *data) { struct _relist *next; for (; data; data = next) { @@ -901,7 +898,8 @@ static void aclDestroyRegexList(data) } } -void aclDestroyAcls() +void +aclDestroyAcls() { struct _acl *a = NULL; struct _acl *next = NULL; @@ -942,8 +940,8 @@ void aclDestroyAcls() AclListTail = &AclList; } -static void aclDestroyAclList(list) - struct _acl_list *list; +static void +aclDestroyAclList(struct _acl_list *list) { struct _acl_list *next = NULL; for (; list; list = next) { @@ -952,8 +950,8 @@ static void aclDestroyAclList(list) } } -void aclDestroyAccessList(list) - struct _acl_access **list; +void +aclDestroyAccessList(struct _acl_access **list) { struct _acl_access *l = NULL; struct _acl_access *next = NULL; @@ -970,8 +968,8 @@ void aclDestroyAccessList(list) /* maex@space.net (06.09.1996) * destroy an _acl_deny_info_list */ -void aclDestroyDenyInfoList(list) - struct _acl_deny_info_list **list; +void +aclDestroyDenyInfoList(struct _acl_deny_info_list **list) { struct _acl_deny_info_list *a = NULL; struct _acl_deny_info_list *a_next = NULL; diff --git a/src/cache_cf.cc b/src/cache_cf.cc index e5393a7b42..80d6da02c9 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,5 +1,5 @@ /* - * $Id: cache_cf.cc,v 1.86 1996/09/13 20:50:48 wessels Exp $ + * $Id: cache_cf.cc,v 1.87 1996/09/14 08:45:37 wessels Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -208,64 +208,64 @@ char w_space[] = " \t\n"; char config_input_line[BUFSIZ]; int config_lineno = 0; -static char *safe_xstrdup _PARAMS((char *p)); -static void parseOnOff _PARAMS((int *)); -static void parseIntegerValue _PARAMS((int *)); +static char *safe_xstrdup(char *p); +static void parseOnOff(int *); +static void parseIntegerValue(int *); static char fatal_str[BUFSIZ]; -static void configDoConfigure _PARAMS((void)); -static void configFreeMemory _PARAMS((void)); -static void configSetFactoryDefaults _PARAMS((void)); -static void parseAccessLogLine _PARAMS((void)); -static void parseAddressLine _PARAMS((struct in_addr *)); -static void parseAnnounceToLine _PARAMS((void)); -static void parseAppendDomainLine _PARAMS((void)); -static void parseCacheAnnounceLine _PARAMS((void)); -static void parseCacheHostLine _PARAMS((void)); -static void parseDebugOptionsLine _PARAMS((void)); -static void parseDirLine _PARAMS((void)); -static void parseDnsProgramLine _PARAMS((void)); -static void parseDnsTestnameLine _PARAMS((void)); -static void parseEffectiveUserLine _PARAMS((void)); -static void parseErrHtmlLine _PARAMS((void)); -static void parseFtpLine _PARAMS((void)); -static void parseFtpOptionsLine _PARAMS((void)); -static void parseFtpProgramLine _PARAMS((void)); -static void parseFtpUserLine _PARAMS((void)); -static void parseGopherLine _PARAMS((void)); -static void parseHierarchyStoplistLine _PARAMS((void)); -static void parseHostAclLine _PARAMS((void)); -static void parseHostDomainLine _PARAMS((void)); -static void parseHotVmFactorLine _PARAMS((void)); -static void parseHttpLine _PARAMS((void)); -static void parseHttpPortLine _PARAMS((void)); -static void parseHttpdAccelLine _PARAMS((void)); -static void parseIPLine _PARAMS((ip_acl ** list)); -static void parseIcpPortLine _PARAMS((void)); -static void parseInsideFirewallLine _PARAMS((void)); -static void parseLocalDomainFile _PARAMS((char *fname)); -static void parseLocalDomainLine _PARAMS((void)); -static void parseLogLine _PARAMS((void)); -static void parseMemLine _PARAMS((void)); -static void parseMgrLine _PARAMS((void)); -static void parsePidFilenameLine _PARAMS((void)); -static void parseRequestSizeLine _PARAMS((void)); -static void parseStoreLogLine _PARAMS((void)); -static void parseSwapLine _PARAMS((void)); -static void parseTTLPattern _PARAMS((int icase, int force)); -static void parseVisibleHostnameLine _PARAMS((void)); -static void parseWAISRelayLine _PARAMS((void)); -static void parseMinutesLine _PARAMS((int *)); - -void self_destruct() +static void configDoConfigure(void); +static void configFreeMemory(void); +static void configSetFactoryDefaults(void); +static void parseAccessLogLine(void); +static void parseAddressLine(struct in_addr *); +static void parseAnnounceToLine(void); +static void parseAppendDomainLine(void); +static void parseCacheAnnounceLine(void); +static void parseCacheHostLine(void); +static void parseDebugOptionsLine(void); +static void parseDirLine(void); +static void parseDnsProgramLine(void); +static void parseDnsTestnameLine(void); +static void parseEffectiveUserLine(void); +static void parseErrHtmlLine(void); +static void parseFtpLine(void); +static void parseFtpOptionsLine(void); +static void parseFtpProgramLine(void); +static void parseFtpUserLine(void); +static void parseGopherLine(void); +static void parseHierarchyStoplistLine(void); +static void parseHostAclLine(void); +static void parseHostDomainLine(void); +static void parseHotVmFactorLine(void); +static void parseHttpLine(void); +static void parseHttpPortLine(void); +static void parseHttpdAccelLine(void); +static void parseIPLine(ip_acl ** list); +static void parseIcpPortLine(void); +static void parseInsideFirewallLine(void); +static void parseLocalDomainFile(char *fname); +static void parseLocalDomainLine(void); +static void parseLogLine(void); +static void parseMemLine(void); +static void parseMgrLine(void); +static void parsePidFilenameLine(void); +static void parseRequestSizeLine(void); +static void parseStoreLogLine(void); +static void parseSwapLine(void); +static void parseTTLPattern(int icase, int force); +static void parseVisibleHostnameLine(void); +static void parseWAISRelayLine(void); +static void parseMinutesLine(int *); + +void +self_destruct() { sprintf(fatal_str, "Bungled %s line %d: %s", cfg_filename, config_lineno, config_input_line); fatal(fatal_str); } -int ip_acl_match(c, a) - struct in_addr c; - ip_acl *a; +int +ip_acl_match(struct in_addr c, ip_acl * a) { static struct in_addr h; @@ -277,9 +277,8 @@ int ip_acl_match(c, a) } -ip_access_type ip_access_check(address, list) - struct in_addr address; - ip_acl *list; +ip_access_type +ip_access_check(struct in_addr address, ip_acl * list) { static int init = 0; static struct in_addr localhost; @@ -312,10 +311,8 @@ ip_access_type ip_access_check(address, list) } -void addToIPACL(list, ip_str, access) - ip_acl **list; - char *ip_str; - ip_access_type access; +void +addToIPACL(ip_acl ** list, char *ip_str, ip_access_type access) { ip_acl *p, *q; int a1, a2, a3, a4; @@ -390,8 +387,8 @@ void addToIPACL(list, ip_str, access) q->mask.s_addr = lmask.s_addr; } -void wordlistDestroy(list) - wordlist **list; +void +wordlistDestroy(wordlist ** list) { wordlist *w = NULL; wordlist *n = NULL; @@ -404,9 +401,8 @@ void wordlistDestroy(list) *list = NULL; } -void wordlistAdd(list, key) - wordlist **list; - char *key; +void +wordlistAdd(wordlist ** list, char *key) { wordlist *p = NULL; wordlist *q = NULL; @@ -427,8 +423,8 @@ void wordlistAdd(list, key) } } -void intlistDestroy(list) - intlist **list; +void +intlistDestroy(intlist ** list) { intlist *w = NULL; intlist *n = NULL; @@ -453,7 +449,8 @@ void intlistDestroy(list) self_destruct(); -static void parseCacheHostLine() +static void +parseCacheHostLine() { char *type = NULL; char *hostname = NULL; @@ -490,7 +487,8 @@ static void parseCacheHostLine() neighbors_cf_add(hostname, type, http_port, icp_port, options, weight); } -static void parseHostDomainLine() +static void +parseHostDomainLine() { char *host = NULL; char *domain = NULL; @@ -500,7 +498,8 @@ static void parseHostDomainLine() neighbors_cf_domain(host, domain); } -static void parseHostAclLine() +static void +parseHostAclLine() { char *host = NULL; char *aclname = NULL; @@ -511,7 +510,8 @@ static void parseHostAclLine() } -static void parseMemLine() +static void +parseMemLine() { char *token; int i; @@ -519,7 +519,8 @@ static void parseMemLine() Config.Mem.maxSize = i << 20; } -static void parseHotVmFactorLine() +static void +parseHotVmFactorLine() { char *token = NULL; double d; @@ -534,7 +535,8 @@ static void parseHotVmFactorLine() Config.hotVmFactor = d; } -static void parseSwapLine() +static void +parseSwapLine() { char *token; int i; @@ -542,7 +544,8 @@ static void parseSwapLine() Config.Swap.maxSize = i << 10; } -static void parseHttpLine() +static void +parseHttpLine() { char *token; int i; @@ -552,7 +555,8 @@ static void parseHttpLine() Config.Http.defaultTtl = i * 60; } -static void parseGopherLine() +static void +parseGopherLine() { char *token; int i; @@ -562,7 +566,8 @@ static void parseGopherLine() Config.Gopher.defaultTtl = i * 60; } -static void parseFtpLine() +static void +parseFtpLine() { char *token; int i; @@ -572,9 +577,8 @@ static void parseFtpLine() Config.Ftp.defaultTtl = i * 60; } -static void parseTTLPattern(icase, force) - int icase; - int force; +static void +parseTTLPattern(int icase, int force) { char *token; char *pattern; @@ -607,7 +611,8 @@ static void parseTTLPattern(icase, force) safe_free(pattern); } -static void parseQuickAbort() +static void +parseQuickAbort() { char *token; int i; @@ -631,8 +636,8 @@ static void parseQuickAbort() } } -static void parseMinutesLine(iptr) - int *iptr; +static void +parseMinutesLine(int *iptr) { char *token; int i; @@ -640,7 +645,8 @@ static void parseMinutesLine(iptr) *iptr = i * 60; } -static void parseRequestSizeLine() +static void +parseRequestSizeLine() { char *token; int i; @@ -648,7 +654,8 @@ static void parseRequestSizeLine() Config.maxRequestSize = i * 1024; } -static void parseMgrLine() +static void +parseMgrLine() { char *token; token = strtok(NULL, w_space); @@ -658,7 +665,8 @@ static void parseMgrLine() Config.adminEmail = xstrdup(token); } -static void parseDirLine() +static void +parseDirLine() { char *token; @@ -669,7 +677,8 @@ static void parseDirLine() } #if USE_PROXY_AUTH -static void parseProxyAuthLine() +static void +parseProxyAuthLine() { char *token; @@ -684,7 +693,8 @@ static void parseProxyAuthLine() } #endif /* USE_PROXY_AUTH */ -static void parseHttpdAccelLine() +static void +parseHttpdAccelLine() { char *token; LOCAL_ARRAY(char, buf, BUFSIZ); @@ -703,7 +713,8 @@ static void parseHttpdAccelLine() httpd_accel_mode = 1; } -static void parseEffectiveUserLine() +static void +parseEffectiveUserLine() { char *token; @@ -720,7 +731,8 @@ static void parseEffectiveUserLine() Config.effectiveGroup = xstrdup(token); } -static void parseLogLine() +static void +parseLogLine() { char *token; token = strtok(NULL, w_space); @@ -730,7 +742,8 @@ static void parseLogLine() Config.Log.log = xstrdup(token); } -static void parseAccessLogLine() +static void +parseAccessLogLine() { char *token; token = strtok(NULL, w_space); @@ -740,7 +753,8 @@ static void parseAccessLogLine() Config.Log.access = xstrdup(token); } -static void parseStoreLogLine() +static void +parseStoreLogLine() { char *token; token = strtok(NULL, w_space); @@ -750,7 +764,8 @@ static void parseStoreLogLine() Config.Log.store = xstrdup(token); } -static void parseFtpProgramLine() +static void +parseFtpProgramLine() { char *token; token = strtok(NULL, w_space); @@ -760,7 +775,8 @@ static void parseFtpProgramLine() Config.Program.ftpget = xstrdup(token); } -static void parseFtpOptionsLine() +static void +parseFtpOptionsLine() { char *token; token = strtok(NULL, ""); /* Note "", don't separate these */ @@ -770,7 +786,8 @@ static void parseFtpOptionsLine() Config.Program.ftpget_opts = xstrdup(token); } -static void parseDnsProgramLine() +static void +parseDnsProgramLine() { char *token; token = strtok(NULL, w_space); @@ -780,7 +797,8 @@ static void parseDnsProgramLine() Config.Program.dnsserver = xstrdup(token); } -static void parseRedirectProgramLine() +static void +parseRedirectProgramLine() { char *token; token = strtok(NULL, w_space); @@ -790,8 +808,8 @@ static void parseRedirectProgramLine() Config.Program.redirect = xstrdup(token); } -static void parseOnOff(var) - int *var; +static void +parseOnOff(int *var) { char *token; token = strtok(NULL, w_space); @@ -803,7 +821,8 @@ static void parseOnOff(var) *var = 0; } -static void parseWAISRelayLine() +static void +parseWAISRelayLine() { char *token; int i; @@ -818,8 +837,8 @@ static void parseWAISRelayLine() Config.Wais.maxObjSize = i << 20; } -static void parseIPLine(list) - ip_acl **list; +static void +parseIPLine(ip_acl ** list) { char *token; while ((token = strtok(NULL, w_space))) { @@ -827,14 +846,16 @@ static void parseIPLine(list) } } -static void parseHierarchyStoplistLine() +static void +parseHierarchyStoplistLine() { char *token; while ((token = strtok(NULL, w_space))) wordlistAdd(&Config.hierarchy_stoplist, token); } -static void parseAppendDomainLine() +static void +parseAppendDomainLine() { char *token; token = strtok(NULL, w_space); @@ -846,8 +867,8 @@ static void parseAppendDomainLine() Config.appendDomain = xstrdup(token); } -static void parseAddressLine(addr) - struct in_addr *addr; +static void +parseAddressLine(struct in_addr *addr) { char *token; struct hostent *hp = NULL; @@ -862,8 +883,8 @@ static void parseAddressLine(addr) self_destruct(); } -static void parseLocalDomainFile(fname) - char *fname; +static void +parseLocalDomainFile(char *fname) { LOCAL_ARRAY(char, tmp_line, BUFSIZ); FILE *fp = NULL; @@ -889,7 +910,8 @@ static void parseLocalDomainFile(fname) fclose(fp); } -static void parseLocalDomainLine() +static void +parseLocalDomainLine() { char *token = NULL; struct stat sb; @@ -902,7 +924,8 @@ static void parseLocalDomainLine() } } -static void parseInsideFirewallLine() +static void +parseInsideFirewallLine() { char *token; while ((token = strtok(NULL, w_space))) { @@ -910,7 +933,8 @@ static void parseInsideFirewallLine() } } -static void parseDnsTestnameLine() +static void +parseDnsTestnameLine() { char *token; while ((token = strtok(NULL, w_space))) { @@ -918,7 +942,8 @@ static void parseDnsTestnameLine() } } -static void parseHttpPortLine() +static void +parseHttpPortLine() { char *token; int i; @@ -928,7 +953,8 @@ static void parseHttpPortLine() Config.Port.http = (u_short) i; } -static void parseIcpPortLine() +static void +parseIcpPortLine() { char *token; int i; @@ -938,7 +964,8 @@ static void parseIcpPortLine() Config.Port.icp = (u_short) i; } -static void parseDebugOptionsLine() +static void +parseDebugOptionsLine() { char *token; token = strtok(NULL, ""); /* Note "", don't separate these */ @@ -950,7 +977,8 @@ static void parseDebugOptionsLine() Config.debugOptions = xstrdup(token); } -static void parsePidFilenameLine() +static void +parsePidFilenameLine() { char *token; token = strtok(NULL, w_space); @@ -960,7 +988,8 @@ static void parsePidFilenameLine() Config.pidFilename = xstrdup(token); } -static void parseVisibleHostnameLine() +static void +parseVisibleHostnameLine() { char *token; token = strtok(NULL, w_space); @@ -970,7 +999,8 @@ static void parseVisibleHostnameLine() Config.visibleHostname = xstrdup(token); } -static void parseFtpUserLine() +static void +parseFtpUserLine() { char *token; token = strtok(NULL, w_space); @@ -980,7 +1010,8 @@ static void parseFtpUserLine() Config.ftpUser = xstrdup(token); } -static void parseCacheAnnounceLine() +static void +parseCacheAnnounceLine() { char *token; int i; @@ -988,7 +1019,8 @@ static void parseCacheAnnounceLine() Config.Announce.rate = i * 3600; /* hours to seconds */ } -static void parseAnnounceToLine() +static void +parseAnnounceToLine() { char *token; int i; @@ -1009,7 +1041,8 @@ static void parseAnnounceToLine() Config.Announce.file = xstrdup(token); } -static void parseSslProxyLine() +static void +parseSslProxyLine() { char *token; char *t; @@ -1025,8 +1058,8 @@ static void parseSslProxyLine() Config.sslProxy.host = xstrdup(token); } -static void parseIntegerValue(iptr) - int *iptr; +static void +parseIntegerValue(int *iptr) { char *token; int i; @@ -1034,15 +1067,16 @@ static void parseIntegerValue(iptr) *iptr = i; } -static void parseErrHtmlLine() +static void +parseErrHtmlLine() { char *token; if ((token = strtok(NULL, ""))) Config.errHtmlText = xstrdup(token); } -int parseConfigFile(file_name) - char *file_name; +int +parseConfigFile(char *file_name) { FILE *fp = NULL; char *token = NULL; @@ -1377,24 +1411,25 @@ int parseConfigFile(file_name) return 0; } -u_short setHttpPortNum(port) - u_short port; +u_short +setHttpPortNum(u_short port) { return (Config.Port.http = port); } -u_short setIcpPortNum(port) - u_short port; +u_short +setIcpPortNum(u_short port) { return (Config.Port.icp = port); } -static char *safe_xstrdup(p) - char *p; +static char * +safe_xstrdup(char *p) { return p ? xstrdup(p) : p; } -static void configFreeMemory() +static void +configFreeMemory() { safe_free(Config.Wais.relayHost); safe_free(Config.Log.log); @@ -1431,7 +1466,8 @@ static void configFreeMemory() } -static void configSetFactoryDefaults() +static void +configSetFactoryDefaults() { Config.Mem.maxSize = DefaultMemMaxSize; Config.Mem.highWaterMark = DefaultMemHighWaterMark; @@ -1521,7 +1557,8 @@ static void configSetFactoryDefaults() Config.ipcache.high = DefaultIpcacheHigh; } -static void configDoConfigure() +static void +configDoConfigure() { httpd_accel_mode = Config.Accel.prefix ? 1 : 0; sprintf(ForwardedBy, "Forwarded: by http://%s:%d/", diff --git a/src/cachemgr.cc b/src/cachemgr.cc index d1e3274b75..838a089d06 100644 --- a/src/cachemgr.cc +++ b/src/cachemgr.cc @@ -1,6 +1,6 @@ /* - * $Id: cachemgr.cc,v 1.19 1996/09/13 23:16:36 wessels Exp $ + * $Id: cachemgr.cc,v 1.20 1996/09/14 08:45:39 wessels Exp $ * * DEBUG: Section 0 CGI Cache Manager * AUTHOR: Harvest Derived @@ -268,9 +268,10 @@ int hasTables = FALSE; char *script_name = "/cgi-bin/cachemgr.cgi"; char *progname = NULL; -static int client_comm_connect _PARAMS((int, char *, int)); +static int client_comm_connect(int sock, char *dest_host, u_short dest_port); -void print_trailer() +void +print_trailer(void) { time_t now = time(NULL); static char tbuf[128]; @@ -286,7 +287,8 @@ void print_trailer() printf("\n"); } -void noargs_html(char *host, int port) +void +noargs_html(char *host, int port) { printf("\r\n\r\n"); printf("Cache Manager Interface\n"); @@ -337,7 +339,8 @@ void noargs_html(char *host, int port) } /* A utility function from the NCSA httpd cgi-src utils.c */ -char *makeword(char *line, char stop) +char * +makeword(char *line, char stop) { int x = 0, y; char *word = xmalloc(sizeof(char) * (strlen(line) + 1)); @@ -355,7 +358,8 @@ char *makeword(char *line, char stop) } /* A utility function from the NCSA httpd cgi-src utils.c */ -char *fmakeword(FILE * f, char stop, int *cl) +char * +fmakeword(FILE * f, char stop, int *cl) { int wsize = 102400; char *word = NULL; @@ -382,7 +386,8 @@ char *fmakeword(FILE * f, char stop, int *cl) } /* A utility function from the NCSA httpd cgi-src utils.c */ -char x2c(char *what) +char +x2c(char *what) { char digit; @@ -393,7 +398,8 @@ char x2c(char *what) } /* A utility function from the NCSA httpd cgi-src utils.c */ -void unescape_url(char *url) +void +unescape_url(char *url) { int x, y; @@ -407,7 +413,8 @@ void unescape_url(char *url) } /* A utility function from the NCSA httpd cgi-src utils.c */ -void plustospace(char *str) +void +plustospace(char *str) { int x; @@ -417,7 +424,8 @@ void plustospace(char *str) } -void parse_object(char *string) +void +parse_object(char *string) { char *tmp_line = NULL; char *url = NULL; @@ -493,7 +501,8 @@ void parse_object(char *string) free(status); } -int main(int argc, char *argv[]) +int +main(int argc, char *argv[]) { static char hostname[256]; static char operation[256]; @@ -866,9 +875,9 @@ int main(int argc, char *argv[]) sn = sscanf(reserve, "%s %d %d %d %d %f %d %d %d", s1, &d1, &d2, &d3, &d4, &f1, &d5, &d6, &d7); if (sn == 1) { - if (hasTables) + if (hasTables) printf("%s", s1); - else + else printf("%8s", s1); break; } @@ -910,10 +919,8 @@ int main(int argc, char *argv[]) return 0; } -static int client_comm_connect(sock, dest_host, dest_port) - int sock; /* Type of communication to use. */ - char *dest_host; /* Server's host name. */ - u_short dest_port; /* Server's port. */ +static int +client_comm_connect(int sock, char *dest_host, u_short dest_port) { struct hostent *hp; static struct sockaddr_in to_addr;