]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/acl/Gadgets.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / acl / Gadgets.h
index aadee845715a27b6966bd01c4b439d366178cf0f..6d1d1dc05dd90521dee25cf92d129e2f86b594c2 100644 (file)
@@ -1,42 +1,66 @@
+/*
+ * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
 #ifndef SQUID_ACL_GADGETS_H
 #define SQUID_ACL_GADGETS_H
 
+#include "acl/forward.h"
 #include "err_type.h"
 
-struct dlink_list;
-class acl_access;
-class ACL;
-class AclDenyInfoList;
-class ACLList;
+#include <sstream>
+
 class ConfigParser;
+class dlink_list;
 class StoreEntry;
 class wordlist;
 
+/// Register an ACL object for future deletion. Repeated registrations are OK.
 /// \ingroup ACLAPI
-extern void aclDestroyAccessList(acl_access **list);
+void aclRegister(ACL *acl);
 /// \ingroup ACLAPI
-extern void aclDestroyAcls(ACL **);
+void aclDestroyAccessList(acl_access **list);
 /// \ingroup ACLAPI
-extern void aclDestroyAclList(ACLList **);
+void aclDestroyAcls(ACL **);
 /// \ingroup ACLAPI
-extern void aclParseAccessLine(ConfigParser &parser, acl_access **);
+void aclDestroyAclList(ACLList **);
+/// Parses a single line of a "action followed by acls" directive (e.g., http_access).
 /// \ingroup ACLAPI
-extern void aclParseAclList(ConfigParser &parser, ACLList **);
+void aclParseAccessLine(const char *directive, ConfigParser &parser, Acl::Tree **);
+/// Parses a single line of a "some context followed by acls" directive (e.g., note n v).
+/// The label parameter identifies the context (for debugging).
 /// \ingroup ACLAPI
-extern int aclIsProxyAuth(const char *name);
+void aclParseAclList(ConfigParser &parser, Acl::Tree **, const char *label);
+/// Template to convert various context lables to strings. \ingroup ACLAPI
+template <class Any>
+inline
+void aclParseAclList(ConfigParser &parser, Acl::Tree **tree, const Any any)
+{
+    std::ostringstream buf;
+    buf << any;
+    aclParseAclList(parser, tree, buf.str().c_str());
+}
+
 /// \ingroup ACLAPI
-extern err_type aclGetDenyInfoPage(AclDenyInfoList ** head, const char *name, int redirect_allowed);
+int aclIsProxyAuth(const char *name);
 /// \ingroup ACLAPI
-extern void aclParseDenyInfoLine(AclDenyInfoList **);
+err_type aclGetDenyInfoPage(AclDenyInfoList ** head, const char *name, int redirect_allowed);
 /// \ingroup ACLAPI
-extern void aclDestroyDenyInfoList(AclDenyInfoList **);
+void aclParseDenyInfoLine(AclDenyInfoList **);
 /// \ingroup ACLAPI
-extern wordlist *aclDumpGeneric(const ACL *);
+void aclDestroyDenyInfoList(AclDenyInfoList **);
 /// \ingroup ACLAPI
-extern void aclCacheMatchFlush(dlink_list * cache);
+wordlist *aclDumpGeneric(const ACL *);
 /// \ingroup ACLAPI
-extern void dump_acl_access(StoreEntry * entry, const char *name, acl_access * head);
+void aclCacheMatchFlush(dlink_list * cache);
 /// \ingroup ACLAPI
-extern void dump_acl_list(StoreEntry * entry, ACLList * head);
+void dump_acl_access(StoreEntry * entry, const char *name, acl_access * head);
+/// \ingroup ACLAPI
+void dump_acl_list(StoreEntry * entry, ACLList * head);
 
 #endif /* SQUID_ACL_GADGETS_H */
+