]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Review: shuffle enums from enums.h to specific headers.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Tue, 4 Aug 2015 14:32:37 +0000 (16:32 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Tue, 4 Aug 2015 14:32:37 +0000 (16:32 +0200)
src/HttpHdrCc.h
src/HttpHdrSc.cc
src/HttpHdrSc.h
src/HttpHdrScTarget.cc
src/HttpHdrScTarget.h
src/HttpHeaderStat.h
src/enums.h

index 00399e8b14e105ad6ac946edf7b9f29bfc468e7c..0a8dd4c20a683d1514365475ffc616e48080e6d6 100644 (file)
@@ -9,12 +9,31 @@
 #ifndef SQUID_HTTPHDRCC_H
 #define SQUID_HTTPHDRCC_H
 
+#include "dlink.h"
 #include "enums.h"
 #include "mem/forward.h"
 #include "SquidString.h"
 
 class Packable;
 
+typedef enum {
+    CC_PUBLIC = 0,
+    CC_PRIVATE,
+    CC_NO_CACHE,
+    CC_NO_STORE,
+    CC_NO_TRANSFORM,
+    CC_MUST_REVALIDATE,
+    CC_PROXY_REVALIDATE,
+    CC_MAX_AGE,
+    CC_S_MAXAGE,
+    CC_MAX_STALE,
+    CC_MIN_FRESH,
+    CC_ONLY_IF_CACHED,
+    CC_STALE_IF_ERROR,
+    CC_OTHER,
+    CC_ENUM_END /* also used to mean "invalid" */
+} http_hdr_cc_type;
+
 /** Http Cache-Control header representation
  *
  * Store and parse the Cache-Control HTTP header.
index e0a136d623f9241f86505391ada8b0ef602bfe8a..cd58471ee7738ac3a00cdade6a314eec578953f1 100644 (file)
 
 #include "squid.h"
 #include "base/LookupTable.h"
+#include "dlink.h"
 #include "HttpHdrSc.h"
 #include "HttpHeader.h"
 #include "HttpHeaderFieldStat.h"
 #include "HttpHeaderStat.h"
 #include "HttpHeaderTools.h"
+#include "HttpHdrScTarget.h"
 #include "Store.h"
 #include "StrList.h"
 #include "util.h"
@@ -355,3 +357,12 @@ HttpHdrSc::getMergedTarget(const char *ourtarget)
     return NULL;
 }
 
+void
+HttpHdrSc::addTarget(HttpHdrScTarget *t) {
+    dlinkAdd(t, &t->node, &targets);
+}
+
+void
+HttpHdrSc::addTargetAtTail(HttpHdrScTarget *t) {
+    dlinkAddTail (t, &t->node, &targets);
+}
index c38255d3be14f8e9a499cd35090b8d8277ba5250..b310e55f094d3dd952dd58a9f9f0672ce79e2888 100644 (file)
@@ -9,12 +9,25 @@
 #ifndef SQUID_HTTPHDRSURROGATECONTROL_H
 #define SQUID_HTTPHDRSURROGATECONTROL_H
 
-#include "HttpHdrScTarget.h"
+#include "dlink.h"
+#include "mem/AllocatorProxy.h"
+#include "SquidString.h"
 
+class HttpHdrScTarget;
 class StatHist;
+class Packable;
+class StoreEntry;
+
+typedef enum {
+    SC_NO_STORE,
+    SC_NO_STORE_REMOTE,
+    SC_MAX_AGE,
+    SC_CONTENT,
+    SC_OTHER,
+    SC_ENUM_END /* also used to mean "invalid" */
+} http_hdr_sc_type;
 
 /* http surogate control header field */
-
 class HttpHdrSc
 {
     MEMPROXY_CLASS(HttpHdrSc);
@@ -29,12 +42,8 @@ public:
     void updateStats(StatHist *) const;
     HttpHdrScTarget * getMergedTarget (const char *ourtarget); //todo: make const?
     void setMaxAge(char const *target, int max_age);
-    void addTarget(HttpHdrScTarget *t) {
-        dlinkAdd(t, &t->node, &targets);
-    }
-    void addTargetAtTail(HttpHdrScTarget *t) {
-        dlinkAddTail (t, &t->node, &targets);
-    }
+    void addTarget(HttpHdrScTarget *t);
+    void addTargetAtTail(HttpHdrScTarget *t);
 
     dlink_list targets;
 private:
index 3552d9b036ab7644996fd166161ea765aae986ff..dc9c0cf7c229cb641a15eaef6d393aca6c886c8a 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "squid.h"
 #include "HttpHdrSc.h"
+#include "HttpHdrScTarget.h"
 #include "StatHist.h"
 
 http_hdr_sc_type &operator++ (http_hdr_sc_type &aHeader);
index f03f75dc27450b69c90fc5dd00510bc8ed56ad25..88a9c4488358604ac10d65d6e7f995a17dcee112 100644 (file)
@@ -11,6 +11,7 @@
 
 #include "defines.h"
 #include "dlink.h"
+#include "HttpHdrSc.h"
 #include "mem/forward.h"
 #include "SquidString.h"
 #include "typedefs.h"
index e3f8fb1525f54e4b9748b11fab842ddf32e852c4..4fc7a161933058dd01cc0f192cbe27c5e5eef72a 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef HTTPHEADERSTAT_H_
 #define HTTPHEADERSTAT_H_
 
+#include "HttpHdrCc.h"
+#include "HttpHdrSc.h"
 #include "StatHist.h"
 
 /// HTTP per header statistics
index 231ec58819d8af2031d4fb733fb385b087758e16..9d3eee06efc8bd9813dc454dedfbc36884b9ce05 100644 (file)
@@ -31,32 +31,6 @@ typedef enum {
     PEER_MULTICAST
 } peer_t;
 
-typedef enum {
-    CC_PUBLIC = 0,
-    CC_PRIVATE,
-    CC_NO_CACHE,
-    CC_NO_STORE,
-    CC_NO_TRANSFORM,
-    CC_MUST_REVALIDATE,
-    CC_PROXY_REVALIDATE,
-    CC_MAX_AGE,
-    CC_S_MAXAGE,
-    CC_MAX_STALE,
-    CC_MIN_FRESH,
-    CC_ONLY_IF_CACHED,
-    CC_STALE_IF_ERROR,
-    CC_OTHER,
-    CC_ENUM_END /* also used to mean "invalid" */
-} http_hdr_cc_type;
-
-typedef enum {
-    SC_NO_STORE,
-    SC_NO_STORE_REMOTE,
-    SC_MAX_AGE,
-    SC_CONTENT,
-    SC_OTHER,
-    SC_ENUM_END /* also used to mean "invalid" */
-} http_hdr_sc_type;
 
 typedef enum _mem_status_t {
     NOT_IN_MEMORY,