]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/Store.h
SourceFormat: enforcement
[thirdparty/squid.git] / src / Store.h
index ced3cdf17598dce37610b044488fb9fe7a0c7cbf..854b4fd896bad3e9da0526a80e44669376732270 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: Store.h,v 1.44 2008/02/26 21:49:34 amosjeffries Exp $
+ * $Id$
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  *  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 "squid.h"
-
-/// \todo protect the 'ostream' file includes via configure file tests as per squid conventions.
-#include <ostream>
-
 #include "StoreIOBuffer.h"
 #include "Range.h"
 #include "RefCount.h"
 #include "RemovalPolicy.h"
 
 #if USE_SQUID_ESI
-#include "ESIElement.h"
+#include "esi/Element.h"
 #endif
 
+#if HAVE_OSTREAM
+#include <ostream>
+#endif
+
+
 class AsyncCall;
 class StoreClient;
 class MemObject;
 class Store;
 class StoreSearch;
 
-typedef unsigned int ping_status_t;
-
 /**
  \ingroup StoreAPI
  */
@@ -74,7 +73,7 @@ public:
     virtual const char *getMD5Text() const;
     StoreEntry();
     StoreEntry(const char *url, const char *log_url);
-    virtual ~StoreEntry(){}
+    virtual ~StoreEntry() {}
 
     virtual HttpReply const *getReply() const;
     virtual void write (StoreIOBuffer);
@@ -143,6 +142,7 @@ public:
     sfileno swap_filen:25;
 
     sdirno swap_dirn:7;
+
     u_short lock_count;                /* Assume < 65536! */
 
     mem_status_t mem_status:3;
@@ -159,8 +159,7 @@ public:
     static void getPublicByRequest(StoreClient * aClient, HttpRequest * request);
     static void getPublic(StoreClient * aClient, const char *uri, const HttpRequestMethod& method);
 
-    virtual bool isNull()
-    {
+    virtual bool isNull() {
         return false;
     };
 
@@ -198,24 +197,23 @@ class NullStoreEntry:public StoreEntry
 
 public:
     static NullStoreEntry *getInstance();
-    bool isNull()
-    {
+    bool isNull() {
         return true;
     }
 
     const char *getMD5Text() const;
     _SQUID_INLINE_ HttpReply const *getReply() const;
-    void write (StoreIOBuffer){}
+    void write (StoreIOBuffer) {}
 
     bool isEmpty () const {return true;}
 
-    virtual size_t bytesWanted(Range<size_t> const aRange) const { assert (aRange.size());return aRange.end - 1;}
+    virtual size_t bytesWanted(Range<size_t> const aRange) const { assert (aRange.size()); return aRange.end - 1;}
 
     void operator delete(void *address);
-    void complete(){}
+    void complete() {}
 
 private:
-    store_client_t storeClientType() const{return STORE_MEM_CLIENT;}
+    store_client_t storeClientType() const {return STORE_MEM_CLIENT;}
 
     char const *getSerialisedMetaData();
     bool swapoutPossible() {return false;}
@@ -260,12 +258,10 @@ public:
     virtual void diskFull();
 
     /** Retrieve a store entry from the store */
-    virtual StoreEntry * get
-        (const cache_key *) = 0;
+    virtual StoreEntry * get(const cache_key *) = 0;
 
     /** \todo imeplement the async version */
-    virtual void get
-        (String const key , STOREGETCLIENT callback, void *cbdata) = 0;
+    virtual void get(String const key , STOREGETCLIENT callback, void *cbdata) = 0;
 
     /* prepare the store for use. The store need not be usable immediately,
      * it should respond to readable() and writable() with true as soon
@@ -338,9 +334,6 @@ SQUIDCEXTERN StoreEntry *storeCreateEntry(const char *, const char *, request_fl
 /// \ingroup StoreAPI
 SQUIDCEXTERN void storeInit(void);
 
-/// \ingroup StoreAPI
-extern void storeRegisterWithCacheManager(CacheManager & manager);
-
 /// \ingroup StoreAPI
 SQUIDCEXTERN void storeConfigure(void);
 
@@ -350,13 +343,8 @@ SQUIDCEXTERN void storeFreeMemory(void);
 /// \ingroup StoreAPI
 SQUIDCEXTERN int expiresMoreThan(time_t, time_t);
 
-#if STDC_HEADERS
 /// \ingroup StoreAPI
 SQUIDCEXTERN void storeAppendPrintf(StoreEntry *, const char *,...) PRINTF_FORMAT_ARG2;
-#else
-/// \ingroup StoreAPI
-SQUIDCEXTERN void storeAppendPrintf();
-#endif
 
 /// \ingroup StoreAPI
 SQUIDCEXTERN void storeAppendVPrintf(StoreEntry *, const char *, va_list ap);
@@ -389,6 +377,9 @@ extern FREE destroyStoreEntry;
  */
 SQUIDCEXTERN void packerToStoreInit(Packer * p, StoreEntry * e);
 
+/// \ingroup StoreAPI
+SQUIDCEXTERN void storeGetMemSpace(int size);
+
 #ifdef _USE_INLINE_
 #include "Store.cci"
 #endif