/*
- * $Id: cache_cf.cc,v 1.485 2005/11/04 20:27:31 wessels Exp $
+ * $Id: cache_cf.cc,v 1.486 2005/11/21 23:10:22 wessels Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
#include "ESIParser.h"
#endif
+#if ICAP_CLIENT
+#include "ICAP/ICAPConfig.h"
+extern ICAPConfig TheICAPConfig; // for cf_parser.h
+
+static void parse_icap_service_type(ICAPConfig *);
+static void dump_icap_service_type(StoreEntry *, const char *, ICAPConfig );
+static void free_icap_service_type(ICAPConfig *);
+static void parse_icap_class_type(ICAPConfig *);
+static void dump_icap_class_type(StoreEntry *, const char *, ICAPConfig );
+static void free_icap_class_type(ICAPConfig *);
+static void parse_icap_access_type(ICAPConfig *);
+static void dump_icap_access_type(StoreEntry *, const char *, ICAPConfig );
+static void free_icap_access_type(ICAPConfig *);
+
+#endif
+
CBDATA_TYPE(peer);
static const char *const T_SECOND_STR = "second";
static void free_logformat(logformat ** definitions);
static void free_access_log(customlog ** definitions);
-
-
-
static void update_maxobjsize(void);
static void configDoConfigure(void);
static void parse_refreshpattern(refresh_t **);
#endif
-
static void
dump_cachedir(StoreEntry * entry, const char *name, _SquidConfig::_cacheSwap swap)
{
}
}
-
static int
check_null_cachedir(_SquidConfig::_cacheSwap swap)
{
if ((path_str = strtok(NULL, w_space)) == NULL)
self_destruct();
-
fs = find_fstype(type_str);
if (fs < 0)
*var = xstrdup(token);
}
+void
+ConfigParser::ParseString(char **var)
+{
+ parse_string(var);
+}
+
+void
+ConfigParser::ParseString(String *var)
+{
+ char *token = strtok(NULL, w_space);
+
+ if (token == NULL)
+ self_destruct();
+
+ var->reset(token);
+}
+
static void
free_string(char **var)
{
*var = (u_short) i;
}
+void
+ConfigParser::ParseBool(bool *var)
+{
+ int i = GetInteger();
+
+ if (0 == i)
+ *var = false;
+ else if (1 == i)
+ *var = true;
+ else
+ self_destruct();
+}
+
static void
dump_wordlist(StoreEntry * entry, const char *name, wordlist * list)
{
}
}
+void
+ConfigParser::ParseWordList(wordlist ** list)
+{
+ parse_wordlist(list);
+}
+
void
parse_wordlist(wordlist ** list)
{
self_destruct();
}
-
static void
dump_uri_whitespace(StoreEntry * entry, const char *name, int var)
{
storeAppendPrintf(entry, "\n");
}
-
#include "cf_parser.h"
peer_t
free_generic_http_port_data((http_port_list *)data);
}
-
static http_port_list *
create_http_port(char *portspec)
{
xfree(log);
}
}
+
+#if ICAP_CLIENT
+
+static void
+parse_icap_service_type(ICAPConfig * cfg)
+{
+ cfg->parseICAPService();
+}
+
+static void
+free_icap_service_type(ICAPConfig * cfg)
+{
+ cfg->freeICAPService();
+}
+
+static void
+dump_icap_service_type(StoreEntry * entry, const char *name, ICAPConfig cfg)
+{
+ cfg.dumpICAPService(entry, name);
+}
+
+static void
+parse_icap_class_type(ICAPConfig * cfg)
+{
+ cfg->parseICAPClass();
+}
+
+static void
+free_icap_class_type(ICAPConfig * cfg)
+{
+ cfg->freeICAPClass();
+}
+
+static void
+dump_icap_class_type(StoreEntry * entry, const char *name, ICAPConfig cfg)
+{
+ cfg.dumpICAPClass(entry, name);
+}
+
+static void
+parse_icap_access_type(ICAPConfig * cfg)
+{
+ cfg->parseICAPAccess();
+}
+
+static void
+free_icap_access_type(ICAPConfig * cfg)
+{
+ cfg->freeICAPAccess();
+}
+
+static void
+dump_icap_access_type(StoreEntry * entry, const char *name, ICAPConfig cfg)
+{
+ cfg.dumpICAPAccess(entry, name);
+}
+
+#endif