From: wessels <> Date: Tue, 18 Aug 1998 05:00:36 +0000 (+0000) Subject: moved hash.c to ../lib X-Git-Tag: SQUID_3_0_PRE1~2874 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f703eacb405ff7f20700c30d8128183da6e4c522;p=thirdparty%2Fsquid.git moved hash.c to ../lib --- diff --git a/src/Makefile.in b/src/Makefile.in index c624227a39..9b3df1dd56 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,7 +1,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.158 1998/08/17 22:04:52 wessels Exp $ +# $Id: Makefile.in,v 1.159 1998/08/17 23:00:36 wessels Exp $ # # Uncomment and customize the following to suit your needs: # @@ -26,7 +26,6 @@ DNSSERVER_EXE = dnsserver$(exec_suffix) UNLINKD_EXE = unlinkd$(exec_suffix) PINGER_EXE = pinger$(exec_suffix) CACHEMGR_EXE = cachemgr$(cgi_suffix) -NCSA_AUTH_EXE = ncsa_auth$(exec_suffix) DEFAULT_CONFIG_FILE = $(sysconfdir)/squid.conf DEFAULT_MIME_TABLE = $(sysconfdir)/mime.conf @@ -41,7 +40,6 @@ DEFAULT_UNLINKD = $(libexecdir)/$(UNLINKD_EXE) DEFAULT_ICON_DIR = $(sysconfdir)/icons DEFAULT_ERROR_DIR = $(sysconfdir)/errors DEFAULT_MIB_PATH = $(sysconfdir)/mib.txt -DEFAULT_AUTH_PROGRAM = $(bindir)/$(NCSA_AUTH_EXE) DEFAULT_PASSWD_FILE = $(sysconfdir)/passwd CC = @CC@ @@ -78,7 +76,7 @@ STD_APP_LIBS = -L../lib -lmiscutil $(XTRA_LIBS) AUTH_LIBS = -L../lib -lmiscutil $(CRYPTLIB) $(XTRA_LIBS) PROGS = $(SQUID_EXE) $(CLIENT_EXE) -UTILS = $(DNSSERVER_EXE) $(UNLINKD_EXE) $(NCSA_AUTH_EXE) +UTILS = $(DNSSERVER_EXE) $(UNLINKD_EXE) SUID_UTILS = $(PINGER_EXE) CGIPROGS = $(CACHEMGR_EXE) OBJS = \ @@ -110,7 +108,6 @@ OBJS = \ ftp.o \ globals.o \ gopher.o \ - hash.o \ @HTCP_OBJS@ \ http.o \ http-anon.o \ @@ -225,17 +222,14 @@ $(PINGER_EXE): pinger.o $(UNLINKD_EXE): unlinkd-daemon.o $(CC) $(LDFLAGS) unlinkd-daemon.o -o $@ -$(NCSA_AUTH_EXE): ncsa_auth.o hash.o debug.o globals.o - $(CC) $(LDFLAGS) ncsa_auth.o hash.o debug.o globals.o -o $@ $(AUTH_LIBS) - unlinkd-daemon.o: unlinkd.c $(CC) -c $(CFLAGS) -DUNLINK_DAEMON $(srcdir)/unlinkd.c -o $@ -cache_diff: cache_diff.o debug.o globals.o hash.o store_key_md5.o - $(CC) -o $@ $(LDFLAGS) $@.o debug.o globals.o hash.o store_key_md5.o $(STD_APP_LIBS) +cache_diff: cache_diff.o debug.o globals.o store_key_md5.o + $(CC) -o $@ $(LDFLAGS) $@.o debug.o globals.o store_key_md5.o $(STD_APP_LIBS) -test_cache_digest: test_cache_digest.o CacheDigest.o debug.o globals.o hash.o store_key_md5.o - $(CC) -o $@ $(LDFLAGS) $@.o CacheDigest.o debug.o globals.o hash.o store_key_md5.o $(STD_APP_LIBS) +test_cache_digest: test_cache_digest.o CacheDigest.o debug.o globals.o store_key_md5.o + $(CC) -o $@ $(LDFLAGS) $@.o CacheDigest.o debug.o globals.o store_key_md5.o $(STD_APP_LIBS) cache_cf.o: cf_parser.c diff --git a/src/defines.h b/src/defines.h index 4308108a49..7d8beb2efc 100644 --- a/src/defines.h +++ b/src/defines.h @@ -1,6 +1,6 @@ /* - * $Id: defines.h,v 1.63 1998/08/17 22:04:57 wessels Exp $ + * $Id: defines.h,v 1.64 1998/08/17 23:00:37 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -92,26 +92,6 @@ #define FQDN_LOOKUP_IF_MISS 0x01 #define FQDN_MAX_NAMES 5 -/* - * Here are some good prime number choices. It's important not to - * choose a prime number that is too close to exact powers of 2. - * - * HASH_SIZE 103 // prime number < 128 - * HASH_SIZE 229 // prime number < 256 - * HASH_SIZE 467 // prime number < 512 - * HASH_SIZE 977 // prime number < 1024 - * HASH_SIZE 1979 // prime number < 2048 - * HASH_SIZE 4019 // prime number < 4096 - * HASH_SIZE 6037 // prime number < 6144 - * HASH_SIZE 7951 // prime number < 8192 - * HASH_SIZE 12149 // prime number < 12288 - * HASH_SIZE 16231 // prime number < 16384 - * HASH_SIZE 33493 // prime number < 32768 - * HASH_SIZE 65357 // prime number < 65536 - */ - -#define DEFAULT_HASH_SIZE 7951 /* prime number < 8192 */ - #define HTTP_REPLY_FIELD_SZ 128 #define BUF_TYPE_8K 1 diff --git a/src/protos.h b/src/protos.h index 42d2edcca9..c8d84e29a0 100644 --- a/src/protos.h +++ b/src/protos.h @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.249 1998/08/17 22:05:01 wessels Exp $ + * $Id: protos.h,v 1.250 1998/08/17 23:00:39 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -252,20 +252,6 @@ extern int gopherCachable(const char *); extern void whoisStart(FwdState *, int fd); -extern hash_table *hash_create(HASHCMP *, int, HASHHASH *); -extern void hash_join(hash_table *, hash_link *); -extern void hash_remove_link(hash_table *, hash_link *); -extern int hashPrime(int n); -extern void *hash_lookup(hash_table *, const void *); -extern void hash_first(hash_table *); -extern void *hash_next(hash_table *); -extern hash_link *hash_get_bucket(hash_table *, unsigned int); -extern void hashFreeMemory(hash_table *); -extern void hashFreeItems(hash_table *, FREE *); -extern HASHHASH hash_string; -extern HASHHASH hash_url; -extern HASHHASH hash4; - extern int httpCachable(method_t); extern void httpStart(FwdState *, int fd); extern void httpParseReplyHeaders(const char *, http_reply *); diff --git a/src/squid.h b/src/squid.h index fbfd7240ff..18d1bfdaa5 100644 --- a/src/squid.h +++ b/src/squid.h @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.176 1998/08/13 17:38:18 wessels Exp $ + * $Id: squid.h,v 1.177 1998/08/17 23:00:41 wessels Exp $ * * AUTHOR: Duane Wessels * @@ -329,6 +329,8 @@ struct rusage { #include "cache_snmp.h" #endif +#include "hash.h" + #include "defines.h" #include "enums.h" #include "typedefs.h" diff --git a/src/structs.h b/src/structs.h index 656eb35941..fc1f882c93 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.201 1998/08/17 22:05:02 wessels Exp $ + * $Id: structs.h,v 1.202 1998/08/17 23:00:42 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -283,8 +283,7 @@ struct _SquidConfig { struct { char *dnsserver; char *redirect; - char *authenticate; - wordlist *authenticate_options; + wordlist *authenticate; char *pinger; char *unlinkd; } Program; @@ -533,21 +532,6 @@ struct _fileMap { unsigned long *file_map; }; -struct _hash_link { - char *key; - hash_link *next; -}; - -struct _hash_table { - hash_link **buckets; - HASHCMP *cmp; - HASHHASH *hash; - unsigned int size; - unsigned int current_slot; - hash_link *next; - int count; -}; - /* auto-growing memory-resident buffer with printf interface */ /* note: when updating this struct, update MemBufNULL #define */ struct _MemBuf { diff --git a/src/typedefs.h b/src/typedefs.h index 978c735373..bbef55b1fa 100644 --- a/src/typedefs.h +++ b/src/typedefs.h @@ -1,6 +1,6 @@ /* - * $Id: typedefs.h,v 1.68 1998/08/17 16:44:13 wessels Exp $ + * $Id: typedefs.h,v 1.69 1998/08/17 23:00:43 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -81,8 +81,6 @@ typedef struct _fde fde; typedef struct _fileMap fileMap; typedef struct _fqdncache_entry fqdncache_entry; typedef struct _fqdn_pending fqdn_pending; -typedef struct _hash_link hash_link; -typedef struct _hash_table hash_table; typedef struct _HttpReply http_reply; typedef struct _HttpStatusLine HttpStatusLine; typedef struct _HttpHeaderFieldAttrs HttpHeaderFieldAttrs; @@ -175,8 +173,6 @@ typedef void PF(int, void *); typedef void DRCB(int fd, const char *buf, int size, int errflag, void *data); typedef void DWCB(int, int, size_t, void *); typedef void FQDNH(const char *, void *); -typedef int HASHCMP(const void *, const void *); -typedef unsigned int HASHHASH(const void *, unsigned int); typedef void IDCB(void *); typedef void IPH(const ipcache_addrs *, void *); typedef void IRCB(peer *, peer_t, icp_common_t *, void *data);