4 // Various routines that deal with parsing the configuration file.
10 struct MarkPoolConfig {
15 std::string url; // As seen by the client.
16 std::string src; // Can be empty.
18 int mark_pool; // -1 for none.
19 enum { STREAM_ENCODING_RAW = 0, STREAM_ENCODING_METACUBE } encoding;
22 struct AcceptorConfig {
27 enum { LOG_TYPE_FILE, LOG_TYPE_CONSOLE, LOG_TYPE_SYSLOG } type;
34 std::vector<MarkPoolConfig> mark_pools;
35 std::vector<StreamConfig> streams;
36 std::vector<AcceptorConfig> acceptors;
37 std::vector<LogConfig> log_destinations;
39 std::string stats_file; // Empty means no stats file.
42 std::string access_log_file; // Empty means no accses_log file.
45 // Parse and validate configuration. Returns false on error.
46 // <config> is taken to be empty (uninitialized) on entry.
47 bool parse_config(const std::string &filename, Config *config);
49 #endif // !defined(_CONFIG_H)