]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Renamed acl_name_list to AclNameList and moved ot own header file in acl/
authorFrancesco Chemolli <kinkie@squid-cache.org>
Wed, 5 Sep 2012 13:45:53 +0000 (15:45 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Wed, 5 Sep 2012 13:45:53 +0000 (15:45 +0200)
src/acl/AclNameList.h [new file with mode: 0644]
src/acl/Gadgets.cc
src/acl/Makefile.am
src/cache_cf.cc
src/mem.cc
src/structs.h

diff --git a/src/acl/AclNameList.h b/src/acl/AclNameList.h
new file mode 100644 (file)
index 0000000..c60120d
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef SQUID_ACL_ACLNAMELIST_H_
+#define SQUID_ACL_ACLNAMELIST_H_
+/*
+ * SQUID Web Proxy Cache          http://www.squid-cache.org/
+ * ----------------------------------------------------------
+ *
+ *  Squid is the result of efforts by numerous individuals from
+ *  the Internet community; see the CONTRIBUTORS file for full
+ *  details.   Many organizations have provided support for Squid's
+ *  development; see the SPONSORS file for full details.  Squid is
+ *  Copyrighted (C) 2001 by the Regents of the University of
+ *  California; see the COPYRIGHT file for full details.  Squid
+ *  incorporates software developed and/or copyrighted by other
+ *  sources; see the CREDITS file for full details.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ *
+ */
+
+#include "defines.h"
+//TODO: convert to a std::list<string>
+class AclNameList {
+public:
+    char name[ACL_NAME_SZ];
+    AclNameList *next;
+};
+
+#endif /* SQUID_ACLNAMELIST_H_ */
index d65f6e8abda943738abf8b822dca1753bfc38aed..b06363ca8427be99e4cdce5a9f750e1ad232e657 100644 (file)
@@ -38,6 +38,7 @@
 
 #include "squid.h"
 #include "acl/Acl.h"
+#include "acl/AclNameList.h"
 #include "acl/Checklist.h"
 #include "acl/Strategised.h"
 #include "acl/Gadgets.h"
@@ -56,7 +57,7 @@ aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name, int redirect_al
     debugs(28, 8, HERE << "got called for " << name);
 
     for (A = *head; A; A = A->next) {
-        acl_name_list *L = NULL;
+        AclNameList *L = NULL;
 
         if (!redirect_allowed && strchr(A->err_page_name, ':') ) {
             debugs(28, 8, HERE << "Skip '" << A->err_page_name << "' 30x redirects not allowed as response here.");
@@ -112,8 +113,8 @@ aclParseDenyInfoLine(acl_deny_info_list ** head)
     acl_deny_info_list *A = NULL;
     acl_deny_info_list *B = NULL;
     acl_deny_info_list **T = NULL;
-    acl_name_list *L = NULL;
-    acl_name_list **Tail = NULL;
+    AclNameList *L = NULL;
+    AclNameList **Tail = NULL;
 
     /* first expect a page name */
 
@@ -131,7 +132,7 @@ aclParseDenyInfoLine(acl_deny_info_list ** head)
     Tail = &A->acl_list;
 
     while ((t = strtok(NULL, w_space))) {
-        L = (acl_name_list *)memAllocate(MEM_ACL_NAME_LIST);
+        L = (AclNameList *)memAllocate(MEM_ACL_NAME_LIST);
         xstrncpy(L->name, t, ACL_NAME_SZ);
         *Tail = L;
         Tail = &L->next;
@@ -287,8 +288,8 @@ aclDestroyDenyInfoList(acl_deny_info_list ** list)
 {
     acl_deny_info_list *a = NULL;
     acl_deny_info_list *a_next = NULL;
-    acl_name_list *l = NULL;
-    acl_name_list *l_next = NULL;
+    AclNameList *l = NULL;
+    AclNameList *l_next = NULL;
 
     debugs(28, 8, "aclDestroyDenyInfoList: invoked");
 
index 112230036b8d726bd0b7c9444bce10b26c04ef05..580eed0b7ca120f48dc7467d9c044d3498cf9999 100644 (file)
@@ -105,6 +105,7 @@ libacls_la_SOURCES = \
        UserData.cc \
        UserData.h \
        \
+       AclNameList.h \
        Gadgets.cc \
        Gadgets.h
 
index 60fd38f8490dd318f00963362f3ba68722d6fe8b..9078686fe11155876af05b2723a1a6102e1d8b0a 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "squid.h"
 #include "acl/Acl.h"
+#include "acl/AclNameList.h"
 #include "acl/Gadgets.h"
 #include "acl/MethodData.h"
 #include "anyp/PortCfg.h"
@@ -2437,7 +2438,7 @@ free_cachemgrpasswd(cachemgr_passwd ** head)
 static void
 dump_denyinfo(StoreEntry * entry, const char *name, acl_deny_info_list * var)
 {
-    acl_name_list *a;
+    AclNameList *a;
 
     while (var != NULL) {
         storeAppendPrintf(entry, "%s %s", name, var->err_page_name);
@@ -2462,8 +2463,8 @@ free_denyinfo(acl_deny_info_list ** list)
 {
     acl_deny_info_list *a = NULL;
     acl_deny_info_list *a_next = NULL;
-    acl_name_list *l = NULL;
-    acl_name_list *l_next = NULL;
+    AclNameList *l = NULL;
+    AclNameList *l_next = NULL;
 
     for (a = *list; a; a = a_next) {
         for (l = a->acl_list; l; l = l_next) {
index 6cd3cad16bc7f7aee2d370358dc087e301c50f9d..dec2049092f84c8c0af98d415a9245933d111da2 100644 (file)
  */
 
 #include "squid.h"
-#include "event.h"
+#include "acl/AclNameList.h"
 #include "ClientInfo.h"
-#include "Mem.h"
+#include "event.h"
 #include "md5.h"
+#include "Mem.h"
 #include "MemBuf.h"
 #include "memMeter.h"
 #include "mgr/Registration.h"
@@ -451,7 +452,7 @@ Mem::Init(void)
     memDataInit(MEM_64K_BUF, "64K Buffer", 65536, 10, false);
     memDataInit(MEM_ACL_DENY_INFO_LIST, "acl_deny_info_list",
                 sizeof(acl_deny_info_list), 0);
-    memDataInit(MEM_ACL_NAME_LIST, "acl_name_list", sizeof(acl_name_list), 0);
+    memDataInit(MEM_ACL_NAME_LIST, "acl_name_list", sizeof(AclNameList), 0);
 #if USE_CACHE_DIGESTS
 
     memDataInit(MEM_CACHE_DIGEST, "CacheDigest", sizeof(CacheDigest), 0);
index 375ac0791f8cda829efc12dee2f265262eacae4c..3b4b1dd103fd4471621ce09450c62c11249fbf32 100644 (file)
 #ifndef SQUID_STRUCTS_H
 #define SQUID_STRUCTS_H
 
-#include "RefCount.h"
+#include "acl/AclNameList.h"
 #include "cbdata.h"
 #include "defines.h"
 #include "dlink.h"
 #include "err_type.h"
 #include "hash.h"
 #include "ip/Address.h"
+#include "RefCount.h"
 
 /* needed for the global config */
 #include "HttpHeader.h"
 
 #define PEER_MULTICAST_SIBLINGS 1
 
-struct acl_name_list {
-    char name[ACL_NAME_SZ];
-    acl_name_list *next;
-};
-
 struct acl_deny_info_list {
     err_type err_page_id;
     char *err_page_name;
-    acl_name_list *acl_list;
+    AclNameList *acl_list;
     acl_deny_info_list *next;
 };