]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleaned up the namespace (local functions made static)
authorhno <>
Thu, 8 Feb 2001 01:56:50 +0000 (01:56 +0000)
committerhno <>
Thu, 8 Feb 2001 01:56:50 +0000 (01:56 +0000)
36 files changed:
include/Array.h
include/util.h
lib/Array.cc
lib/base64.c
lib/heap.c
lib/iso3307.c
lib/ntlmauth.c
lib/radix.c
lib/rfc1035.c
lib/rfc1738.c
lib/safe_inet_addr.c
lib/stub_memaccount.c
src/HttpHdrRange.cc
src/HttpHeaderTools.cc
src/access_log.cc
src/acl.cc
src/asn.cc
src/auth/basic/auth_basic.cc
src/authenticate.cc
src/cache_cf.cc
src/client_side.cc
src/debug.cc
src/fs/aufs/store_dir_aufs.cc
src/fs/coss/store_dir_coss.cc
src/fs/diskd/diskd.cc
src/fs/diskd/store_dir_diskd.cc
src/fs/ufs/store_dir_ufs.cc
src/peer_digest.cc
src/peer_select.cc
src/protos.h
src/repl/heap/store_heap_replacement.cc
src/repl/heap/store_repl_heap.cc
src/repl/lru/store_repl_lru.cc
src/snmp_agent.cc
src/stat.cc
src/typedefs.h

index e2162e57bd82ac0bfde232c0f3acd1c8453bdccd..ac87defa5a89130eb1b4dc460d770c4804539f23 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: Array.h,v 1.4 2001/01/12 00:37:12 wessels Exp $
+ * $Id: Array.h,v 1.5 2001/02/07 18:56:50 hno Exp $
  *
  * AUTHOR: Alex Rousskov
  *
@@ -43,7 +43,7 @@ typedef struct {
 } Array;
 
 
-extern Array *arrayCreate();
+extern Array *arrayCreate(void);
 extern void arrayInit(Array * s);
 extern void arrayClean(Array * s);
 extern void arrayDestroy(Array * s);
index a34f5d5c53697e7dd0fd9a561bf30a6b14cb74f3..c76386a4d2f957c983eb9c5f5b87b5bc5e159dbe 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: util.h,v 1.58 2001/01/12 00:37:12 wessels Exp $
+ * $Id: util.h,v 1.59 2001/02/07 18:56:50 hno Exp $
  *
  * AUTHOR: Harvest Derived
  *
@@ -127,4 +127,9 @@ extern const char *xitoa(int num);
 double drand48(void);
 #endif
 
+/*
+ * Returns the amount of known allocated memory
+ */
+int statMemoryAccounted(void);
+
 #endif /* ndef _UTIL_H_ */
index 470999855ebd75902ab5674107148ceee313e319..2a3024e5995d70e7425fa86e7fdfa98f675c75d1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: Array.cc,v 1.6 2001/01/12 00:37:12 wessels Exp $
+ * $Id: Array.cc,v 1.7 2001/02/07 18:56:50 hno Exp $
  *
  * AUTHOR: Alex Rousskov
  *
@@ -41,6 +41,8 @@
 
 
 #include "config.h"
+#include "Array.h"
+
 #if HAVE_ASSERT_H
 #include <assert.h>
 #endif
@@ -53,7 +55,7 @@
 static void arrayGrow(Array * a, int min_capacity);
 
 Array *
-arrayCreate()
+arrayCreate(void)
 {
     Array *a = xmalloc(sizeof(Array));
     arrayInit(a);
index 75c46d458fa21098ab9a1ec805d2550c1e44e45d..042d34fd0769f087e707b4880e2ddf2108547ad8 100644 (file)
@@ -1,8 +1,9 @@
 /*
- * $Id: base64.c,v 1.17 2001/01/07 23:36:36 hno Exp $
+ * $Id: base64.c,v 1.18 2001/02/07 18:56:50 hno Exp $
  */
 
 #include "config.h"
+#include "util.h"
 
 #if HAVE_STDIO_H
 #include <stdio.h>
@@ -11,6 +12,7 @@
 #include <stdlib.h>
 #endif
 
+
 static void base64_init(void);
 
 static int base64_initialized = 0;
index 746d7ae238d4662639dc9c6554f2ad972db9a2c1..1c62db91b75dd78be75ec2d2d84bd46d949e4bac 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: heap.c,v 1.7 2001/01/12 00:37:12 wessels Exp $
+ * $Id: heap.c,v 1.8 2001/02/07 18:56:50 hno Exp $
  *
  * AUTHOR: John Dilley, Hewlett Packard
  *
@@ -38,6 +38,7 @@
  ****************************************************************************/
 
 #include "config.h"
+#include "heap.h"
 
 #if HAVE_STDLIB_H
 #include <stdlib.h>
@@ -482,7 +483,7 @@ _heap_node_exist(heap * hp, int id)
 /* 
  * Print the heap in element order, id..last. 
  */
-void
+static void
 heap_print_inorder(heap * hp, int id)
 {
     while (id < hp->last) {
index 83191ea407f105851389bc80393572d3845be12d..2b5f764eb636279870bfb1f7f1a45c404a55a897 100644 (file)
@@ -1,8 +1,9 @@
 /*
- * $Id: iso3307.c,v 1.4 1998/09/23 17:16:11 wessels Exp $
+ * $Id: iso3307.c,v 1.5 2001/02/07 18:56:50 hno Exp $
  */
 
 #include "config.h"
+#include "util.h"
 
 #if HAVE_STDIO_H
 #include <stdio.h>
index 5158798a4adee9799d758f60a0ebc12d46a2c5c9..bb0a98da87ebc67faa0e4d4d72e1a7ad6f820850 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ntlmauth.c,v 1.1 2001/01/07 23:36:36 hno Exp $
+ * $Id: ntlmauth.c,v 1.2 2001/02/07 18:56:50 hno Exp $
  *
  * * * * * * * * Legal stuff * * * * * * *
  *
@@ -24,6 +24,7 @@
 #include "ntlmauth.h"
 #include "util.h"              /* for base64-related stuff */
 
+#if UNUSED_CODE
 /* Dumps NTLM flags to standard error for debugging purposes */
 void
 ntlm_dump_ntlmssp_flags(u_int32_t flags)
@@ -50,6 +51,7 @@ ntlm_dump_ntlmssp_flags(u_int32_t flags)
        (flags & REQUEST_NON_NT_SESSION_KEY ? "Req_nonnt_sesskey " : "")
        );
 }
+#endif
 
 #define lstring_zero(s) s.str=NULL; s.l=-1;
 
index 59aaa604cd449f70a41421ead04118d4123441ab..e07110701456048b9901d35331efc63cfeef1457 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: radix.c,v 1.11 2001/01/12 00:37:12 wessels Exp $
+ * $Id: radix.c,v 1.12 2001/02/07 18:56:50 hno Exp $
  *
  * DEBUG: section 53     Radix tree data structure implementation
  * AUTHOR: NetBSD Derived
@@ -69,6 +69,7 @@
  */
 
 #include "config.h"
+#include "radix.h"
 
 #if HAVE_UNISTD_H
 #include <unistd.h>
@@ -220,7 +221,7 @@ rn_refines(m_arg, n_arg)
     return (!masks_are_equal);
 }
 
