X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=cgi.c;h=7d3fb087bf2e6e7eff02204c73cb138875c5e39c;hp=d2d6d93357a96084036133b07464edf378d34a45;hb=4c3b647b1a0ba45f0a1be7b9b9267557e601e3f7;hpb=536a88ebe11300228987eaa39ef4bbd63cd0e1ba diff --git a/cgi.c b/cgi.c index d2d6d933..7d3fb087 100644 --- a/cgi.c +++ b/cgi.c @@ -1,4 +1,4 @@ -const char cgi_rcs[] = "$Id: cgi.c,v 1.12 2001/07/29 18:47:05 jongfoster Exp $"; +const char cgi_rcs[] = "$Id: cgi.c,v 1.13 2001/07/30 22:08:36 jongfoster Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgi.c,v $ @@ -36,6 +36,12 @@ const char cgi_rcs[] = "$Id: cgi.c,v 1.12 2001/07/29 18:47:05 jongfoster Exp $"; * * Revisions : * $Log: cgi.c,v $ + * Revision 1.13 2001/07/30 22:08:36 jongfoster + * Tidying up #defines: + * - All feature #defines are now of the form FEATURE_xxx + * - Permanently turned off WIN_GUI_EDIT + * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS + * * Revision 1.12 2001/07/29 18:47:05 jongfoster * Adding missing #include "loadcfg.h" * @@ -485,8 +491,7 @@ int cgi_show_status(struct client_state *csp, struct http_response *rsp, exports = map(exports, "options", 1, csp->config->proxy_args, 1); s = show_rcs(); exports = map(exports, "sourceversions", 1, s, 0); - s = show_defines(); - exports = map(exports, "defines", 1, s, 0); + exports = show_defines(exports); #ifdef FEATURE_STATISTICS exports = add_stats(exports); @@ -494,8 +499,6 @@ int cgi_show_status(struct client_state *csp, struct http_response *rsp, exports = map_block_killer(exports, "statistics"); #endif /* ndef FEATURE_STATISTICS */ - exports = map_block_killer(exports, "no-split-args"); - if (csp->actions_list) { exports = map(exports, "actions-filename", 1, csp->actions_list->filename, 1); @@ -1009,6 +1012,48 @@ struct map *map_block_killer(struct map *exports, char *name) } +/********************************************************************* + * + * Function : map_conditional + * + * Description : Convenience function. + * Adds an "if-then-else" for the conditional HTML-template + * block , i.e. a substitution of the form: + * @if--then@ + * True text + * @else-not-@ + * False text + * @endif-@ + * + * The control structure and one of the alternatives + * will be hidden. + * + * Parameters : + * 1 : exports = map to extend + * 2 : name = name of conditional block + * 3 : choose_first = nonzero for first, zero for second. + * + * Returns : extended map + * + *********************************************************************/ +struct map *map_conditional(struct map *exports, char *name, int choose_first) +{ + char buf[1000]; /* Will do, since the names are hardwired */ + + snprintf(buf, 1000, (choose_first + ? "else-not-%s@.*@endif-%s" + : "if-%s-then@.*@else-not-%s"), + name, name); + exports = map(exports, buf, 1, "", 1); + + snprintf(buf, 1000, (choose_first ? "if-%s-then" : "endif-%s"), name); + exports = map(exports, buf, 1, "", 1); + + return(exports); + +} + + /********************************************************************* * * Function : make_menu