/*
- * $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
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);
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)
{
/*
- * $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
#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;
/*
- * $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
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
/* 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;
/*
- * $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
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);
/*
- * $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
*
#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"
/*
- * $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
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)
{
new->mem_free_data_upto = memFreeDataUpto;
new->mem_append = memAppend;
new->mem_copy = memCopy;
-#ifdef UNUSED_CODE
- new->mem_grep = memGrep;
-#endif
return new;
}