From: wessels <> Date: Sat, 14 Sep 1996 22:05:39 +0000 (+0000) Subject: more ANSIFY'ing X-Git-Tag: SQUID_3_0_PRE1~5800 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3ebcfaa1e16090db69dc1384e693f2b277593439;p=thirdparty%2Fsquid.git more ANSIFY'ing --- diff --git a/src/acl.cc b/src/acl.cc index 2a875a7f19..6a8555192a 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -1,5 +1,5 @@ /* - * $Id: acl.cc,v 1.34 1996/09/14 08:45:32 wessels Exp $ + * $Id: acl.cc,v 1.35 1996/09/14 16:05:39 wessels Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -51,9 +51,6 @@ 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(wordlist * data, char *word); -#endif static intlist *aclParseIntlist(void); static struct _acl_ip_data *aclParseIpList(void); static intlist *aclParseMethodList(void); @@ -657,40 +654,6 @@ aclMatchIp(struct _acl_ip_data *data, struct in_addr c) return 0; } -#ifdef UNUSED_CODE -static int -aclMatchWord(wordlist * data, char *word) -{ - if (word == NULL) - return 0; - debug(28, 3, "aclMatchWord: checking '%s'\n", word); - while (data) { - debug(28, 3, "aclMatchWord: looking for '%s'\n", data->key); - if (strstr(word, data->key)) - return 1; - data = data->next; - } - return 0; -} - -static int -aclMatchEndOfWord(wordlist * data, char *word) -{ - int offset; - if (word == NULL) - return 0; - debug(28, 3, "aclMatchEndOfWord: checking '%s'\n", word); - for (; data; data = data->next) { - debug(28, 3, "aclMatchEndOfWord: looking for '%s'\n", data->key); - if ((offset = strlen(word) - strlen(data->key)) < 0) - continue; - if (strcasecmp(word + offset, data->key) == 0) - return 1; - } - return 0; -} -#endif - static int aclMatchDomainList(wordlist * data, char *host) { diff --git a/src/client_side.cc b/src/client_side.cc index 38618eb60d..84f1c11a64 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.23 1996/09/14 08:45:41 wessels Exp $ + * $Id: client_side.cc,v 1.24 1996/09/14 16:05:41 wessels Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -103,7 +103,9 @@ clientProxyAuthCheck(icpStateData * icpState) #endif /* USE_PROXY_AUTH */ void -clientAccessCheck(icpStateData * icpState, void (*handler) _PARAMS((icpStateData *, int))) +clientAccessCheck(icpStateData * icpState, + void (*handler) (icpStateData *, + int)) { int answer = 1; request_t *r = icpState->request; diff --git a/src/disk.cc b/src/disk.cc index 3ecb420712..a7bb009541 100644 --- a/src/disk.cc +++ b/src/disk.cc @@ -1,5 +1,5 @@ /* - * $Id: disk.cc,v 1.23 1996/09/14 08:45:47 wessels Exp $ + * $Id: disk.cc,v 1.24 1996/09/14 16:05:42 wessels Exp $ * * DEBUG: section 6 Disk I/O Routines * AUTHOR: Harvest Derived @@ -185,32 +185,6 @@ file_open(char *path, int (*handler) (), int mode) return fd; } -#ifdef UNUSED_CODE -int file_update_open(int fd, char *path; /* path to file */ -) { - FD_ENTRY *conn; - - /* update fdstat */ - fdstat_open(fd, FD_FILE); - - /* init table */ - strncpy(file_table[fd].filename, path, MAX_FILE_NAME_LEN); - file_table[fd].at_eof = NO; - file_table[fd].open_stat = FILE_OPEN; - file_table[fd].close_request = NOT_REQUEST; - file_table[fd].write_lock = UNLOCK; - file_table[fd].write_pending = NO_WRT_PENDING; - file_table[fd].write_daemon = NOT_PRESENT; - file_table[fd].access_code = 0; - file_table[fd].write_q = NULL; - - conn = &fd_table[fd]; - memset(conn, '\0', sizeof(FD_ENTRY)); - conn->comm_type = COMM_NONBLOCKING; - return fd; -} -#endif - /* close a disk file. */ int @@ -358,7 +332,13 @@ diskHandleWrite(int fd, FileEntry * entry) /* write back queue. Only one writer at a time. */ /* call a handle when writing is complete. */ int -file_write(int fd, char *ptr_to_buf, int len, int access_code, void (*handle) (), void *handle_data, void (*free) _PARAMS((void *))) +file_write(int fd, + char *ptr_to_buf, + int len, + int access_code, + void (*handle) (), + void *handle_data, + void (*free) (void *)) { dwrite_q *wq = NULL; diff --git a/src/gopher.cc b/src/gopher.cc index 24cf0f249f..9aa8c0bb6e 100644 --- a/src/gopher.cc +++ b/src/gopher.cc @@ -1,5 +1,5 @@ /* - * $Id: gopher.cc,v 1.43 1996/09/14 08:46:02 wessels Exp $ + * $Id: gopher.cc,v 1.44 1996/09/14 16:05:43 wessels Exp $ * * DEBUG: section 10 Gopher * AUTHOR: Harvest Derived @@ -161,21 +161,21 @@ typedef struct gopher_ds { static int gopherStateFree(int fd, GopherStateData *); static void gopher_mime_content(char *buf, char *name, char *def); static void gopherMimeCreate(GopherStateData *); -static int gopher_url_parser _PARAMS((char *url, +static int gopher_url_parser (char *url, char *host, int *port, char *type_id, - char *request)); + char *request); static void gopherEndHTML(GopherStateData *); static void gopherToHTML(GopherStateData *, char *inbuf, int len); static int gopherReadReplyTimeout(int fd, GopherStateData *); static void gopherLifetimeExpire(int fd, GopherStateData *); static void gopherReadReply(int fd, GopherStateData *); -static void gopherSendComplete _PARAMS((int fd, +static void gopherSendComplete (int fd, char *buf, int size, int errflag, - void *data)); + void *data); static void gopherSendRequest(int fd, GopherStateData *); static GopherStateData *CreateGopherStateData(void); diff --git a/src/squid.h b/src/squid.h index 746e1071fb..7b9eaadc11 100644 --- a/src/squid.h +++ b/src/squid.h @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.45 1996/09/14 08:46:23 wessels Exp $ + * $Id: squid.h,v 1.46 1996/09/14 16:05:48 wessels Exp $ * * AUTHOR: Duane Wessels * @@ -216,7 +216,7 @@ typedef unsigned long u_num32; #include "GNUregex.h" #include "ansihelp.h" -typedef void (*SIH) _PARAMS((int, void *)); /* swap in */ +typedef void (*SIH) (int, void *); /* swap in */ typedef int (*QS) (const void *, const void *); #include "cache_cf.h" diff --git a/src/stmem.cc b/src/stmem.cc index 9769178076..417acefc34 100644 --- a/src/stmem.cc +++ b/src/stmem.cc @@ -1,5 +1,5 @@ /* - * $Id: stmem.cc,v 1.20 1996/09/14 08:46:28 wessels Exp $ + * $Id: stmem.cc,v 1.21 1996/09/14 16:05:49 wessels Exp $ * * DEBUG: section 19 Memory Primitives * AUTHOR: Harvest Derived @@ -247,57 +247,6 @@ memAppend(mem_ptr mem, char *data, int len) return len; } -#ifdef UNUSED_CODE -int -memGrep(mem_ptr mem, char *string, int nbytes) -{ - mem_node p = mem->head; - char *str_i, *mem_i; - int i = 0, blk_idx = 0, state, goal; - - debug(19, 6, "memGrep: looking for %s in less than %d bytes.\n", - string, nbytes); - - if (!p) - return 0; - - if (mem->origin_offset != 0) { - debug(19, 1, "memGrep: Some lower chunk of data has been erased. Can't do memGrep!\n"); - return 0; - } - str_i = string; - mem_i = p->data; - state = 1; - goal = strlen(string); - - while (i < nbytes) { - if (tolower(*mem_i++) == tolower(*str_i++)) - state++; - else { - state = 1; - str_i = string; - } - - i++; - blk_idx++; - - /* Return offset of byte beyond the matching string */ - if (state == goal) - return (i + 1); - - if (blk_idx >= p->len) { - if (p->next) { - p = p->next; - mem_i = p->data; - blk_idx = 0; - } else - break; - } - } - return 0; -} -#endif - int memCopy(mem_ptr mem, int offset, char *buf, int size) { @@ -366,9 +315,6 @@ memInit() new->mem_free_data_upto = memFreeDataUpto; new->mem_append = memAppend; new->mem_copy = memCopy; -#ifdef UNUSED_CODE - new->mem_grep = memGrep; -#endif return new; }