/*
- * $Id: ICAPConfig.cc,v 1.9 2006/04/27 19:27:37 wessels Exp $
+ * $Id: ICAPConfig.cc,v 1.10 2006/04/28 05:05:47 wessels Exp $
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
* ----------------------------------------------------------
#include "ACLChecklist.h"
#include "wordlist.h"
-extern ConfigParser LegacyParser; // from cache_cf.cc
ICAPConfig TheICAPConfig;
-extern ConfigParser LegacyParser; // found in cache_cf.cc
ICAPServiceRep::Pointer
ICAPConfig::findService(const String& key)
};
void
-ICAPConfig::parseICAPAccess()
+ICAPConfig::parseICAPAccess(ConfigParser &parser)
{
String aKey;
ConfigParser::ParseString(&aKey);
fatalf("Did not find ICAP class '%s' referenced on line %d\n",
aKey.buf(), config_lineno);
- aclParseAccessLine(LegacyParser, &theClass->accessList);
+ aclParseAccessLine(parser, &theClass->accessList);
};
void
/*
- * $Id: ICAPConfig.h,v 1.7 2005/12/22 23:52:28 wessels Exp $
+ * $Id: ICAPConfig.h,v 1.8 2006/04/28 05:05:47 wessels Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
class acl_access;
+class ConfigParser;
+
class ICAPConfig;
class ICAPClass
void freeICAPClass(void);
void dumpICAPClass(StoreEntry *, const char *);
- void parseICAPAccess(void);
+ void parseICAPAccess(ConfigParser &parser);
void freeICAPAccess(void);
void dumpICAPAccess(StoreEntry *, const char *);
/*
- * $Id: cache_cf.cc,v 1.493 2006/04/27 20:36:29 hno Exp $
+ * $Id: cache_cf.cc,v 1.494 2006/04/28 05:05:43 wessels Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
#endif /* USE_SSL */
static void parse_b_size_t(size_t * var);
-/* a parser for legacy code that uses the global approach */
-ConfigParser LegacyParser = ConfigParser();
+/*
+ * LegacyParser is a parser for legacy code that uses the global
+ * approach. This is static so that it is only exposed to cache_cf.
+ * Other modules needing access to a ConfigParser should have it
+ * provided to them in their parserFOO methods.
+ */
+static ConfigParser LegacyParser = ConfigParser();
void
self_destruct(void)
static void
parse_icap_access_type(ICAPConfig * cfg)
{
- cfg->parseICAPAccess();
+ cfg->parseICAPAccess(LegacyParser);
}
static void