summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert James Kaes <rjkaes@users.sourceforge.net>2005-11-04 00:47:07 +0000
committerRobert James Kaes <rjkaes@users.sourceforge.net>2005-11-04 00:47:07 +0000
commitffec04c65eb240211cdc026f609cd99888889210 (patch)
tree84ca4426693f0537b129dd0ca1e7c661e332b369 /src
parentbed712ffa70892318d9583ca75aa7fe2f8cf736f (diff)
downloadtinyproxy-ffec04c65eb240211cdc026f609cd99888889210.tar.gz
tinyproxy-ffec04c65eb240211cdc026f609cd99888889210.zip
Fixed up whitespace formatting of the config file directives. Also
added blank lines to group related directives.
Diffstat (limited to '')
-rw-r--r--src/conffile.c113
1 files changed, 61 insertions, 52 deletions
diff --git a/src/conffile.c b/src/conffile.c
index 1730998..a8d0a8c 100644
--- a/src/conffile.c
+++ b/src/conffile.c
@@ -1,4 +1,4 @@
-/* $Id: conffile.c,v 1.6 2005-08-16 04:03:19 rjkaes Exp $
+/* $Id: conffile.c,v 1.7 2005-11-04 00:47:07 rjkaes Exp $
*
* Parses the configuration file and sets up the config_s structure for
* use by the application. This file replaces the old grammar.y and
@@ -150,59 +150,68 @@ struct {
regex_t *cre;
} directives[] = {
/* comments */
- {
- BEGIN "#", handle_nop},
- /* blank lines */
- {
- "^[[:space:]]+$", handle_nop},
- /* string arguments */
- STDCONF("logfile", STR, handle_logfile),
- STDCONF("pidfile", STR, handle_pidfile),
- STDCONF("anonymous", STR, handle_anonymous),
- STDCONF("viaproxyname", STR, handle_viaproxyname),
- STDCONF("defaulterrorfile", STR, handle_defaulterrorfile),
- STDCONF("statfile", STR, handle_statfile),
- STDCONF("stathost", STR, handle_stathost),
- STDCONF("xtinyproxy", STR, handle_xtinyproxy),
- /* boolean arguments */
- STDCONF("syslog", BOOL, handle_syslog),
- STDCONF("bindsame", BOOL, handle_bindsame),
- /* integer arguments */
- STDCONF("port", INT, handle_port),
- STDCONF("maxclients", INT, handle_maxclients),
- STDCONF("maxspareservers", INT, handle_maxspareservers),
- STDCONF("minspareservers", INT, handle_minspareservers),
- STDCONF("startservers", INT, handle_startservers),
- STDCONF("maxrequestsperchild", INT, handle_maxrequestsperchild),
- STDCONF("timeout", INT, handle_timeout),
- STDCONF("connectport", INT, handle_connectport),
- /* alphanumeric arguments */
- STDCONF("user", ALNUM, handle_user),
- STDCONF("group", ALNUM, handle_group),
- /* ip arguments */
- STDCONF("listen", IP, handle_listen),
- STDCONF("allow", "(" IPMASK "|" ALNUM ")", handle_allow),
- STDCONF("deny", "(" IPMASK "|" ALNUM ")", handle_deny),
- STDCONF("bind", IP, handle_bind),
- /* error files */
- STDCONF("errorfile", INT WS STR, handle_errorfile),
- /* filtering */
- STDCONF("filter", STR, handle_filter),
- STDCONF("filterurls", BOOL, handle_filterurls),
- STDCONF("filterextended", BOOL, handle_filterextended),
- STDCONF("filterdefaultdeny", BOOL, handle_filterdefaultdeny),
- STDCONF("filtercasesensitive", BOOL, handle_filtercasesensitive),
- /* Reverse proxy arguments */
- STDCONF("reversebaseurl", STR, handle_reversebaseurl),
- STDCONF("reverseonly", BOOL, handle_reverseonly),
- STDCONF("reversemagic", BOOL, handle_reversemagic),
- STDCONF("reversepath", STR WS "(" STR ")?", handle_reversepath),
- /* upstream is rather complicated */
+ { BEGIN "#", handle_nop},
+
+ /* blank lines */
+ { "^[[:space:]]+$", handle_nop },
+
+ /* string arguments */
+ STDCONF("logfile", STR, handle_logfile),
+ STDCONF("pidfile", STR, handle_pidfile),
+ STDCONF("anonymous", STR, handle_anonymous),
+ STDCONF("viaproxyname", STR, handle_viaproxyname),
+ STDCONF("defaulterrorfile", STR, handle_defaulterrorfile),
+ STDCONF("statfile", STR, handle_statfile),
+ STDCONF("stathost", STR, handle_stathost),
+ STDCONF("xtinyproxy", STR, handle_xtinyproxy),
+
+ /* boolean arguments */
+ STDCONF("syslog", BOOL, handle_syslog),
+ STDCONF("bindsame", BOOL, handle_bindsame),
+
+ /* integer arguments */
+ STDCONF("port", INT, handle_port),
+ STDCONF("maxclients", INT, handle_maxclients),
+ STDCONF("maxspareservers", INT, handle_maxspareservers),
+ STDCONF("minspareservers", INT, handle_minspareservers),
+ STDCONF("startservers", INT, handle_startservers),
+ STDCONF("maxrequestsperchild", INT, handle_maxrequestsperchild),
+ STDCONF("timeout", INT, handle_timeout),
+ STDCONF("connectport", INT, handle_connectport),
+
+ /* alphanumeric arguments */
+ STDCONF("user", ALNUM, handle_user),
+ STDCONF("group", ALNUM, handle_group),
+
+ /* ip arguments */
+ STDCONF("listen", IP, handle_listen),
+ STDCONF("allow", "(" IPMASK "|" ALNUM ")", handle_allow),
+ STDCONF("deny", "(" IPMASK "|" ALNUM ")", handle_deny),
+ STDCONF("bind", IP, handle_bind),
+
+ /* error files */
+ STDCONF("errorfile", INT WS STR, handle_errorfile),
+
+ /* filtering */
+ STDCONF("filter", STR, handle_filter),
+ STDCONF("filterurls", BOOL, handle_filterurls),
+ STDCONF("filterextended", BOOL, handle_filterextended),
+ STDCONF("filterdefaultdeny", BOOL, handle_filterdefaultdeny),
+ STDCONF("filtercasesensitive", BOOL, handle_filtercasesensitive),
+
+ /* Reverse proxy arguments */
+ STDCONF("reversebaseurl", STR, handle_reversebaseurl),
+ STDCONF("reverseonly", BOOL, handle_reverseonly),
+ STDCONF("reversemagic", BOOL, handle_reversemagic),
+ STDCONF("reversepath", STR WS "(" STR ")?", handle_reversepath),
+
+ /* upstream is rather complicated */
// { BEGIN "no" WS "upstream" WS STR END, handle_no_upstream },
// { BEGIN "upstream" WS IP ":" INT "(" WS STR ")" END, handle_upstream },
- /* loglevel */
- STDCONF("loglevel", "(critical|error|warning|notice|connect|info)",
- handle_loglevel)
+
+ /* loglevel */
+ STDCONF("loglevel", "(critical|error|warning|notice|connect|info)",
+ handle_loglevel)
};
const unsigned int ndirectives = sizeof(directives) / sizeof(directives[0]);