]> git.ipfire.org Git - thirdparty/squid.git/blob - tools/purge/conffile.hh
Cleanup: un-wrap C++ header includes
[thirdparty/squid.git] / tools / purge / conffile.hh
1 // Author: Jens-S. V?ckler <voeckler@rvs.uni-hannover.de>
2 //
3 // File: conffile.hh
4 // Fri Sep 15 2000
5 //
6 // (c) 2000 Lehrgebiet Rechnernetze und Verteilte Systeme
7 // Universit?t Hannover, Germany
8 //
9 // Permission to use, copy, modify, distribute, and sell this software
10 // and its documentation for any purpose is hereby granted without fee,
11 // provided that (i) the above copyright notices and this permission
12 // notice appear in all copies of the software and related documentation,
13 // and (ii) the names of the Lehrgebiet Rechnernetze und Verteilte
14 // Systeme and the University of Hannover may not be used in any
15 // advertising or publicity relating to the software without the
16 // specific, prior written permission of Lehrgebiet Rechnernetze und
17 // Verteilte Systeme and the University of Hannover.
18 //
19 // THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
20 // EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
21 // WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
22 //
23 // IN NO EVENT SHALL THE LEHRGEBIET RECHNERNETZE UND VERTEILTE SYSTEME OR
24 // THE UNIVERSITY OF HANNOVER BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
25 // INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
26 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT
27 // ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY,
28 // ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
29 // SOFTWARE.
30 //
31 // Revision 1.2 2000/09/21 10:17:17 cached
32 // namespace std:: needed for Sun WS compiler.
33 //
34 // Revision 1.1 2000/09/21 09:45:14 voeckler
35 // Initial revision
36 //
37 //
38 #ifndef _CONFFILE_HH
39 #define _CONFFILE_HH
40
41 #if !defined(__cplusplus)
42 #ifndef HAVE_BOOL
43 #define HAVE_BOOL
44 typedef int bool;
45 #define false 0
46 #define true 1
47 #endif
48 #endif /* __cplusplus */
49
50
51 #if !defined(DEFAULT_SQUID_CONF)
52 #define DEFAULT_SQUID_CONF "/usr/local/squid/etc/squid.conf"
53 #endif
54
55 #include <vector>
56
57 struct CacheDir {
58 enum CacheDirType { CDT_NONE, CDT_UFS, CDT_AUFS, CDT_DISKD, CDT_OTHER };
59
60 const char* base;
61 CacheDirType type;
62 size_t size;
63 unsigned level[2];
64 };
65
66 typedef std::vector<CacheDir> CacheDirVector;
67
68 int
69 readConfigFile( CacheDirVector& cachedir,
70 const char* fn = DEFAULT_SQUID_CONF,
71 FILE* debug = 0 );
72 // purpose: read squid.conf file and extract cache_dir entries
73 // paramtr: cachedir (OUT): vector with an entry for each cache_dir found
74 // fn (IN): file name of squid.conf to use
75 // debug (IO): if not null, place debug information there
76 // returns: number of entries, or negative to warn of errors
77
78 #endif // _CONFFILE_HH