comparison src/context.h @ 76:81f1e400e8ab

start coding on new config syntax
author carl
date Sat, 16 Jul 2005 13:47:19 -0700
parents 1142e46be550
children c1280cd3e248
comparison
equal deleted inserted replaced
75:1142e46be550 76:81f1e400e8ab
56 56
57 public: 57 public:
58 CONTEXT(CONTEXTP parent_, char *name_); 58 CONTEXT(CONTEXTP parent_, char *name_);
59 ~CONTEXT(); 59 ~CONTEXT();
60 CONTEXTP get_parent() {return parent;}; 60 CONTEXTP get_parent() {return parent;};
61 bool is_parent(CONTEXTP p); // is p a parent of this?
61 char* get_full_name(char *buf, int size); 62 char* get_full_name(char *buf, int size);
62 void add_context(CONTEXTP child) {children[child->name] = child;}; 63 void add_context(CONTEXTP child) {children[child->name] = child;};
63 bool allow_env_to(char *to) {return (parent) ? parent->cover_env_to(to) : true;}; 64 bool allow_env_to(char *to) {return (parent) ? parent->cover_env_to(to) : true;};
64 bool cover_env_to(char *to); 65 bool cover_env_to(char *to);
65 66
86 87
87 void add_dnsbl(char *name, DNSBLP dns) {dnsbl_names[name] = dns;}; 88 void add_dnsbl(char *name, DNSBLP dns) {dnsbl_names[name] = dns;};
88 void add_dnsbl(DNSBLP dns) {dnsbl_list.push_back(dns);}; 89 void add_dnsbl(DNSBLP dns) {dnsbl_list.push_back(dns);};
89 DNSBLP find_dnsbl(char *name); 90 DNSBLP find_dnsbl(char *name);
90 91
92 bool get_content_filtering() {return content_filtering;};
91 int get_host_limit() {return host_limit;}; 93 int get_host_limit() {return host_limit;};
92 bool get_host_random() {return host_random;}; 94 bool get_host_random() {return host_random;};
93 char* get_content_suffix() {return content_suffix;}; 95 char* get_content_suffix();
94 char* get_content_message() {return content_message;}; 96 char* get_content_message();
95 string_set& get_content_host_ignore() {return content_host_ignore;}; 97 string_set& get_content_host_ignore();
96 string_set& get_content_tlds() {return content_tlds;}; 98 string_set& get_content_tlds();
97 string_set& get_html_tags() {return html_tags;}; 99 string_set& get_html_tags();
98 dnsblp_list& get_dnsbl_list() {return dnsbl_list;}; 100 dnsblp_list& get_dnsbl_list();
99 bool get_content_filtering() {return content_filtering;};
100 101
101 bool acceptable_content(recorder &memory, char *&msg); 102 bool acceptable_content(recorder &memory, char *&msg);
102 bool ignore_host(char *host); 103 bool ignore_host(char *host);
103 104
104 void dump(int level = 0); 105 void dump(int level = 0);
120 CONFIG(); 121 CONFIG();
121 ~CONFIG(); 122 ~CONFIG();
122 void add_context(CONTEXTP con); 123 void add_context(CONTEXTP con);
123 void add_to(char *to, CONTEXTP con); 124 void add_to(char *to, CONTEXTP con);
124 CONTEXTP find_context(char *to); 125 CONTEXTP find_context(char *to);
125
126 char* get_content_suffix() {return default_context->get_content_suffix() ;};
127 char* get_content_message() {return default_context->get_content_message() ;};
128 string_set& get_content_host_ignore() {return default_context->get_content_host_ignore() ;};
129 string_set& get_content_tlds() {return default_context->get_content_tlds() ;};
130 string_set& get_html_tags() {return default_context->get_html_tags() ;};
131
132 void dump(); 126 void dump();
133 }; 127 };
134 128
135 extern char *token_black; 129 extern char *token_black;
136 extern char *token_content; 130 extern char *token_content;