* unfortunately clutters up the declarations a bit, but I think it's
* worth it. */
-#if __STDC__
+#ifdef __STDC__
#define _RE_ARGS(args) args
/*
- * $Id: util.h,v 1.21 1996/09/20 23:26:52 wessels Exp $
+ * $Id: util.h,v 1.22 1996/10/09 15:34:15 wessels Exp $
*
* AUTHOR: Harvest Derived
*
extern void debug_init _PARAMS((void));
extern void log_errno2 _PARAMS((char *, int, char *));
-#if __STDC__
+#ifdef __STDC__
extern void Log _PARAMS((char *,...));
extern void errorlog _PARAMS((char *,...));
#else
* machines, compilers, `char' and `unsigned char' argument types.
* (Per Bothner suggested the basic approach.) */
#undef SIGN_EXTEND_CHAR
-#if __STDC__
+#ifdef __STDC__
#define SIGN_EXTEND_CHAR(c) ((signed char) (c))
#else /* not __STDC__ */
/* As in Harbison and Steele. */
#if HAVE_ERRNO_H
#include <errno.h>
#endif
-#if __STDC__
+#ifdef __STDC__
#if HAVE_STDDEF_H
#include <stddef.h>
#endif
/*
- * $Id: cache_cf.cc,v 1.103 1996/10/08 19:37:33 wessels Exp $
+ * $Id: cache_cf.cc,v 1.104 1996/10/09 15:34:19 wessels Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
char ForwardedBy[256];
char w_space[] = " \t\n";
-char null_string[] = "";
+static char null_string[] = "";
char config_input_line[BUFSIZ];
int config_lineno = 0;
+static char fatal_str[BUFSIZ];
static char *safe_xstrdup _PARAMS((char *p));
+static int ip_acl_match _PARAMS((struct in_addr, ip_acl *));
+static void addToIPACL _PARAMS((ip_acl **, char *, ip_access_type));
static void parseOnOff _PARAMS((int *));
static void parseIntegerValue _PARAMS((int *));
-static char fatal_str[BUFSIZ];
+static void self_destruct _PARAMS((void));
+static void wordlistAdd _PARAMS((wordlist **, char *));
static void configDoConfigure _PARAMS((void));
static void configSetFactoryDefaults _PARAMS((void));
static void parseMinutesLine _PARAMS((int *));
static void ip_acl_destroy _PARAMS((ip_acl **));
-void
+static void
self_destruct(void)
{
sprintf(fatal_str, "Bungled %s line %d: %s",
fatal(fatal_str);
}
-int
+static int
ip_acl_match(struct in_addr c, ip_acl * a)
{
static struct in_addr h;
}
-void
+static void
addToIPACL(ip_acl ** list, char *ip_str, ip_access_type access)
{
ip_acl *p, *q;
*list = NULL;
}
-void
+static void
wordlistAdd(wordlist ** list, char *key)
{
wordlist *p = NULL;
/*
- * $Id: cachemgr.cc,v 1.33 1996/10/07 15:06:06 wessels Exp $
+ * $Id: cachemgr.cc,v 1.34 1996/10/09 15:34:21 wessels Exp $
*
* DEBUG: Section 0 CGI Cache Manager
* AUTHOR: Harvest Derived
"Unknown Operation"
};
-int hasTables = FALSE;
+static int hasTables = FALSE;
-char *script_name = "/cgi-bin/cachemgr.cgi";
+static char *script_name = "/cgi-bin/cachemgr.cgi";
char *progname = NULL;
+static char x2c _PARAMS((char *));
static int client_comm_connect _PARAMS((int sock, char *dest_host, u_short dest_port));
+static void print_trailer _PARAMS((void));
+static void noargs_html _PARAMS((char *, int, char *));
+static void unescape_url _PARAMS((char *));
+static void plustospace _PARAMS((char *));
+static void parse_object _PARAMS((char *));
-void
+static void
print_trailer(void)
{
time_t now = time(NULL);
}
-void
+static void
noargs_html(char *host, int port, char *url)
{
op_t op = INFO;
#endif
/* A utility function from the NCSA httpd cgi-src utils.c */
-char
+static char
x2c(char *what)
{
char digit;
}
/* A utility function from the NCSA httpd cgi-src utils.c */
-void
+static void
unescape_url(char *url)
{
int x, y;
}
/* A utility function from the NCSA httpd cgi-src utils.c */
-void
+static void
plustospace(char *str)
{
int x;
}
-void
+static void
parse_object(char *string)
{
char *tmp_line = NULL;
/*
- * $Id: comm.cc,v 1.84 1996/10/08 21:20:50 wessels Exp $
+ * $Id: comm.cc,v 1.85 1996/10/09 15:34:22 wessels Exp $
*
* DEBUG: section 5 Socket Functions
* AUTHOR: Harvest Derived
FD_ENTRY *fd_table = NULL; /* also used in disk.c */
/* STATIC */
+static int commBind _PARAMS((int s, struct in_addr, u_short port));
+static int comm_cleanup_fd_entry _PARAMS((int));
+static int examine_select _PARAMS((fd_set *, fd_set *, fd_set *));
static void checkTimeouts _PARAMS((void));
static void checkLifetimes _PARAMS((void));
static void Reserve_More_FDs _PARAMS((void));
static void commSetReuseAddr _PARAMS((int));
-static int examine_select _PARAMS((fd_set *, fd_set *, fd_set *));
static void commSetNoLinger _PARAMS((int));
static void comm_select_incoming _PARAMS((void));
-static int commBind _PARAMS((int s, struct in_addr, u_short port));
static void RWStateCallbackAndFree _PARAMS((int fd, int code));
#ifdef TCP_NODELAY
static void commSetTcpNoDelay _PARAMS((int));
/* use to clean up fdtable when socket is closed without
* using comm_close */
-int
+static int
comm_cleanup_fd_entry(int fd)
{
FD_ENTRY *conn = &fd_table[fd];
int flags;
if ((flags = fcntl(fd, F_GETFL)) < 0) {
debug(5, 0, "FD %d: fcntl F_GETFL: %s\n", fd, xstrerror());
- return COMM_ERROR;
- }
- if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) < 0) {
- debug(5, 0, "FD %d: set close-on-exec failed: %s\n",
- fd, xstrerror());
+ return;
}
+ if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) < 0)
+ debug(5, 0, "FD %d: set close-on-exec failed: %s\n", fd, xstrerror());
#endif
}
/*
- * $Id: debug.cc,v 1.29 1996/09/24 20:16:39 wessels Exp $
+ * $Id: debug.cc,v 1.30 1996/10/09 15:34:22 wessels Exp $
*
* DEBUG: section 0 Debug Routines
* AUTHOR: Harvest Derived
#define MAX_DEBUG_SECTIONS 50
static int debugLevels[MAX_DEBUG_SECTIONS];
-#if __STDC__
+static char *accessLogTime _PARAMS((time_t));
+
+#ifdef __STDC__
void
_db_print(int section, int level, char *format,...)
{
if (debug_log == NULL)
return;
-#if __STDC__
+#ifdef __STDC__
va_start(args, format);
#else
va_start(args);
debugOpenLog(Config.Log.log);
}
-char *
+static char *
accessLogTime(time_t t)
{
struct tm *tm;
/*
- * $Id: disk.cc,v 1.31 1996/10/08 14:43:30 wessels Exp $
+ * $Id: disk.cc,v 1.32 1996/10/09 15:34:24 wessels Exp $
*
* DEBUG: section 6 Disk I/O Routines
* AUTHOR: Harvest Derived
/* table for FILE variable, write lock and queue. Indexed by fd. */
FileEntry *file_table;
+static int diskHandleRead _PARAMS((int, dread_ctrl *));
+static int diskHandleWalk _PARAMS((int, dwalk_ctrl *));
+static int diskHandleWrite _PARAMS((int, FileEntry *));
+
/* initialize table */
int
disk_init(void)
#if defined(O_NONBLOCK) && !defined(_SQUID_SUNOS_) && !defined(_SQUID_SOLARIS_)
mode |= O_NONBLOCK;
#else
- mode |= O_NDELAY;
+ mode |= O_NDELAY;
#endif
/* Open file */
memset(conn, '\0', sizeof(FD_ENTRY));
#ifdef DONT_DO_THIS
if (commSetNonBlocking(fd) != COMM_ERROR)
- conn->comm_type = COMM_NONBLOCKING;
+ conn->comm_type = COMM_NONBLOCKING;
#endif
return fd;
}
/* write handler */
-int
+static int
diskHandleWrite(int fd, FileEntry * entry)
{
int len;
/* Read from FD */
-int
+static int
diskHandleRead(int fd, dread_ctrl * ctrl_dat)
{
int len;
/* Read from FD and pass a line to routine. Walk to EOF. */
-int
+static int
diskHandleWalk(int fd, dwalk_ctrl * walk_dat)
{
int len;
/*
- * $Id: dnsserver.cc,v 1.24 1996/09/24 18:47:56 wessels Exp $
+ * $Id: dnsserver.cc,v 1.25 1996/10/09 15:34:24 wessels Exp $
*
* DEBUG: section 0 DNS Resolver
* AUTHOR: Harvest Derived
extern int _dns_ttl_; /* this is a really *dirty* hack - bne */
#endif
-int do_debug = 0;
+static int do_debug = 0;
/* error messages from gethostbyname() */
static char *
int alias_count = 0;
int i;
int c;
- extern char *optarg;
#if HAVE_RES_INIT
res_init();
/*
- * $Id: errorpage.cc,v 1.43 1996/09/26 19:19:43 wessels Exp $
+ * $Id: errorpage.cc,v 1.44 1996/10/09 15:34:25 wessels Exp $
*
* DEBUG: section 4 Error Generation
* AUTHOR: Duane Wessels
char *lng;
} error_data;
-error_data ErrorData[] =
+static error_data ErrorData[] =
{
{"ERR_READ_TIMEOUT",
"Read Timeout",
/*
- * $Id: fqdncache.cc,v 1.21 1996/09/20 06:28:42 wessels Exp $
+ * $Id: fqdncache.cc,v 1.22 1996/10/09 15:34:25 wessels Exp $
*
* DEBUG: section 35 FQDN Cache
* AUTHOR: Harvest Derived
'D'
};
-long fqdncache_low = 180;
-long fqdncache_high = 200;
+static long fqdncache_low = 180;
+static long fqdncache_high = 200;
static void
fqdncacheEnqueue(fqdncache_entry * f)
/*
- * $Id: ftp.cc,v 1.61 1996/09/20 19:29:25 wessels Exp $
+ * $Id: ftp.cc,v 1.62 1996/10/09 15:34:26 wessels Exp $
*
* DEBUG: section 9 File Transfer Protocol (FTP)
* AUTHOR: Harvest Derived
} FtpData;
/* Local functions */
-static int ftpStateFree _PARAMS((int fd, FtpData * ftpState));
-static void ftpProcessReplyHeader _PARAMS((FtpData * data, char *buf, int size));
-static void ftpServerClosed _PARAMS((int fd, void *nodata));
-static void ftp_login_parser _PARAMS((char *login, FtpData * data));
-static char *ftpTransferMode _PARAMS((char *urlpath));
-static char *ftpGetBasicAuth _PARAMS((char *req_hdr));
+static char *ftpTransferMode _PARAMS((char *));
+static char *ftpGetBasicAuth _PARAMS((char *));
+static int ftpReadReply _PARAMS((int, FtpData *));
+static int ftpStateFree _PARAMS((int, FtpData *));
+static void ftpConnInProgress _PARAMS((int, FtpData *));
+static void ftpLifetimeExpire _PARAMS((int, FtpData *));
+static void ftpProcessReplyHeader _PARAMS((FtpData *, char *, int));
+static void ftpSendComplete _PARAMS((int, char *, int, int, void *));
+static void ftpSendRequest _PARAMS((int, FtpData *));
+static void ftpServerClosed _PARAMS((int, void *));
+static void ftp_login_parser _PARAMS((char *, FtpData *));
/* Global functions not declared in ftp.h */
void ftpLifetimeExpire(int fd, FtpData * data);
}
/* This will be called when socket lifetime is expired. */
-void
+static void
ftpLifetimeExpire(int fd, FtpData * data)
{
StoreEntry *entry = NULL;
/* This will be called when data is ready to be read from fd. Read until
* error or connection closed. */
-int
+static int
ftpReadReply(int fd, FtpData * data)
{
LOCAL_ARRAY(char, buf, SQUID_TCP_SO_RCVBUF);
return 0;
}
-void
+static void
ftpSendComplete(int fd, char *buf, int size, int errflag, void *data)
{
FtpData *ftpState = (FtpData *) data;
return ftpBinary;
}
-void
+static void
ftpSendRequest(int fd, FtpData * data)
{
char *path = NULL;
put_free_8k_page);
}
-void
+static void
ftpConnInProgress(int fd, FtpData * data)
{
StoreEntry *entry = data->entry;
/*
- * $Id: http.cc,v 1.80 1996/10/08 14:48:34 wessels Exp $
+ * $Id: http.cc,v 1.81 1996/10/09 15:34:29 wessels Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
#define HTTP_DELETE_GAP (1<<18)
-struct {
+static struct {
int parsed;
int date;
int lm;
/*
- * $Id: ipcache.cc,v 1.66 1996/10/07 15:12:55 wessels Exp $
+ * $Id: ipcache.cc,v 1.67 1996/10/09 15:34:31 wessels Exp $
*
* DEBUG: section 14 IP Cache
* AUTHOR: Harvest Derived
'D'
};
-long ipcache_low = 180;
-long ipcache_high = 200;
+static long ipcache_low = 180;
+static long ipcache_high = 200;
static void
ipcacheEnqueue(ipcache_entry * i)
(int) (i->expires - squid_curtime),
i->addr_count);
for (k = 0; k < (int) i->addr_count; k++)
- xmemcpy(&addr.s_addr, i->entry.h_addr_list[k], sizeof(struct in_addr));
- storeAppendPrintf(sentry, " %15s", inet_ntoa(addr));
+ xmemcpy(&addr.s_addr, i->entry.h_addr_list[k], sizeof(struct in_addr));
+ storeAppendPrintf(sentry, " %15s", inet_ntoa(addr));
for (k = 0; k < (int) i->alias_count; k++)
storeAppendPrintf(sentry, " %s", i->entry.h_aliases[k]);
if (i->entry.h_name && strncmp(i->name, i->entry.h_name, MAX_LINELEN))
/*
- * $Id: main.cc,v 1.87 1996/09/24 20:17:31 wessels Exp $
+ * $Id: main.cc,v 1.88 1996/10/09 15:34:32 wessels Exp $
*
* DEBUG: section 1 Startup and Main Loop
* AUTHOR: Harvest Derived
static time_t next_announce;
static time_t next_ip_purge;
+static time_t mainMaintenance _PARAMS((void));
static void rotate_logs _PARAMS((int));
static void reconfigure _PARAMS((int));
static void mainInitialize _PARAMS((void));
static void mainReinitialize _PARAMS((void));
-static time_t mainMaintenance _PARAMS((void));
static void usage _PARAMS((void));
static void mainParseOptions _PARAMS((int, char **));
static void sendSignal _PARAMS((void));
+static void serverConnectionsOpen _PARAMS((void));
static void
usage(void)
opt_no_ipcache = 1;
break;
case 'k':
- if (strlen(optarg) < 1)
+ if ((int) strlen(optarg) < 1)
usage();
if (!strncmp(optarg, "reconfigure", strlen(optarg)))
opt_send_signal = SIGHUP;
break;
#else
fatal("Need to add -DMALLOC_DBG when compiling to use -m option");
+ /* NOTREACHED */
#endif
case 's':
opt_syslog_enable = 1;
#endif
}
-void
+static void
serverConnectionsOpen(void)
{
struct in_addr addr;
/*
- * $Id: neighbors.cc,v 1.60 1996/10/08 02:13:57 wessels Exp $
+ * $Id: neighbors.cc,v 1.61 1996/10/09 15:34:33 wessels Exp $
*
* DEBUG: section 15 Neighbor Routines
* AUTHOR: Harvest Derived
for (d = e->domains; d; d = d->next) {
if (matchDomainName(d->domain, request->host))
if (d->neighbor_type != EDGE_NONE)
- return d->neighbor_type;
+ return d->neighbor_type;
}
return e->type;
}
aclCheck_t checklist;
if (BIT_TEST(request->flags, REQ_NOCACHE))
- if (neighborType(e, request) == EDGE_SIBLING)
+ if (neighborType(e, request) == EDGE_SIBLING)
return 0;
if (e->domains == NULL && e->acls == NULL)
return do_ping;
/*
- * $Id: recv-announce.cc,v 1.10 1996/09/20 06:29:04 wessels Exp $
+ * $Id: recv-announce.cc,v 1.11 1996/10/09 15:34:35 wessels Exp $
*
* DEBUG: section 0 Announement Server
* AUTHOR: Harvest Derived
#include <unistd.h>
#include <signal.h>
+#include "ansiproto.h"
+
#define RECV_BUF_SIZE 8192
extern void xmemcpy _PARAMS((void *from, void *to, int len));
* usage: recv-announce logfile
*/
-void
+static void
sig_handle(void)
{
fflush(stdout);
/*
- * $Id: redirect.cc,v 1.21 1996/09/26 19:54:45 wessels Exp $
+ * $Id: redirect.cc,v 1.22 1996/10/09 15:34:35 wessels Exp $
*
* DEBUG: section 29 Redirector
* AUTHOR: Duane Wessels
if (redirect_child_table) {
for (k = 0; k < NRedirectors; k++) {
if (redirect_child_table[k]->inbuf)
- put_free_4k_page(redirect_child_table[k]->inbuf);
+ put_free_4k_page(redirect_child_table[k]->inbuf);
safe_free(redirect_child_table[k]);
}
safe_free(redirect_child_table);
/*
- * $Id: squid.h,v 1.57 1996/09/20 06:29:06 wessels Exp $
+ * $Id: squid.h,v 1.58 1996/10/09 15:34:36 wessels Exp $
*
* AUTHOR: Duane Wessels
*
#include <aio.h>
#endif
-#if __STDC__
+#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
/*
- * $Id: stat.cc,v 1.78 1996/09/24 20:17:32 wessels Exp $
+ * $Id: stat.cc,v 1.79 1996/10/09 15:34:37 wessels Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
info_get(cacheinfo * obj, StoreEntry * sentry)
{
char *tod = NULL;
- float f;
+ time_t f;
#if HAVE_MALLINFO
int t;
#endif
/*
- * $Id: stmem.cc,v 1.28 1996/09/26 19:54:47 wessels Exp $
+ * $Id: stmem.cc,v 1.29 1996/10/09 15:34:38 wessels Exp $
*
* DEBUG: section 19 Memory Primitives
* AUTHOR: Harvest Derived
#define USE_MEMALIGN 0
#endif
-static void *get_free_thing _PARAMS((stmem_stats * thing));
-static void put_free_thing _PARAMS((stmem_stats * thing, void *p));
-static void stmemFreeThingMemory _PARAMS((stmem_stats * thing));
+static int memFreeDataUpto _PARAMS((mem_ptr, int));
+static int memAppend _PARAMS((mem_ptr, char *, int));
+static int memCopy _PARAMS((mem_ptr, int, char *, int));
+static void *get_free_thing _PARAMS((stmem_stats *));
+static void put_free_thing _PARAMS((stmem_stats *, void *));
+static void stmemFreeThingMemory _PARAMS((stmem_stats *));
+static void memFree _PARAMS((mem_ptr));
+static void memFreeData _PARAMS((mem_ptr));
-
-void
+static void
memFree(mem_ptr mem)
{
mem_node lastp, p = mem->head;
safe_free(mem);
}
-void
+static void
memFreeData(mem_ptr mem)
{
mem_node lastp, p = mem->head;
mem->origin_offset = 0;
}
-int
+static int
memFreeDataUpto(mem_ptr mem, int target_offset)
{
int current_offset = mem->origin_offset;
/* Append incoming data. */
-int
+static int
memAppend(mem_ptr mem, char *data, int len)
{
mem_node p;
return len;
}
-int
+static int
memCopy(mem_ptr mem, int offset, char *buf, int size)
{
mem_node p = mem->head;
/*
- * $Id: store.cc,v 1.125 1996/10/08 14:48:37 wessels Exp $
+ * $Id: store.cc,v 1.126 1996/10/09 15:34:39 wessels Exp $
*
* DEBUG: section 20 Storeage Manager
* AUTHOR: Harvest Derived
int store_rebuilding = STORE_REBUILDING_SLOW;
/* Static Functions */
+static char *storeDescribeStatus _PARAMS((StoreEntry *));
+static char *storeSwapFullPath _PARAMS((int, char *));
+static HashID storeCreateHashTable _PARAMS((int (*)_PARAMS((char *, char *))));
+static hash_link *storeFindFirst _PARAMS((HashID));
+static hash_link *storeFindNext _PARAMS((HashID));
+static int compareLastRef _PARAMS((StoreEntry **, StoreEntry **));
+static int compareSize _PARAMS((StoreEntry **, StoreEntry **));
+static int storeAddSwapDisk _PARAMS((char *));
+static int storeCheckExpired _PARAMS((StoreEntry *));
+static int storeCheckPurgeMem _PARAMS((StoreEntry *));
+static int storeClientListSearch _PARAMS((MemObject *, int));
+static int storeCopy _PARAMS((StoreEntry *, int, int, char *, int *));
+static int storeEntryLocked _PARAMS((StoreEntry *));
+static int storeEntryValidLength _PARAMS((StoreEntry *));
+static int storeGetMemSpace _PARAMS((int));
+static int storeHashDelete _PARAMS((StoreEntry *));
+static int storeShouldPurgeMem _PARAMS((StoreEntry *));
+static int storeSwapInHandle _PARAMS((int, char *, int, int, StoreEntry *, int));
static int storeSwapInStart _PARAMS((StoreEntry *, SIH, void *));
+static int swapInError _PARAMS((int, StoreEntry *));
+static mem_ptr new_MemObjectData _PARAMS((void));
+static MemObject *new_MemObject _PARAMS((void));
+static StoreEntry *new_StoreEntry _PARAMS((int));
+static StoreEntry *storeAddDiskRestore _PARAMS((char *, int, int, time_t, time_t, time_t));
+static StoreEntry *storeGetInMemFirst _PARAMS((void));
+static StoreEntry *storeGetInMemNext _PARAMS((void));
+static unsigned int storeGetBucketNum _PARAMS((void));
static void destroy_MemObject _PARAMS((MemObject *));
static void destroy_MemObjectData _PARAMS((MemObject *));
static void destroy_StoreEntry _PARAMS((StoreEntry *));
-static MemObject *new_MemObject _PARAMS((void));
-static mem_ptr new_MemObjectData _PARAMS((void));
-static StoreEntry *new_StoreEntry _PARAMS((int mem_obj_flag));
-static int storeCheckPurgeMem _PARAMS((StoreEntry * e));
-static int storeCheckExpired _PARAMS((StoreEntry * e));
+static void storeClientListAdd _PARAMS((StoreEntry *, int, int));
+static void storeDeleteBehind _PARAMS((StoreEntry *));
+static void storePurgeMem _PARAMS((StoreEntry *));
+static void storeSanityCheck _PARAMS((void));
+static void storeSetMemStatus _PARAMS((StoreEntry *, mem_status_t));
+static void storeStartRebuildFromDisk _PARAMS((void));
static void storeSwapLog _PARAMS((StoreEntry *));
-static int storeHashDelete _PARAMS((StoreEntry *));
-static char *storeDescribeStatus _PARAMS((StoreEntry *));
-static int compareLastRef _PARAMS((StoreEntry ** e1, StoreEntry ** e2));
-static int compareSize _PARAMS((StoreEntry ** e1, StoreEntry ** e2));
-static int storeClientListSearch _PARAMS((MemObject *, int fd));
+static void storeSwapOutHandle _PARAMS((int, int, StoreEntry *));
static void storeHashMemInsert _PARAMS((StoreEntry *));
static void storeHashMemDelete _PARAMS((StoreEntry *));
-static int storeCopy _PARAMS((StoreEntry *, int, int, char *, int *));
-static int storeGetMemSpace _PARAMS((int size));
-static int storeShouldPurgeMem _PARAMS((StoreEntry * e));
/* Now, this table is inaccessible to outsider. They have to use a method
* to access a value in internal storage data structure. */
-HashID store_table = 0;
+static HashID store_table = 0;
/* hash table for in-memory-only objects */
-HashID in_mem_table = 0;
+static HashID in_mem_table = 0;
/* current memory storage size */
static unsigned long store_mem_size = 0;
static char tmp_filename[MAX_FILE_NAME_LEN];
/* patch cache_dir to accomodate multiple disk storage */
-char **CacheDirs = NULL;
+static char **CacheDirs = NULL;
static int CacheDirsAllocated = 0;
int ncache_dirs = 0;
* objects in the memory.
*/
-HashID
+static HashID
storeCreateHashTable(int (*cmp_func) (char *, char *))
{
store_table = hash_create(cmp_func, STORE_BUCKETS, hash_url);
* maintain the in-mem hash table according to the changes of mem_status
* This routine replaces the instruction "e->store_status = status;"
*/
-void
+static void
storeSetMemStatus(StoreEntry * e, mem_status_t status)
{
if (e->key == NULL) {
/* get rid of memory copy of the object */
/* Only call this if storeCheckPurgeMem(e) returns 1 */
-void
+static void
storePurgeMem(StoreEntry * e)
{
debug(20, 3, "storePurgeMem: Freeing memory-copy of %s\n", e->key);
/* Add a new object to the cache with empty memory copy and pointer to disk
* use to rebuild store from disk. */
-StoreEntry *
+static StoreEntry *
storeAddDiskRestore(char *url, int file_number, int size, time_t expires, time_t timestamp, time_t lastmod)
{
StoreEntry *e = NULL;
/* Call to delete behind upto "target lowest offset"
* also, update e_lowest_offset */
-void
+static void
storeDeleteBehind(StoreEntry * e)
{
MemObject *mem = e->mem_obj;
InvokeHandlers(e);
}
-#if __STDC__
+#ifdef __STDC__
void
storeAppendPrintf(StoreEntry * e, char *fmt,...)
{
}
/* add directory to swap disk */
-int
+static int
storeAddSwapDisk(char *path)
{
char **tmp = NULL;
/* return full name to swapfile */
-char *
+static char *
storeSwapFullPath(int fn, char *fullpath)
{
LOCAL_ARRAY(char, fullfilename, MAX_FILE_NAME_LEN);
}
/* swapping in handle */
-int
+static int
storeSwapInHandle(int fd_notused, char *buf, int len, int flag, StoreEntry * e, int offset_notused)
{
MemObject *mem = e->mem_obj;
xfree);
}
-void
+static void
storeSwapOutHandle(int fd, int flag, StoreEntry * e)
{
LOCAL_ARRAY(char, filename, MAX_FILE_NAME_LEN);
swaplog_lock = file_write_lock(swaplog_fd);
}
-void
+static void
storeStartRebuildFromDisk(void)
{
struct stat sb;
}
/* get the first in memory object entry in the storage */
-hash_link *
+static hash_link *
storeFindFirst(HashID id)
{
if (id == (HashID) 0)
/* get the next in memory object entry in the storage for a given
* search pointer */
-hash_link *
+static hash_link *
storeFindNext(HashID id)
{
if (id == (HashID) 0)
}
/* get the first in memory object entry in the storage */
-StoreEntry *
+static StoreEntry *
storeGetInMemFirst(void)
{
hash_link *first = NULL;
/* get the next in memory object entry in the storage for a given
* search pointer */
-StoreEntry *
+static StoreEntry *
storeGetInMemNext(void)
{
hash_link *next = NULL;
/* returns the bucket number to work on,
* pointer to next bucket after each calling
*/
-unsigned int
+static unsigned int
storeGetBucketNum(void)
{
static unsigned int bucket = 0;
}
/* return 1 if a store entry is locked */
-int
+static int
storeEntryLocked(StoreEntry * e)
{
if (e->lock_count)
}
/* add client with fd to client list */
-void
+static void
storeClientListAdd(StoreEntry * e, int fd, int last_offset)
{
int i;
return 1; /* STORE_PENDING, IN_MEMORY, exp=0 */
}
-int
+static int
storeEntryValidLength(StoreEntry * e)
{
int diff;
* storeSanityCheck - verify that all swap storage areas exist, and
* are writable; otherwise, force -z.
*/
-void
+static void
storeSanityCheck(void)
{
LOCAL_ARRAY(char, name, 4096);
return n;
}
-int
+static int
swapInError(int fd_unused, StoreEntry * entry)
{
squid_error_entry(entry, ERR_DISK_IO, xstrerror());
/*
- * $Id: tools.cc,v 1.66 1996/09/26 19:19:24 wessels Exp $
+ * $Id: tools.cc,v 1.67 1996/10/09 15:34:41 wessels Exp $
*
* DEBUG: section 21 Misc Functions
* AUTHOR: Harvest Derived
\n\
Thanks!\n"
+static void fatal_common _PARAMS((char *));
+static void mail_warranty _PARAMS((void));
+
static char *
dead_msg(void)
{
return msg;
}
-void
+static void
mail_warranty(void)
{
FILE *fp = NULL;
exit(0);
}
-void
+static void
fatal_common(char *message)
{
#if HAVE_SYSLOG
/*
- * $Id: url.cc,v 1.34 1996/09/17 02:30:07 wessels Exp $
+ * $Id: url.cc,v 1.35 1996/10/09 15:34:41 wessels Exp $
*
* DEBUG: section 23 URL Parsing
* AUTHOR: Duane Wessels
"CONNECT"
};
-char *ProtocolStr[] =
+static char *ProtocolStr[] =
{
"NONE",
"http",
static int url_acceptable[256];
static char hex[17] = "0123456789abcdef";
+static int urlDefaultPort _PARAMS((protocol_t p));
/* convert %xx in url string to a character
* Allocate a new string and return a pointer to converted string */
}
-int
+static int
urlDefaultPort(protocol_t p)
{
switch (p) {