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