-struct radix_node *
+static struct radix_node *
 rn_lookup(v_arg, m_arg, head)
      void *v_arg, *m_arg;
      struct radix_node_head *head;
index dcd6b1ac6f3553a9ec9ac648db7fd0cbf0606df0..f74b6ecb247efcc94392f0119e81327aa6d11e6d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: rfc1035.c,v 1.20 2001/01/12 00:37:12 wessels Exp $
+ * $Id: rfc1035.c,v 1.21 2001/02/07 18:56:50 hno Exp $
  *
  * Low level DNS protocol routines
  * AUTHOR: Duane Wessels
@@ -174,7 +174,7 @@ rfc1035LabelPack(char *buf, size_t sz, const char *label)
  * Note message compression is not supported here.
  * Returns number of octets packed.
  */
-off_t
+static off_t
 rfc1035NamePack(char *buf, size_t sz, const char *name)
 {
     off_t off = 0;
@@ -423,7 +423,7 @@ rfc1035AnswersUnpack(const char *buf,
     rfc1035_rr ** records,
     unsigned short *id)
 {
-    off_t off = 0;
+    size_t off = 0;
     int l;
     int i;
     int nr = 0;
@@ -482,7 +482,7 @@ unsigned short
 rfc1035BuildAQuery(const char *hostname, char *buf, size_t * szp)
 {
     static rfc1035_header h;
-    off_t offset = 0;
+    size_t offset = 0;
     size_t sz = *szp;
     memset(&h, '\0', sizeof(h));
     /* the first char of hostname must be alphanmeric */
@@ -520,7 +520,7 @@ unsigned short
 rfc1035BuildPTRQuery(const struct in_addr addr, char *buf, size_t * szp)
 {
     static rfc1035_header h;
-    off_t offset = 0;
+    size_t offset = 0;
     size_t sz = *szp;
     static char rev[32];
     unsigned int i;
@@ -543,7 +543,7 @@ rfc1035BuildPTRQuery(const struct in_addr addr, char *buf, size_t * szp)
        RFC1035_TYPE_PTR,
        RFC1035_CLASS_IN);
     assert(offset <= sz);
-    *szp = (size_t) offset;
+    *szp = offset;
     return h.id;
 }
 
index b1e3b1f07376315212a39dcd93d0830adc529808..9a2d429e63b9375e823c721e18b422485ce8b6ac 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rfc1738.c,v 1.22 2001/01/12 00:37:13 wessels Exp $
+ * $Id: rfc1738.c,v 1.23 2001/02/07 18:56:51 hno Exp $
  *
  * DEBUG: 
  * AUTHOR: Harvest Derived
@@ -92,7 +92,7 @@ rfc1738_do_escape(const char *url, int encode_reserved)
     static size_t bufsize = 0;
     const char *p;
     char *q;
-    int i, do_escape;
+    unsigned int i, do_escape;
 
     if (buf == NULL || strlen(url) * 3 > bufsize) {
        xfree(buf);
index 1d0756a8cd9e7ccfc78b97426d0dfa5d9c6a9ca0..04a042e246861f3ef60d9382949c4a1f5315fa9b 100644 (file)
@@ -1,9 +1,10 @@
 
 /*
- * $Id: safe_inet_addr.c,v 1.11 1999/05/04 21:20:41 wessels Exp $
+ * $Id: safe_inet_addr.c,v 1.12 2001/02/07 18:56:51 hno Exp $
  */
 
 #include "config.h"
+#include "util.h"
 
 #if HAVE_STDIO_H
 #include <stdio.h>
index d576dbce2c5a8c5535f1061d5f47c0c00775a5a3..3f3b4f4f19ff4048f5479af72a09b660e054e78e 100644 (file)
@@ -1,9 +1,10 @@
 /*
- * $Id: stub_memaccount.c,v 1.4 1999/05/04 21:20:42 wessels Exp $
+ * $Id: stub_memaccount.c,v 1.5 2001/02/07 18:56:51 hno Exp $
  */
 
 /* Stub function for programs not implementing statMemoryAccounted */
-#include <config.h>
+#include "config.h"
+#include "util.h"
 int
 statMemoryAccounted(void)
 {
index 9950ab920fe846960b1fdfa764223f29889760a4..d969670220cf56e6b65c23bac3ef2aec4f3d3d3f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpHdrRange.cc,v 1.24 2001/01/12 00:37:13 wessels Exp $
+ * $Id: HttpHdrRange.cc,v 1.25 2001/02/07 18:56:51 hno Exp $
  *
  * DEBUG: section 64    HTTP Range Header
  * AUTHOR: Alex Rousskov
@@ -208,7 +208,7 @@ httpHdrRangeSpecMergeWith(HttpHdrRangeSpec * recep, const HttpHdrRangeSpec * don
  * Range
  */
 
-HttpHdrRange *
+static HttpHdrRange *
 httpHdrRangeCreate(void)
 {
     HttpHdrRange *r = memAllocate(MEM_HTTP_HDR_RANGE);
index 41edef9c0a635cb50f81b1f0ffa31fa98460c416..1063688b3deeab3aad665535caa524e4f836017e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpHeaderTools.cc,v 1.30 2001/01/12 00:37:14 wessels Exp $
+ * $Id: HttpHeaderTools.cc,v 1.31 2001/02/07 18:56:51 hno Exp $
  *
  * DEBUG: section 66    HTTP Header Tools
  * AUTHOR: Alex Rousskov
@@ -35,7 +35,9 @@
 
 #include "squid.h"
 
+#if UNUSED_CODE
 static int httpHeaderStrCmp(const char *h1, const char *h2, int len);
+#endif
 static void httpHeaderPutStrvf(HttpHeader * hdr, http_hdr_type id, const char *fmt, va_list vargs);
 
 
@@ -312,6 +314,7 @@ httpHeaderParseSize(const char *start, ssize_t * value)
  * parses a given string then packs compiled headers and compares the result
  * with the original, reports discrepancies
  */
+#if UNUSED_CODE
 void
 httpHeaderTestParser(const char *hstr)
 {
@@ -362,9 +365,11 @@ httpHeaderTestParser(const char *hstr)
     packerClean(&p);
     memBufClean(&mb);
 }
+#endif
 
 
 /* like strncasecmp but ignores ws characters */
+#if UNUSED_CODE
 static int
 httpHeaderStrCmp(const char *h1, const char *h2, int len)
 {
@@ -391,12 +396,13 @@ httpHeaderStrCmp(const char *h1, const char *h2, int len)
     /* NOTREACHED */
     return 0;
 }
+#endif
 
 /*
  * httpHdrMangle checks the anonymizer (header_access) configuration.
  * Returns 1 if the header is allowed.
  */
-int
+static int
 httpHdrMangle(HttpHeaderEntry * e, request_t * request)
 {
     int retval;
index 97876506d57dee94cc6fdc27891230644b19a037..e30cc9f556e0f2528fe846fb1e114c399cf98e27 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: access_log.cc,v 1.66 2001/01/12 00:37:14 wessels Exp $
+ * $Id: access_log.cc,v 1.67 2001/02/07 18:56:51 hno Exp $
  *
  * DEBUG: section 46    Access Log
  * AUTHOR: Duane Wessels
@@ -182,7 +182,7 @@ log_quote(const char *header)
     return buf;
 }
 
-char *
+static char *
 username_quote(const char *header)
 /* copy of log_quote. Bugs there will be found here */
 {
@@ -223,7 +223,7 @@ username_quote(const char *header)
     return buf;
 }
 
-char *
+static char *
 accessLogFormatName(const char *name)
 {
     if (NULL == name)
index 79c5ed8dfbd2c394e631a723db54b7f9bc03c9d1..473b50cc9014b2ba89f42685f3313e46cd5cba30 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: acl.cc,v 1.245 2001/02/01 18:47:46 hno Exp $
+ * $Id: acl.cc,v 1.246 2001/02/07 18:56:51 hno Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -43,7 +43,9 @@ static void aclParseDomainList(void *curlist);
 static void aclParseUserList(void **current);
 static void aclParseIpList(void *curlist);
 static void aclParseIntlist(void *curlist);
+#if SQUID_SNMP
 static void aclParseWordList(void *curlist);
+#endif
 static void aclParseProtoList(void *curlist);
 static void aclParseMethodList(void *curlist);
 static void aclParseTimeSpec(void *curlist);
@@ -629,6 +631,7 @@ aclParseRegexList(void *curlist)
     }
 }
 
+#if SQUID_SNMP
 static void
 aclParseWordList(void *curlist)
 {
@@ -636,6 +639,7 @@ aclParseWordList(void *curlist)
     while ((t = strtokFile()))
        wordlistAdd(curlist, t);
 }
+#endif
 
 static void
 aclParseUserList(void **current)
@@ -2198,7 +2202,7 @@ aclDumpUserListWalkee(void *node_data, void *outlist)
     wordlistAdd(outlist, node_data);
 }
 
-wordlist *
+static wordlist *
 aclDumpUserList(acl_user_data * data)
 {
     wordlist *wl = NULL;
index 4eaf5f95e3b6ab46f587728cdcc9095778e2dc3a..69380c9541e5e0c7bf2f5f3bdd53cd64726c5bbb 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: asn.cc,v 1.68 2001/01/12 00:37:14 wessels Exp $
+ * $Id: asn.cc,v 1.69 2001/02/07 18:56:51 hno Exp $
  *
  * DEBUG: section 53    AS Number handling
  * AUTHOR: Duane Wessels, Kostas Anagnostakis
@@ -410,7 +410,7 @@ destroyRadixNodeInfo(as_info * e_info)
     xfree(data);
 }
 
-int
+static int
 mask_len(int mask)
 {
     int len = 32;
index 82ed246c3997925319f312fa26e8906a0f4b6149..d3081dccd5f99c1296b3ebc64e84e157dce5a4d1 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: auth_basic.cc,v 1.5 2001/01/31 22:16:40 hno Exp $
+ * $Id: auth_basic.cc,v 1.6 2001/02/07 18:56:53 hno Exp $
  *
  * DEBUG: section 29    Authenticator
  * AUTHOR: Duane Wessels
@@ -74,29 +74,14 @@ static auth_basic_config *basicConfig = NULL;
 static int authbasic_initialised = 0;
 MemPool *basic_data_pool = NULL;
 
+
 /*
  *
- * Private Functions
+ * Public Functions
  *
  */
 
-void
-authBasicDone(void)
-{
-    if (basicauthenticators)
-       helperShutdown(basicauthenticators);
-    authbasic_initialised = 0;
-    if (!shutting_down)
-       return;
-    if (basicauthenticators)
-       helperFree(basicauthenticators);
-    basicauthenticators = NULL;
-    if (basic_data_pool) {
-       memPoolDestroy(basic_data_pool);
-       basic_data_pool = NULL;
-    }
-    debug(29, 2) ("authBasicDone: Basic authentication Shutdown.\n");
-}
+AUTHSSETUP authSchemeSetup_basic;
 
 void
 authSchemeSetup_basic(authscheme_entry_t * authscheme)
@@ -121,13 +106,33 @@ authSchemeSetup_basic(authscheme_entry_t * authscheme)
     authscheme->donefunc = authBasicDone;
 }
 
-int
+/* internal functions */
+
+static void
+authBasicDone(void)
+{
+    if (basicauthenticators)
+       helperShutdown(basicauthenticators);
+    authbasic_initialised = 0;
+    if (!shutting_down)
+       return;
+    if (basicauthenticators)
+       helperFree(basicauthenticators);
+    basicauthenticators = NULL;
+    if (basic_data_pool) {
+       memPoolDestroy(basic_data_pool);
+       basic_data_pool = NULL;
+    }
+    debug(29, 2) ("authBasicDone: Basic authentication Shutdown.\n");
+}
+
+static int
 authenticateBasicActive()
 {
     return (authbasic_initialised == 1) ? 1 : 0;
 }
 
-int
+static int
 authBasicConfigured()
 {
     if ((basicConfig != NULL) && (basicConfig->authenticate != NULL) &&
@@ -140,7 +145,7 @@ authBasicConfigured()
     return 0;
 }
 
-int
+static int
 authenticateBasicAuthenticated(auth_user_request_t * auth_user_request)
 {
     basic_data *basic_auth = auth_user_request->auth_user->scheme_data;
@@ -150,11 +155,13 @@ authenticateBasicAuthenticated(auth_user_request_t * auth_user_request)
     return 0;
 }
 
-int
+#if UNUSED_CODE
+static int
 authenticateBasiccmpUsername(basic_data * u1, basic_data * u2)
 {
     return strcmp(u1->username, u2->username);
 }
+#endif
 
 /* log a basic user in
  */
@@ -354,7 +361,7 @@ authenticateBasicUsername(auth_user_t * auth_user)
     return NULL;
 }
 
-basic_data *
+static basic_data *
 authBasicDataNew()
 {
     basic_data *temp;
@@ -366,12 +373,14 @@ authBasicDataNew()
     return temp;
 }
 
-void
+#if UNUSED_CODE
+static void
 authBasicDataFree(basic_data * basic_auth)
 {
 }
+#endif
 
-auth_user_t *
+static auth_user_t *
 authBasicAuthUserFindUsername(const char *username)
 {
     auth_user_hash_pointer *usernamehash;
index ebd57c9ed39aa5babc45acac6a894d87f9e69568..ea0d610b302170b927902eee0c8cf0e1d591f13c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: authenticate.cc,v 1.20 2001/01/31 22:16:38 hno Exp $
+ * $Id: authenticate.cc,v 1.21 2001/02/07 18:56:51 hno Exp $
  *
  * DEBUG: section 29    Authenticator
  * AUTHOR: Duane Wessels
@@ -54,7 +54,7 @@ MemPool *auth_user_request_pool = NULL;
 /* Generic Functions */
 
 
-int
+static int
 authenticateAuthSchemeConfigured(const char *proxy_auth)
 {
     authScheme *scheme;
@@ -177,8 +177,8 @@ authenticateAuthUserNew(const char *scheme)
     return temp_auth;
 }
 
-auth_user_request_t *
-authenticateAuthUserRequestNew()
+static auth_user_request_t *
+authenticateAuthUserRequestNew(void)
 {
     auth_user_request_t *temp_request;
     if (!auth_user_request_pool)
@@ -192,7 +192,7 @@ authenticateAuthUserRequestNew()
     return temp_request;
 }
 
-void
+static void
 authenticateAuthUserRequestFree(auth_user_request_t * auth_user_request)
 {
     dlink_node *link;
@@ -322,7 +322,7 @@ authenticateDirection(auth_user_request_t * auth_user_request)
 }
 
 int
-authenticateActiveSchemeCount()
+authenticateActiveSchemeCount(void)
 {
     int i = 0, rv = 0;
     for (i = 0; authscheme_list && authscheme_list[i].typestr; i++)
@@ -333,7 +333,7 @@ authenticateActiveSchemeCount()
 }
 
 int
-authenticateSchemeCount()
+authenticateSchemeCount(void)
 {
     int i = 0, rv = 0;
     for (i = 0; authscheme_list && authscheme_list[i].typestr; i++)
@@ -562,7 +562,7 @@ authenticateFreeProxyAuthUser(void *data)
 }
 
 void
-authenticateInitUserCache()
+authenticateInitUserCache(void)
 {
     if (!proxy_auth_username_cache) {
        /* First time around, 7921 should be big enough */
@@ -613,7 +613,7 @@ authenticateProxyUserCacheCleanup(void *datanotused)
  */
 
 void
-authenticateUserCacheRestart()
+authenticateUserCacheRestart(void)
 {
     auth_user_hash_pointer *usernamehash;
     auth_user_t *auth_user;
index 0eef05ef4231da1097465b470f502bdb26abbe2a..6c00e90f3ecd3754346453c883f126d1ce13a97e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.cc,v 1.373 2001/01/30 09:46:46 hno Exp $
+ * $Id: cache_cf.cc,v 1.374 2001/02/07 18:56:51 hno Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -388,23 +388,23 @@ configDoConfigure(void)
        Config2.onoff.enable_purge = 1;
     if (geteuid() == 0) {
        if (NULL != Config.effectiveUser) {
-           struct passwd *pwd = getpwnam(Config.effectiveUser);
-           if (NULL == pwd)
-           /*
-            * Andres Kroonmaa <andre@online.ee>:
-            * Some getpwnam() implementations (Solaris?) require
-            * an available FD < 256 for opening a FILE* to the
-            * passwd file.
-            * DW:
-            * This should be safe at startup, but might still fail
-            * during reconfigure.
-            */
-               fatalf("getpwnam failed to find userid for effective user '%s'",
-                   Config.effectiveUser,
-                   xstrerror());
-           Config2.effectiveUserID = pwd->pw_uid;
+           struct passwd *pwd = getpwnam(Config.effectiveUser);
+           if (NULL == pwd)
+               /*
+                * Andres Kroonmaa <andre@online.ee>:
+                * Some getpwnam() implementations (Solaris?) require
+                * an available FD < 256 for opening a FILE* to the
+                * passwd file.
+                * DW:
+                * This should be safe at startup, but might still fail
+                * during reconfigure.
+                */
+               fatalf("getpwnam failed to find userid for effective user '%s'",
+                   Config.effectiveUser,
+                   xstrerror());
+           Config2.effectiveUserID = pwd->pw_uid;
            Config2.effectiveGroupID = pwd->pw_gid;
-               }
+       }
     } else {
        Config2.effectiveUserID = geteuid();
        Config2.effectiveGroupID = getegid();
@@ -916,7 +916,7 @@ check_null_string(char *s)
     return s == NULL;
 }
 
-void
+static void
 allocate_new_authScheme(authConfig * cfg)
 {
     if (cfg->schemes == NULL) {
@@ -1115,7 +1115,7 @@ free_cachedir(cacheSwap * swap)
     swap->n_configured = 0;
 }
 
-const char *
+static const char *
 peer_type_str(const peer_t type)
 {
     switch (type) {
@@ -1702,9 +1702,9 @@ parse_eol(char *volatile *var)
     unsigned char *token = strtok(NULL, null_string);
     safe_free(*var);
     if (token == NULL)
-       self_destruct();
-    while(*token && isspace(*token))
-       token++;
+       self_destruct();
+    while (*token && isspace(*token))
+       token++;
     if (!*token)
        self_destruct();
     *var = xstrdup(token);
index 38e329a15b8ce0d345a43b02c6983af81937b15e..db7cf1f742da2a3e110a06b78562d4a5d33db696 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.523 2001/01/12 00:37:15 wessels Exp $
+ * $Id: client_side.cc,v 1.524 2001/02/07 18:56:52 hno Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -633,7 +633,7 @@ checkNegativeHit(StoreEntry * e)
     return 1;
 }
 
-void
+static void
 clientUpdateCounters(clientHttpRequest * http)
 {
     int svc_time = tvSubMsec(http->start, current_time);
@@ -2863,7 +2863,7 @@ clientProcessBody(ConnStateData * conn)
 
 /* A dummy handler that throws away a request-body */
 static char bodyAbortBuf[SQUID_TCP_SO_RCVBUF];
-void
+static void
 clientReadBodyAbortHandler(char *buf, size_t size, void *data)
 {
     ConnStateData *conn = (ConnStateData *) data;
index 10e81604cbd6828f6306122147584601bab652f6..649607df1aa583373a68e2ed9056a72ef8598aa8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: debug.cc,v 1.80 2001/01/12 00:37:16 wessels Exp $
+ * $Id: debug.cc,v 1.81 2001/02/07 18:56:52 hno Exp $
  *
  * DEBUG: section 0     Debug Routines
  * AUTHOR: Harvest Derived
@@ -38,7 +38,7 @@
 static char *debug_log_file = NULL;
 static int Ctx_Lock = 0;
 static const char *debugLogTime(time_t);
-static void ctx_print();
+static void ctx_print(void);
 
 #if STDC_HEADERS
 void
index de0c5da78fa268db751b15b965cda8db1368cf74..f78edf9d50c7d094c53516a355e29e397f522fb1 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_aufs.cc,v 1.28 2001/01/12 00:37:32 wessels Exp $
+ * $Id: store_dir_aufs.cc,v 1.29 2001/02/07 18:56:53 hno Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -118,6 +118,9 @@ static void storeAufsDirStats(SwapDir *, StoreEntry *);
 static void storeAufsDirInitBitmap(SwapDir *);
 static int storeAufsDirValidFileno(SwapDir *, sfileno, int);
 
+/* The MAIN externally visible function */
+STSETUP storeFsSetup_aufs;
 /*
  * These functions were ripped straight out of the heart of store_dir.c.
  * They assume that the given filenum is on a asyncufs partiton, which may or
@@ -125,7 +128,7 @@ static int storeAufsDirValidFileno(SwapDir *, sfileno, int);
  * XXX this evilness should be tidied up at a later date!
  */
 
-int
+static int
 storeAufsDirMapBitTest(SwapDir * SD, int fn)
 {
     sfileno filn = fn;
@@ -134,7 +137,7 @@ storeAufsDirMapBitTest(SwapDir * SD, int fn)
     return file_map_bit_test(aioinfo->map, filn);
 }
 
-void
+static void
 storeAufsDirMapBitSet(SwapDir * SD, int fn)
 {
     sfileno filn = fn;
@@ -1493,7 +1496,7 @@ storeAufsDirStats(SwapDir * SD, StoreEntry * sentry)
  *
  * This routine is called when the given swapdir needs reconfiguring 
  */
-void
+static void
 storeAufsDirReconfigure(SwapDir * sd, int index, char *path)
 {
     char *token;
@@ -1615,7 +1618,7 @@ storeAufsCleanupDoubleCheck(SwapDir * sd, StoreEntry * e)
  * storeAufsDirParse *
  * Called when a *new* fs is being setup.
  */
-void
+static void
 storeAufsDirParse(SwapDir * sd, int index, char *path)
 {
     char *token;
@@ -1688,7 +1691,7 @@ storeAufsDirParse(SwapDir * sd, int index, char *path)
 /*
  * Initial setup / end destruction
  */
-void
+static void
 storeAufsDirDone(void)
 {
     aioDone();
index ac08b6b6e57c76b36b2f05b17211548a9a844019..9306de2e250a617c6be72309147d6379c34659da 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_coss.cc,v 1.17 2001/01/12 00:37:32 wessels Exp $
+ * $Id: store_dir_coss.cc,v 1.18 2001/02/07 18:56:54 hno Exp $
  *
  * DEBUG: section 81    Store COSS Directory Routines
  * AUTHOR: Eric Stern
@@ -87,6 +87,9 @@ static STFSPARSE storeCossDirParse;
 static STFSRECONFIGURE storeCossDirReconfigure;
 static STDUMP storeCossDirDump;
 
+/* The "only" externally visible function */
+STSETUP storeFsSetup_coss;
+
 static char *
 storeCossDirSwapLogFile(SwapDir * sd, const char *ext)
 {
@@ -679,7 +682,7 @@ storeCossDirCheckObj(SwapDir * SD, const StoreEntry * e)
 
 /* ========== LOCAL FUNCTIONS ABOVE, GLOBAL FUNCTIONS BELOW ========== */
 
-void
+static void
 storeCossDirStats(SwapDir * SD, StoreEntry * sentry)
 {
     CossInfo *cs = (CossInfo *) SD->fsdata;
index 3abb27f54d88b78c6d72c4ab1063ac6b9ebeb90f..95ce34b8d0a1e2c381942a377dbb8406135c97bb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: diskd.cc,v 1.9 2001/01/12 00:37:33 wessels Exp $
+ * $Id: diskd.cc,v 1.10 2001/02/07 18:56:54 hno Exp $
  *
  * DEBUG: section --    External DISKD process implementation.
  * AUTHOR: Harvest Derived
@@ -248,7 +248,7 @@ msg_handle(diomsg * r, int rl, diomsg * s)
     }
 }
 
-int
+static int
 fsCmp(const void *a, const void *b)
 {
     const int *A = a;
@@ -256,7 +256,7 @@ fsCmp(const void *a, const void *b)
     return *A != *B;
 }
 
-unsigned int
+static unsigned int
 fsHash(const void *key, unsigned int n)
 {
     /* note, n must be a power of 2! */
index 1a93f51f81a8bb4004fd08aa05e35a12e4a78372..ef15255e1411273b715c29034e05a5479d5349e8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_diskd.cc,v 1.38 2001/01/23 17:27:21 wessels Exp $
+ * $Id: store_dir_diskd.cc,v 1.39 2001/02/07 18:56:54 hno Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -128,6 +128,8 @@ static int storeDiskdDirValidFileno(SwapDir *, sfileno, int);
 static void storeDiskdStats(StoreEntry * sentry);
 static void storeDiskdDirSync(SwapDir *);
 
+/* The only externally visible interface */
+STSETUP storeFsSetup_diskd;
 
 /*
  * These functions were ripped straight out of the heart of store_dir.c.
@@ -136,7 +138,7 @@ static void storeDiskdDirSync(SwapDir *);
  * XXX this evilness should be tidied up at a later date!
  */
 
-int
+static int
 storeDiskdDirMapBitTest(SwapDir * SD, int fn)
 {
     sfileno filn = fn;
@@ -145,7 +147,7 @@ storeDiskdDirMapBitTest(SwapDir * SD, int fn)
     return file_map_bit_test(diskdinfo->map, filn);
 }
 
-void
+static void
 storeDiskdDirMapBitSet(SwapDir * SD, int fn)
 {
     sfileno filn = fn;
@@ -1710,7 +1712,7 @@ storeDiskdDirStats(SwapDir * SD, StoreEntry * sentry)
  *
  * This routine is called when the given swapdir needs reconfiguring 
  */
-void
+static void
 storeDiskdDirReconfigure(SwapDir * sd, int index, char *path)
 {
     char *token;
@@ -1847,7 +1849,7 @@ storeDiskdCleanupDoubleCheck(SwapDir * sd, StoreEntry * e)
  *
  * Called when a *new* fs is being setup.
  */
-void
+static void
 storeDiskdDirParse(SwapDir * sd, int index, char *path)
 {
     char *token;
@@ -1929,7 +1931,7 @@ storeDiskdDirParse(SwapDir * sd, int index, char *path)
 /*
  * Initial setup / end destruction
  */
-void
+static void
 storeDiskdDirDone(void)
 {
     memPoolDestroy(diskd_state_pool);
index c2af806cdd7a3b409dae77183ed7442ca1e7bbd8..df7d21de8908de4654834c7b3ab76dad90961b1f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_ufs.cc,v 1.27 2001/01/12 00:37:34 wessels Exp $
+ * $Id: store_dir_ufs.cc,v 1.28 2001/02/07 18:56:55 hno Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -116,6 +116,8 @@ static void storeUfsDirStats(SwapDir *, StoreEntry *);
 static void storeUfsDirInitBitmap(SwapDir *);
 static int storeUfsDirValidFileno(SwapDir *, sfileno, int);
 
+STSETUP storeFsSetup_ufs;
+
 /*
  * These functions were ripped straight out of the heart of store_dir.c.
  * They assume that the given filenum is on a ufs partiton, which may or
@@ -123,7 +125,7 @@ static int storeUfsDirValidFileno(SwapDir *, sfileno, int);
  * XXX this evilness should be tidied up at a later date!
  */
 
-int
+static int
 storeUfsDirMapBitTest(SwapDir * SD, int fn)
 {
     sfileno filn = fn;
@@ -132,7 +134,7 @@ storeUfsDirMapBitTest(SwapDir * SD, int fn)
     return file_map_bit_test(ufsinfo->map, filn);
 }
 
-void
+static void
 storeUfsDirMapBitSet(SwapDir * SD, int fn)
 {
     sfileno filn = fn;
@@ -1486,7 +1488,7 @@ storeUfsDirStats(SwapDir * SD, StoreEntry * sentry)
  *
  * This routine is called when the given swapdir needs reconfiguring 
  */
-void
+static void
 storeUfsDirReconfigure(SwapDir * sd, int index, char *path)
 {
     char *token;
@@ -1610,7 +1612,7 @@ storeUfsCleanupDoubleCheck(SwapDir * sd, StoreEntry * e)
  *
  * Called when a *new* fs is being setup.
  */
-void
+static void
 storeUfsDirParse(SwapDir * sd, int index, char *path)
 {
     char *token;
@@ -1683,7 +1685,7 @@ storeUfsDirParse(SwapDir * sd, int index, char *path)
 /*
  * Initial setup / end destruction
  */
-void
+static void
 storeUfsDirDone(void)
 {
     memPoolDestroy(ufs_state_pool);
index 8d44da084f99d4051936312b1b151fc5b5c74986..aad9bbea76a9738ecce907f4b43e6a7dc54ecb7e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: peer_digest.cc,v 1.77 2001/01/12 00:37:20 wessels Exp $
+ * $Id: peer_digest.cc,v 1.78 2001/02/07 18:56:52 hno Exp $
  *
  * DEBUG: section 72    Peer Digest Routines
  * AUTHOR: Alex Rousskov
@@ -115,7 +115,7 @@ peerDigestCreate(peer * p)
 }
 
 /* call Clean and free/unlock everything */
-void
+static void
 peerDigestDestroy(PeerDigest * pd)
 {
     peer *p;
index 054791fea3a73398e278d6d2ffbb37e6b845482b..91687ce6d91535d80bbc7b43b957a7a1db3fbd95 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: peer_select.cc,v 1.112 2001/01/12 00:37:20 wessels Exp $
+ * $Id: peer_select.cc,v 1.113 2001/02/07 18:56:52 hno Exp $
  *
  * DEBUG: section 44    Peer Selection Algorithm
  * AUTHOR: Duane Wessels
@@ -109,7 +109,7 @@ peerSelectStateFree(ps_state * psstate)
     cbdataFree(psstate);
 }
 
-int
+static int
 peerSelectIcpPing(request_t * request, int direct, StoreEntry * entry)
 {
     int n;
index 828b9dfa2e4fa4ae68ba545ff76e557c236b9e30..ccc28a8d2457638c4f10ae3cb67d3307e87b67a8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: protos.h,v 1.396 2001/01/12 00:37:20 wessels Exp $
+ * $Id: protos.h,v 1.397 2001/02/07 18:56:52 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -178,7 +178,7 @@ extern int comm_select(int);
 #endif
 extern void commUpdateReadBits(int, PF *);
 extern void commUpdateWriteBits(int, PF *);
-extern void comm_quick_poll_required();
+extern void comm_quick_poll_required(void);
 
 extern void packerToStoreInit(Packer * p, StoreEntry * e);
 extern void packerToMemInit(Packer * p, MemBuf * mb);
@@ -743,13 +743,13 @@ extern int authenticateDirection(auth_user_request_t *);
 extern FREE authenticateFreeProxyAuthUser;
 extern void authenticateFreeProxyAuthUserACLResults(void *data);
 extern void authenticateProxyUserCacheCleanup(void *);
-extern void authenticateInitUserCache();
-extern int authenticateActiveSchemeCount();
-extern int authenticateSchemeCount();
+extern void authenticateInitUserCache(void);
+extern int authenticateActiveSchemeCount(void);
+extern int authenticateSchemeCount(void);
 extern void authenticateUserNameCacheAdd(auth_user_t * auth_user);
 extern int authenticateCheckAuthUserIP(struct in_addr request_src_addr, auth_user_request_t * auth_user);
 extern int authenticateUserAuthenticated(auth_user_request_t *);
-extern void authenticateUserCacheRestart();
+extern void authenticateUserCacheRestart(void);
 extern char *authenticateUserUsername(auth_user_t *);
 extern char *authenticateUserRequestUsername(auth_user_request_t *);
 extern int authenticateValidateUser(auth_user_request_t *);
@@ -1094,7 +1094,7 @@ extern int urlCheckRequest(const request_t *);
 extern int urlDefaultPort(protocol_t p);
 extern char *urlCanonicalClean(const request_t *);
 extern char *urlHostname(const char *url);
-extern void urlExtMethodConfigure();
+extern void urlExtMethodConfigure(void);
 
 extern void useragentOpenLog(void);
 extern void useragentRotateLog(void);
@@ -1126,7 +1126,7 @@ extern void dlinkAdd(void *data, dlink_node *, dlink_list *);
 extern void dlinkAddTail(void *data, dlink_node *, dlink_list *);
 extern void dlinkDelete(dlink_node * m, dlink_list * list);
 extern void dlinkNodeDelete(dlink_node * m);
-extern dlink_node *dlinkNodeNew();
+extern dlink_node *dlinkNodeNew(void);
 
 extern void kb_incr(kb_t *, size_t);
 extern double gb_to_double(const gb_t *);
@@ -1286,3 +1286,8 @@ extern int gethostname(char *, int);
 #if URL_CHECKSUM_DEBUG
 extern unsigned int url_checksum(const char *url);
 #endif
+
+/*
+ * hack to allow snmp access to the statistics counters
+ */
+extern StatCounters *snmpStatGet(int);
index 8710dbb0fe71cf94597659624f6120e24afc6ee2..7f5aa7494fa7d6be4e171beedc1c39fe6dd5127e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_heap_replacement.cc,v 1.5 2001/01/12 00:37:35 wessels Exp $
+ * $Id: store_heap_replacement.cc,v 1.6 2001/02/07 18:56:56 hno Exp $
  *
  * DEBUG: section 20    Storage Manager Heap-based replacement
  * AUTHOR: John Dilley
@@ -43,6 +43,7 @@
 
 #include "squid.h"
 #include "heap.h"
+#include "store_heap_replacement.h"
 
 /*
  * Key generation function to implement the LFU-DA policy (Least
index f6f908a1eb0ecd5ed8163015181651c09af0beef..fb3413531dac4ccbf3b1e6b31cdeff8f66868703 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_repl_heap.cc,v 1.4 2001/01/12 00:37:35 wessels Exp $
+ * $Id: store_repl_heap.cc,v 1.5 2001/02/07 18:56:56 hno Exp $
  *
  * DEBUG: section ?     HEAP based removal policies
  * AUTHOR: Henrik Nordstrom
@@ -119,7 +119,7 @@ struct _HeapWalkData {
     int current;
 };
 
-const StoreEntry *
+static const StoreEntry *
 heap_walkNext(RemovalPolicyWalker * walker)
 {
     HeapWalkData *heap_walk = walker->_data;
index badf5bd1c619522059f5097c19132ef7042d385c..9b963cb9cc1c3172e09afdf50fb9f1833356095a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_repl_lru.cc,v 1.6 2001/01/12 00:37:36 wessels Exp $
+ * $Id: store_repl_lru.cc,v 1.7 2001/02/07 18:56:56 hno Exp $
  *
  * DEBUG: section ?     LRU Removal policy
  * AUTHOR: Henrik Nordstrom
@@ -132,7 +132,7 @@ struct _LruWalkData {
     LruNode *current;
 };
 
-const StoreEntry *
+static const StoreEntry *
 lru_walkNext(RemovalPolicyWalker * walker)
 {
     LruWalkData *lru_walk = walker->_data;
index 1659bec5962a2a6f98fca461e4bd2cc1cd940ce1..a563f36e04adc19093f67e9142db846fc251da78 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: snmp_agent.cc,v 1.79 2001/01/24 22:38:25 wessels Exp $
+ * $Id: snmp_agent.cc,v 1.80 2001/02/07 18:56:52 hno Exp $
  *
  * DEBUG: section 49     SNMP Interface
  * AUTHOR: Kostas Anagnostakis
@@ -37,8 +37,6 @@
 #include "squid.h"
 #include "cache_snmp.h"
 
-extern StatCounters *snmpStatGet(int);
-
 /************************************************************************
 
  SQUID MIB Implementation
@@ -257,7 +255,7 @@ snmp_prfSysFn(variable_list * Var, snint * ErrP)
        break;
     case PERF_SYS_MEMUSAGE:
        Answer = snmp_var_new_integer(Var->name, Var->name_length,
-           (snint) memTotalAllocated() >> 10,
+           (snint) statMemoryAccounted() >> 10,
            ASN_INTEGER);
        break;
     case PERF_SYS_CPUTIME:
index 4b71dc82781dfa91770407fcd70b9a26d1f639bf..ab0072a4b71f964fba8a17b23ec785b24eaa8da8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.343 2001/01/12 00:37:21 wessels Exp $
+ * $Id: stat.cc,v 1.344 2001/02/07 18:56:52 hno Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -592,7 +592,7 @@ info_get(StoreEntry * sentry)
 #endif /* HAVE_MALLINFO */
     storeAppendPrintf(sentry, "Memory accounted for:\n");
     storeAppendPrintf(sentry, "\tTotal accounted:       %6d KB\n",
-       memTotalAllocated() >> 10);
+       statMemoryAccounted() >> 10);
     storeAppendPrintf(sentry, "\tmemPoolAlloc calls: %d\n",
        mem_pool_alloc_calls);
     storeAppendPrintf(sentry, "\tmemPoolFree calls: %d\n",
@@ -1299,12 +1299,15 @@ statMedianSvc(int interval, int which)
 /*
  * SNMP wants ints, ick
  */
+#if UNUSED_CODE
 int
 get_median_svc(int interval, int which)
 {
     return (int) statMedianSvc(interval, which);
 }
 
+#endif
+
 StatCounters *
 snmpStatGet(int minutes)
 {
@@ -1516,4 +1519,10 @@ statGraphDump(StoreEntry * e)
     GENGRAPH(cputime, "cputime", "CPU utilisation");
 }
 
+int
+statMemoryAccounted(void)
+{
+    memTotalAllocated();
+}
+
 #endif /* STAT_GRAPHS */
index ae4fca5eebde39aba3b16b1fe014fea4b25b61d7..33432bf1be8b0ad1af15f4b248a134d859812ee2 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: typedefs.h,v 1.121 2001/01/31 22:16:39 hno Exp $
+ * $Id: typedefs.h,v 1.122 2001/02/07 18:56:52 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -290,10 +290,10 @@ typedef double hbase_f(double);
 typedef void StatHistBinDumper(StoreEntry *, int idx, double val, double size, int count);
 
 /* authenticate.c authenticate scheme routines typedefs */
-typedef int AUTHSACTIVE();
+typedef int AUTHSACTIVE(void);
 typedef int AUTHSAUTHED(auth_user_request_t *);
 typedef void AUTHSAUTHUSER(auth_user_request_t *, request_t *, ConnStateData *, http_hdr_type);
-typedef int AUTHSCONFIGURED();
+typedef int AUTHSCONFIGURED(void);
 typedef void AUTHSDECODE(auth_user_request_t *, const char *);
 typedef int AUTHSDIRECTION(auth_user_request_t *);
 typedef void AUTHSDUMP(StoreEntry *, const char *, authScheme *);