Re-generated from sgml source
[privoxy.git] / cgisimple.c
1 const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.35.2.2 2003/04/03 13:48:28 oes Exp $";
2 /*********************************************************************
3  *
4  * File        :  $Source: /cvsroot/ijbswa/current/Attic/cgisimple.c,v $
5  *
6  * Purpose     :  Simple CGIs to get information about Privoxy's
7  *                status.
8  *                
9  *                Functions declared include:
10  * 
11  *
12  * Copyright   :  Written by and Copyright (C) 2001 the SourceForge
13  *                Privoxy team. http://www.privoxy.org/
14  *
15  *                Based on the Internet Junkbuster originally written
16  *                by and Copyright (C) 1997 Anonymous Coders and 
17  *                Junkbusters Corporation.  http://www.junkbusters.com
18  *
19  *                This program is free software; you can redistribute it 
20  *                and/or modify it under the terms of the GNU General
21  *                Public License as published by the Free Software
22  *                Foundation; either version 2 of the License, or (at
23  *                your option) any later version.
24  *
25  *                This program is distributed in the hope that it will
26  *                be useful, but WITHOUT ANY WARRANTY; without even the
27  *                implied warranty of MERCHANTABILITY or FITNESS FOR A
28  *                PARTICULAR PURPOSE.  See the GNU General Public
29  *                License for more details.
30  *
31  *                The GNU General Public License should be included with
32  *                this file.  If not, you can view it at
33  *                http://www.gnu.org/copyleft/gpl.html
34  *                or write to the Free Software Foundation, Inc., 59
35  *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
36  *
37  * Revisions   :
38  *    $Log: cgisimple.c,v $
39  *    Revision 1.35.2.2  2003/04/03 13:48:28  oes
40  *    Don't show "Edit" buttons #ifndef FEATURE_CGI_EDIT_ACTIONS
41  *
42  *    Revision 1.35.2.1  2002/07/04 15:02:38  oes
43  *    Added ability to send redirects to send-banner CGI, so that it can completely mimic the image blocking action if called with type=auto
44  *
45  *    Revision 1.35.2.1  2002/07/01 17:32:04  morcego
46  *    Applying patch from Andreas as provided by Hal on the list.
47  *    Message-ID: <20020701121218.V1606@feenix.burgiss.net>
48  *
49  *    Revision 1.35  2002/05/12 21:44:44  jongfoster
50  *    Adding amiga.[ch] revision information, if on an amiga.
51  *
52  *    Revision 1.34  2002/04/30 12:06:12  oes
53  *    Deleted unused code from default_cgi
54  *
55  *    Revision 1.33  2002/04/30 11:14:52  oes
56  *    Made csp the first parameter in *action_to_html
57  *
58  *    Revision 1.32  2002/04/26 18:29:13  jongfoster
59  *    Fixing this Visual C++ warning:
60  *    cgisimple.c(775) : warning C4018: '<' : signed/unsigned mismatch
61  *
62  *    Revision 1.31  2002/04/26 12:54:36  oes
63  *     - Kill obsolete REDIRECT_URL code
64  *     - Error handling fixes
65  *     - Style sheet related HTML snipplet changes
66  *     - cgi_show_url_info:
67  *       - Matches now in table, actions on single lines,
68  *         linked to help
69  *       - standard.action suppressed
70  *       - Buttons to View and Edit AFs
71  *
72  *    Revision 1.30  2002/04/24 02:18:08  oes
73  *     - show-status is now the starting point for editing
74  *       the actions files, generate list of all AFs with buttons
75  *       for viewing and editing, new look for file list (Jon:
76  *       buttons now aligned ;-P ), view mode now supports multiple
77  *       AFs, name changes, no view links for unspecified files,
78  *       no edit link for standard.action.
79  *
80  *     - Jon's multiple AF patch: cgi_show_url_info now uses all
81  *       AFs and marks the output accordingly
82  *
83  *    Revision 1.29  2002/04/10 13:38:35  oes
84  *    load_template signature changed
85  *
86  *    Revision 1.28  2002/04/07 15:42:12  jongfoster
87  *    Fixing send-banner?type=auto when the image-blocker is
88  *    a redirect to send-banner
89  *
90  *    Revision 1.27  2002/04/05 15:50:48  oes
91  *    added send-stylesheet CGI
92  *
93  *    Revision 1.26  2002/04/04 00:36:36  gliptak
94  *    always use pcre for matching
95  *
96  *    Revision 1.25  2002/04/03 22:28:03  gliptak
97  *    Removed references to gnu_regex
98  *
99  *    Revision 1.24  2002/04/02 16:12:47  oes
100  *    Fix: moving misplaced lines into #ifdef FEATURE_FORCE
101  *
102  *    Revision 1.23  2002/03/26 22:29:54  swa
103  *    we have a new homepage!
104  *
105  *    Revision 1.22  2002/03/24 16:18:15  jongfoster
106  *    Removing old logo
107  *
108  *    Revision 1.21  2002/03/24 15:23:33  jongfoster
109  *    Name changes
110  *
111  *    Revision 1.20  2002/03/24 13:25:43  swa
112  *    name change related issues
113  *
114  *    Revision 1.19  2002/03/16 23:54:06  jongfoster
115  *    Adding graceful termination feature, to help look for memory leaks.
116  *    If you enable this (which, by design, has to be done by hand
117  *    editing config.h) and then go to http://i.j.b/die, then the program
118  *    will exit cleanly after the *next* request.  It should free all the
119  *    memory that was used.
120  *
121  *    Revision 1.18  2002/03/12 01:44:49  oes
122  *    Changed default for "blocked" image from jb logo to checkboard pattern
123  *
124  *    Revision 1.17  2002/03/08 16:43:18  oes
125  *    Added choice beween GIF and PNG built-in images
126  *
127  *    Revision 1.16  2002/03/07 03:48:38  oes
128  *     - Changed built-in images from GIF to PNG
129  *       (with regard to Unisys patent issue)
130  *     - Added a 4x4 pattern PNG which is less intrusive
131  *       than the logo but also clearly marks the deleted banners
132  *
133  *    Revision 1.15  2002/03/06 22:54:35  jongfoster
134  *    Automated function-comment nitpicking.
135  *
136  *    Revision 1.14  2002/03/02 04:14:50  david__schmidt
137  *    Clean up a little CRLF unpleasantness that suddenly appeared
138  *
139  *    Revision 1.13  2002/02/21 00:10:37  jongfoster
140  *    Adding send-banner?type=auto option
141  *
142  *    Revision 1.12  2002/01/23 01:03:32  jongfoster
143  *    Fixing gcc [CygWin] compiler warnings
144  *
145  *    Revision 1.11  2002/01/23 00:01:04  jongfoster
146  *    Adding cgi_transparent_gif() for http://i.j.b/t
147  *    Adding missing html_encode() to many CGI functions.
148  *    Adding urlmatch.[ch] to http://i.j.b/show-version
149  *
150  *    Revision 1.10  2002/01/17 21:10:37  jongfoster
151  *    Changes to cgi_show_url_info to use new matching code from urlmatch.c.
152  *    Also fixing a problem in the same function with improperly quoted URLs
153  *    in output HTML, and adding code to handle https:// URLs correctly.
154  *
155  *    Revision 1.9  2001/11/30 23:09:15  jongfoster
156  *    Now reports on FEATURE_CGI_EDIT_ACTIONS
157  *    Removing FEATURE_DENY_GZIP from template
158  *
159  *    Revision 1.8  2001/11/13 00:14:07  jongfoster
160  *    Fixing stupid bug now I've figured out what || means.
161  *    (It always returns 0 or 1, not one of it's paramaters.)
162  *
163  *    Revision 1.7  2001/10/23 21:48:19  jongfoster
164  *    Cleaning up error handling in CGI functions - they now send back
165  *    a HTML error page and should never cause a FATAL error.  (Fixes one
166  *    potential source of "denial of service" attacks).
167  *
168  *    CGI actions file editor that works and is actually useful.
169  *
170  *    Ability to toggle JunkBuster remotely using a CGI call.
171  *
172  *    You can turn off both the above features in the main configuration
173  *    file, e.g. if you are running a multi-user proxy.
174  *
175  *    Revision 1.6  2001/10/14 22:00:32  jongfoster
176  *    Adding support for a 404 error when an invalid CGI page is requested.
177  *
178  *    Revision 1.5  2001/10/07 15:30:41  oes
179  *    Removed FEATURE_DENY_GZIP
180  *
181  *    Revision 1.4  2001/10/02 15:31:12  oes
182  *    Introduced show-request cgi
183  *
184  *    Revision 1.3  2001/09/22 16:34:44  jongfoster
185  *    Removing unneeded #includes
186  *
187  *    Revision 1.2  2001/09/19 18:01:11  oes
188  *    Fixed comments; cosmetics
189  *
190  *    Revision 1.1  2001/09/16 17:08:54  jongfoster
191  *    Moving simple CGI functions from cgi.c to new file cgisimple.c
192  *
193  *
194  **********************************************************************/
195 \f
196
197 #include "config.h"
198
199 #include <stdio.h>
200 #include <sys/types.h>
201 #include <stdlib.h>
202 #include <ctype.h>
203 #include <string.h>
204 #include <assert.h>
205
206 #ifdef _WIN32
207 #define snprintf _snprintf
208 #endif /* def _WIN32 */
209
210 #include "project.h"
211 #include "cgi.h"
212 #include "cgisimple.h"
213 #include "list.h"
214 #include "encode.h"
215 #include "jcc.h"
216 #include "filters.h"
217 #include "actions.h"
218 #include "miscutil.h"
219 #include "loadcfg.h"
220 #include "parsers.h"
221 #include "urlmatch.h"
222 #include "errlog.h"
223
224 const char cgisimple_h_rcs[] = CGISIMPLE_H_VERSION;
225
226
227 static char *show_rcs(void);
228 static jb_err show_defines(struct map *exports);
229
230
231 /*********************************************************************
232  *
233  * Function    :  cgi_default
234  *
235  * Description :  CGI function that is called for the CGI_SITE_1_HOST
236  *                and CGI_SITE_2_HOST/CGI_SITE_2_PATH base URLs.
237  *                Boring - only exports the default exports.
238  *               
239  * Parameters  :
240  *          1  :  csp = Current client state (buffers, headers, etc...)
241  *          2  :  rsp = http_response data structure for output
242  *          3  :  parameters = map of cgi parameters
243  *
244  * CGI Parameters : none
245  *
246  * Returns     :  JB_ERR_OK on success
247  *                JB_ERR_MEMORY on out-of-memory
248  *
249  *********************************************************************/
250 jb_err cgi_default(struct client_state *csp,
251                    struct http_response *rsp,
252                    const struct map *parameters)
253 {
254    struct map *exports;
255
256    assert(csp);
257    assert(rsp);
258
259    if (NULL == (exports = default_exports(csp, "")))
260    {
261       return JB_ERR_MEMORY;
262    }
263
264    return template_fill_for_cgi(csp, "default", exports, rsp);
265 }
266
267
268 /*********************************************************************
269  *
270  * Function    :  cgi_error_404
271  *
272  * Description :  CGI function that is called if an unknown action was
273  *                given.
274  *               
275  * Parameters  :
276  *          1  :  csp = Current client state (buffers, headers, etc...)
277  *          2  :  rsp = http_response data structure for output
278  *          3  :  parameters = map of cgi parameters
279  *
280  * CGI Parameters : none
281  *
282  * Returns     :  JB_ERR_OK on success
283  *                JB_ERR_MEMORY on out-of-memory error.  
284  *
285  *********************************************************************/
286 jb_err cgi_error_404(struct client_state *csp,
287                      struct http_response *rsp,
288                      const struct map *parameters)
289 {
290    struct map *exports;
291
292    assert(csp);
293    assert(rsp);
294    assert(parameters);
295
296    if (NULL == (exports = default_exports(csp, NULL)))
297    {
298       return JB_ERR_MEMORY;
299    }
300
301    rsp->status = strdup("404 Privoxy configuration page not found");
302    if (rsp->status == NULL)
303    {
304       free_map(exports);
305       return JB_ERR_MEMORY;
306    }
307
308    return template_fill_for_cgi(csp, "cgi-error-404", exports, rsp);
309 }
310
311
312 #ifdef FEATURE_GRACEFUL_TERMINATION
313 /*********************************************************************
314  *
315  * Function    :  cgi_die
316  *
317  * Description :  CGI function to shut down Privoxy.
318  *                NOTE: Turning this on in a production build
319  *                would be a BAD idea.  An EXTREMELY BAD idea.
320  *                In short, don't do it.
321  *               
322  * Parameters  :
323  *          1  :  csp = Current client state (buffers, headers, etc...)
324  *          2  :  rsp = http_response data structure for output
325  *          3  :  parameters = map of cgi parameters
326  *
327  * CGI Parameters : none
328  *
329  * Returns     :  JB_ERR_OK on success
330  *                JB_ERR_MEMORY on out-of-memory error.  
331  *
332  *********************************************************************/
333 jb_err cgi_die (struct client_state *csp,
334                 struct http_response *rsp,
335                 const struct map *parameters)
336 {
337    assert(csp);
338    assert(rsp);
339    assert(parameters);
340
341    /* quit */
342    g_terminate = 1;
343
344    /*
345     * I don't really care what gets sent back to the browser.
346     * Take the easy option - "out of memory" page.
347     */
348
349    return JB_ERR_MEMORY;
350 }
351 #endif /* def FEATURE_GRACEFUL_TERMINATION */
352
353
354 /*********************************************************************
355  *
356  * Function    :  cgi_show_request
357  *
358  * Description :  Show the client's request and what sed() would have
359  *                made of it.
360  *               
361  * Parameters  :
362  *          1  :  csp = Current client state (buffers, headers, etc...)
363  *          2  :  rsp = http_response data structure for output
364  *          3  :  parameters = map of cgi parameters
365  *
366  * CGI Parameters : none
367  *
368  * Returns     :  JB_ERR_OK on success
369  *                JB_ERR_MEMORY on out-of-memory error.  
370  *
371  *********************************************************************/
372 jb_err cgi_show_request(struct client_state *csp,
373                         struct http_response *rsp,
374                         const struct map *parameters)
375 {
376    char *p;
377    struct map *exports;
378
379    assert(csp);
380    assert(rsp);
381    assert(parameters);
382
383    if (NULL == (exports = default_exports(csp, "show-request")))
384    {
385       return JB_ERR_MEMORY;
386    }
387    
388    /*
389     * Repair the damage done to the IOB by get_header()
390     */
391    for (p = csp->iob->buf; p < csp->iob->eod; p++)
392    {
393       if (*p == '\0') *p = '\n';
394    }
395
396    /*
397     * Export the original client's request and the one we would
398     * be sending to the server if this wasn't a CGI call
399     */
400
401    if (map(exports, "client-request", 1, html_encode(csp->iob->buf), 0))
402    {
403       free_map(exports);
404       return JB_ERR_MEMORY;
405    }
406
407    if (map(exports, "processed-request", 1, html_encode_and_free_original(
408       sed(client_patterns, add_client_headers, csp)), 0))
409    {
410       free_map(exports);
411       return JB_ERR_MEMORY;
412    }
413
414    return template_fill_for_cgi(csp, "show-request", exports, rsp);
415 }
416
417
418 /*********************************************************************
419  *
420  * Function    :  cgi_send_banner
421  *
422  * Description :  CGI function that returns a banner. 
423  *
424  * Parameters  :
425  *          1  :  csp = Current client state (buffers, headers, etc...)
426  *          2  :  rsp = http_response data structure for output
427  *          3  :  parameters = map of cgi parameters
428  *
429  * CGI Parameters :
430  *           type : Selects the type of banner between "trans", "logo",
431  *                  and "auto". Defaults to "logo" if absent or invalid.
432  *                  "auto" means to select as if we were image-blocking.
433  *                  (Only the first character really counts; b and t are
434  *                  equivalent).
435  *
436  * Returns     :  JB_ERR_OK on success
437  *                JB_ERR_MEMORY on out-of-memory error.  
438  *
439  *********************************************************************/
440 jb_err cgi_send_banner(struct client_state *csp,
441                        struct http_response *rsp,
442                        const struct map *parameters)
443 {
444    char imagetype = lookup(parameters, "type")[0];
445
446    /*
447     * If type is auto, then determine the right thing
448     * to do from the set-image-blocker action
449     */
450    if (imagetype == 'a') 
451    {
452       /*
453        * Default to pattern
454        */
455       imagetype = 'p';
456
457 #ifdef FEATURE_IMAGE_BLOCKING
458       if ((csp->action->flags & ACTION_IMAGE_BLOCKER) != 0)
459       {
460          static const char prefix1[] = CGI_PREFIX "send-banner?type=";
461          static const char prefix2[] = "http://" CGI_SITE_1_HOST "/send-banner?type=";
462          const char *p = csp->action->string[ACTION_STRING_IMAGE_BLOCKER];
463
464          if (p == NULL)
465          {
466             /* Use default - nothing to do here. */
467          }
468          else if (0 == strcmpic(p, "blank"))
469          {
470             imagetype = 'b';
471          }
472          else if (0 == strcmpic(p, "pattern"))
473          {
474             imagetype = 'p';
475          }
476
477          /*
478           * If the action is to call this CGI, determine
479           * the argument:
480           */
481          else if (0 == strncmpic(p, prefix1, sizeof(prefix1) - 1))
482          {
483             imagetype = p[sizeof(prefix1) - 1];
484          }
485          else if (0 == strncmpic(p, prefix2, sizeof(prefix2) - 1))
486          {
487             imagetype = p[sizeof(prefix2) - 1];
488          }
489
490          /*
491           * Everything else must (should) be a URL to
492           * redirect to.
493           */
494          else
495          {
496             imagetype = 'r';
497          }
498       }
499 #endif /* def FEATURE_IMAGE_BLOCKING */
500    }
501       
502    /*
503     * Now imagetype is either the non-auto type we were called with,
504     * or it was auto and has since been determined. In any case, we
505     * can proceed to actually answering the request by sending a redirect
506     * or an image as appropriate:
507     */
508    if (imagetype == 'r') 
509    {
510       rsp->status = strdup("302 Local Redirect from Privoxy");
511       if (rsp->status == NULL)
512       {
513          return JB_ERR_MEMORY;
514       }
515       if (enlist_unique_header(rsp->headers, "Location",
516                                csp->action->string[ACTION_STRING_IMAGE_BLOCKER]))
517       {
518          return JB_ERR_MEMORY;
519       }
520    }
521    else
522    {
523       if ((imagetype == 'b') || (imagetype == 't')) 
524       {
525          rsp->body = bindup(image_blank_data, image_blank_length);
526          rsp->content_length = image_blank_length;
527       }
528       else
529       {
530          rsp->body = bindup(image_pattern_data, image_pattern_length);
531          rsp->content_length = image_pattern_length;
532       }
533
534       if (rsp->body == NULL)
535       {
536          return JB_ERR_MEMORY;
537       }
538       if (enlist(rsp->headers, "Content-Type: " BUILTIN_IMAGE_MIMETYPE))
539       {
540          return JB_ERR_MEMORY;
541       }
542
543       rsp->is_static = 1;
544    }
545
546    return JB_ERR_OK;
547
548 }
549
550
551 /*********************************************************************
552  *
553  * Function    :  cgi_transparent_image
554  *
555  * Description :  CGI function that sends a 1x1 transparent image.
556  *
557  * Parameters  :
558  *          1  :  csp = Current client state (buffers, headers, etc...)
559  *          2  :  rsp = http_response data structure for output
560  *          3  :  parameters = map of cgi parameters
561  *
562  * CGI Parameters : None
563  *
564  * Returns     :  JB_ERR_OK on success
565  *                JB_ERR_MEMORY on out-of-memory error.  
566  *
567  *********************************************************************/
568 jb_err cgi_transparent_image(struct client_state *csp,
569                              struct http_response *rsp,
570                              const struct map *parameters)
571 {
572    rsp->body = bindup(image_blank_data, image_blank_length);
573    rsp->content_length = image_blank_length;
574
575    if (rsp->body == NULL)
576    {
577       return JB_ERR_MEMORY;
578    }
579
580    if (enlist(rsp->headers, "Content-Type: " BUILTIN_IMAGE_MIMETYPE))
581    {
582       return JB_ERR_MEMORY;
583    }
584
585    rsp->is_static = 1;
586
587    return JB_ERR_OK;
588
589 }
590
591
592 /*********************************************************************
593  *
594  * Function    :  cgi_send_stylesheet
595  *
596  * Description :  CGI function that sends a css stylesheet found
597  *                in the cgi-style.css template
598  *
599  * Parameters  :
600  *          1  :  csp = Current client state (buffers, headers, etc...)
601  *          2  :  rsp = http_response data structure for output
602  *          3  :  parameters = map of cgi parameters
603  *
604  * CGI Parameters : None
605  *
606  * Returns     :  JB_ERR_OK on success
607  *                JB_ERR_MEMORY on out-of-memory error.  
608  *
609  *********************************************************************/
610 jb_err cgi_send_stylesheet(struct client_state *csp,
611                            struct http_response *rsp,
612                            const struct map *parameters)
613 {
614    jb_err err;
615    
616    assert(csp);
617    assert(rsp);
618
619    err = template_load(csp, &rsp->body, "cgi-style.css", 0);
620
621    if (err == JB_ERR_FILE)
622    {
623       /*
624        * No way to tell user; send empty stylesheet
625        */
626       log_error(LOG_LEVEL_ERROR, "Could not find cgi-style.css template");
627    }
628    else if (err)
629    {
630       return err; /* JB_ERR_MEMORY */
631    }
632
633    if (enlist(rsp->headers, "Content-Type: text/css"))
634    {
635       return JB_ERR_MEMORY;
636    }
637
638    return JB_ERR_OK;
639
640 }
641
642
643 /*********************************************************************
644  *
645  * Function    :  cgi_show_version
646  *
647  * Description :  CGI function that returns a a web page describing the
648  *                file versions of Privoxy.
649  *
650  * Parameters  :
651  *          1  :  csp = Current client state (buffers, headers, etc...)
652  *          2  :  rsp = http_response data structure for output
653  *          3  :  parameters = map of cgi parameters
654  *
655  * CGI Parameters : none
656  *
657  * Returns     :  JB_ERR_OK on success
658  *                JB_ERR_MEMORY on out-of-memory error.  
659  *
660  *********************************************************************/
661 jb_err cgi_show_version(struct client_state *csp,
662                         struct http_response *rsp,
663                         const struct map *parameters)
664 {
665    struct map *exports;
666
667    assert(csp);
668    assert(rsp);
669    assert(parameters);
670
671    if (NULL == (exports = default_exports(csp, "show-version")))
672    {
673       return JB_ERR_MEMORY;
674    }
675
676    if (map(exports, "sourceversions", 1, show_rcs(), 0))
677    {
678       free_map(exports);
679       return JB_ERR_MEMORY;
680    }
681
682    return template_fill_for_cgi(csp, "show-version", exports, rsp);
683 }
684
685  
686 /*********************************************************************
687  *
688  * Function    :  cgi_show_status
689  *
690  * Description :  CGI function that returns a a web page describing the
691  *                current status of Privoxy.
692  *
693  * Parameters  :
694  *          1  :  csp = Current client state (buffers, headers, etc...)
695  *          2  :  rsp = http_response data structure for output
696  *          3  :  parameters = map of cgi parameters
697  *
698  * CGI Parameters :
699  *        file :  Which file to show.  Only first letter is checked,
700  *                valid values are:
701  *                - "p"ermissions (actions) file
702  *                - "r"egex
703  *                - "t"rust
704  *                Default is to show menu and other information.
705  *
706  * Returns     :  JB_ERR_OK on success
707  *                JB_ERR_MEMORY on out-of-memory error.  
708  *
709  *********************************************************************/
710 jb_err cgi_show_status(struct client_state *csp,
711                        struct http_response *rsp,
712                        const struct map *parameters)
713 {
714    char *s = NULL;
715    unsigned i;
716    int j;
717
718    FILE * fp;
719    char buf[BUFFER_SIZE];
720    const char * filename = NULL;
721    char * file_description = NULL;
722 #ifdef FEATURE_STATISTICS
723    float perc_rej;   /* Percentage of http requests rejected */
724    int local_urls_read;
725    int local_urls_rejected;
726 #endif /* ndef FEATURE_STATISTICS */
727    struct file_list * fl;
728    struct url_actions * b;
729    jb_err err = JB_ERR_OK;
730
731    struct map *exports;
732
733    assert(csp);
734    assert(rsp);
735    assert(parameters);
736
737    if (NULL == (exports = default_exports(csp, "show-status")))
738    {
739       return JB_ERR_MEMORY;
740    }
741
742    switch (*(lookup(parameters, "file")))
743    {
744    case 'a':
745       if (!get_number_param(csp, parameters, "index", &i) && i < MAX_ACTION_FILES && csp->actions_list[i])
746       {
747          filename = csp->actions_list[i]->filename;
748          file_description = "Actions File";
749       }
750       break;
751
752    case 'f':
753       if (csp->rlist)
754       {
755          filename = csp->rlist->filename;
756          file_description = "Filter File";
757       }
758       break;
759
760 #ifdef FEATURE_TRUST
761    case 't':
762       if (csp->tlist)
763       {
764          filename = csp->tlist->filename;
765          file_description = "Trust File";
766       }
767       break;
768 #endif /* def FEATURE_TRUST */
769    }
770
771    if (NULL != filename)
772    {
773       if ( map(exports, "file-description", 1, file_description, 1)
774         || map(exports, "filepath", 1, html_encode(filename), 0) )
775       {
776          free_map(exports);
777          return JB_ERR_MEMORY;
778       }
779
780       if ((fp = fopen(filename, "r")) == NULL)
781       {
782          if (map(exports, "content", 1, "<h1>ERROR OPENING FILE!</h1>", 1))
783          {
784             free_map(exports);
785             return JB_ERR_MEMORY;
786          }
787       }
788       else
789       {
790          s = strdup("");
791          while ((s != NULL) && fgets(buf, sizeof(buf), fp))
792          {
793             string_join  (&s, html_encode(buf));
794          }
795          fclose(fp);
796
797          if (map(exports, "contents", 1, s, 0))
798          {
799             free_map(exports);
800             return JB_ERR_MEMORY;
801          }
802       }
803
804       return template_fill_for_cgi(csp, "show-status-file", exports, rsp);
805    }
806
807    s = strdup("");
808    for (j = 0; (s != NULL) && (j < Argc); j++)
809    {
810       if (!err) err = string_join  (&s, html_encode(Argv[j]));
811       if (!err) err = string_append(&s, " ");
812    }
813    if (!err) err = map(exports, "invocation", 1, s, 0);
814
815    if (!err) err = map(exports, "options", 1, csp->config->proxy_args, 1);
816    if (!err) err = show_defines(exports);
817
818    if (err) 
819    {
820       free_map(exports);
821       return JB_ERR_MEMORY;
822    }
823
824 #ifdef FEATURE_STATISTICS
825    local_urls_read     = urls_read;
826    local_urls_rejected = urls_rejected;
827
828    /*
829     * Need to alter the stats not to include the fetch of this
830     * page.
831     *
832     * Can't do following thread safely! doh!
833     *
834     * urls_read--;
835     * urls_rejected--; * This will be incremented subsequently *
836     */
837
838    if (local_urls_read == 0)
839    {
840       if (!err) err = map_block_killer(exports, "have-stats");
841    }
842    else
843    {
844       if (!err) err = map_block_killer(exports, "have-no-stats");
845
846       perc_rej = (float)local_urls_rejected * 100.0F /
847             (float)local_urls_read;
848
849       sprintf(buf, "%d", local_urls_read);
850       if (!err) err = map(exports, "requests-received", 1, buf, 1);
851
852       sprintf(buf, "%d", local_urls_rejected);
853       if (!err) err = map(exports, "requests-blocked", 1, buf, 1);
854
855       sprintf(buf, "%6.2f", perc_rej);
856       if (!err) err = map(exports, "percent-blocked", 1, buf, 1);
857    }
858
859 #else /* ndef FEATURE_STATISTICS */
860    err = err || map_block_killer(exports, "statistics");
861 #endif /* ndef FEATURE_STATISTICS */
862    
863    /* 
864     * List all action files in use, together with view and edit links,
865     * except for standard.action, which should only be viewable. (Not
866     * enforced in the editor itself)
867     * FIXME: Shouldn't include hardwired HTML here, use line template instead!
868     */
869    s = strdup("");
870    for (i = 0; i < MAX_ACTION_FILES; i++)
871    {
872       if (((fl = csp->actions_list[i]) != NULL) && ((b = fl->f) != NULL))
873       {
874          if (!err) err = string_append(&s, "<tr><td>");
875          if (!err) err = string_join(&s, html_encode(csp->actions_list[i]->filename));
876          snprintf(buf, 100, "</td><td class=\"buttons\"><a href=\"/show-status?file=actions&index=%d\">View</a>", i);
877          if (!err) err = string_append(&s, buf);
878
879 #ifdef FEATURE_CGI_EDIT_ACTIONS
880          if (NULL == strstr(csp->actions_list[i]->filename, "standard.action") && NULL != csp->config->actions_file_short[i])
881          {
882             snprintf(buf, 100, "&nbsp;&nbsp;<a href=\"/edit-actions-list?f=%s\">Edit</a>", csp->config->actions_file_short[i]);
883             if (!err) err = string_append(&s, buf);
884          }
885 #endif
886
887          if (!err) err = string_append(&s, "</td></tr>\n");
888       }
889    }
890    if (*s != '\0')   
891    {
892       if (!err) err = map(exports, "actions-filenames", 1, s, 0);
893    }
894    else
895    {
896       if (!err) err = map(exports, "actions-filenames", 1, "<tr><td>None specified</td></tr>", 1);
897    }
898
899    if (csp->rlist)
900    {
901       if (!err) err = map(exports, "re-filter-filename", 1, html_encode(csp->rlist->filename), 0);
902    }
903    else
904    {
905       if (!err) err = map(exports, "re-filter-filename", 1, "None specified", 1);
906       if (!err) err = map_block_killer(exports, "have-filterfile");
907    }
908
909 #ifdef FEATURE_TRUST
910    if (csp->tlist)
911    {
912       if (!err) err = map(exports, "trust-filename", 1, html_encode(csp->tlist->filename), 0);
913    }
914    else
915    {
916       if (!err) err = map(exports, "trust-filename", 1, "None specified", 1);
917       if (!err) err = map_block_killer(exports, "have-trustfile");
918    }
919 #else
920    if (!err) err = map_block_killer(exports, "trust-support");
921 #endif /* ndef FEATURE_TRUST */
922
923    if (err)
924    {
925       free_map(exports);
926       return JB_ERR_MEMORY;
927    }
928
929    return template_fill_for_cgi(csp, "show-status", exports, rsp);
930 }
931
932  
933 /*********************************************************************
934  *
935  * Function    :  cgi_show_url_info
936  *
937  * Description :  CGI function that determines and shows which actions
938  *                Privoxy will perform for a given url, and which
939  *                matches starting from the defaults have lead to that.
940  *
941  * Parameters  :
942  *          1  :  csp = Current client state (buffers, headers, etc...)
943  *          2  :  rsp = http_response data structure for output
944  *          3  :  parameters = map of cgi parameters
945  *
946  * CGI Parameters :
947  *            url : The url whose actions are to be determined.
948  *                  If url is unset, the url-given conditional will be
949  *                  set, so that all but the form can be suppressed in
950  *                  the template.
951  *
952  * Returns     :  JB_ERR_OK on success
953  *                JB_ERR_MEMORY on out-of-memory error.  
954  *
955  *********************************************************************/
956 jb_err cgi_show_url_info(struct client_state *csp,
957                          struct http_response *rsp,
958                          const struct map *parameters)
959 {
960    char *url_param;
961    struct map *exports;
962    char buf[150];
963
964    assert(csp);
965    assert(rsp);
966    assert(parameters);
967
968    if (NULL == (exports = default_exports(csp, "show-url-info")))
969    {
970       return JB_ERR_MEMORY;
971    }
972
973    /*
974     * Get the url= parameter (if present) and remove any leading/trailing spaces.
975     */
976    url_param = strdup(lookup(parameters, "url"));
977    if (url_param == NULL)
978    {
979       free_map(exports);
980       return JB_ERR_MEMORY;
981    }
982    chomp(url_param);
983
984    /*
985     * Handle prefixes.  4 possibilities:
986     * 1) "http://" or "https://" prefix present and followed by URL - OK
987     * 2) Only the "http://" or "https://" part is present, no URL - change
988     *    to empty string so it will be detected later as "no URL".
989     * 3) Parameter specified but doesn't contain "http(s?)://" - add a
990     *    "http://" prefix.
991     * 4) Parameter not specified or is empty string - let this fall through
992     *    for now, next block of code will handle it.
993     */
994    if (0 == strncmp(url_param, "http://", 7))
995    {
996       if (url_param[7] == '\0')
997       {
998          /*
999           * Empty URL (just prefix).
1000           * Make it totally empty so it's caught by the next if()
1001           */
1002          url_param[0] = '\0';
1003       }
1004    }
1005    else if (0 == strncmp(url_param, "https://", 8))
1006    {
1007       if (url_param[8] == '\0')
1008       {
1009          /*
1010           * Empty URL (just prefix).
1011           * Make it totally empty so it's caught by the next if()
1012           */
1013          url_param[0] = '\0';
1014       }
1015    }
1016    else if (url_param[0] != '\0')
1017    {
1018       /*
1019        * Unknown prefix - assume http://
1020        */
1021       char * url_param_prefixed = malloc(7 + 1 + strlen(url_param));
1022       if (NULL == url_param_prefixed)
1023       {
1024          free(url_param);
1025          free_map(exports);
1026          return JB_ERR_MEMORY;
1027       }
1028       strcpy(url_param_prefixed, "http://");
1029       strcpy(url_param_prefixed + 7, url_param);
1030       free(url_param);
1031       url_param = url_param_prefixed;
1032    }
1033
1034
1035    if (url_param[0] == '\0')
1036    {
1037       /* URL paramater not specified, display query form only. */
1038       free(url_param);
1039       if (map_block_killer(exports, "url-given")
1040         || map(exports, "url", 1, "", 1))
1041       {
1042          free_map(exports);
1043          return JB_ERR_MEMORY;
1044       }
1045    }
1046    else
1047    {
1048       /* Given a URL, so query it. */
1049       jb_err err;
1050       char *matches;
1051       char *s;
1052       int hits = 0;
1053       struct file_list *fl;
1054       struct url_actions *b;
1055       struct http_request url_to_query[1];
1056       struct current_action_spec action[1];
1057       int i;
1058       
1059       if (map(exports, "url", 1, html_encode(url_param), 0))
1060       {
1061          free(url_param);
1062          free_map(exports);
1063          return JB_ERR_MEMORY;
1064       }
1065
1066       init_current_action(action);
1067
1068       if (map(exports, "default", 1, current_action_to_html(csp, action), 0))
1069       {
1070          free_current_action(action);
1071          free(url_param);
1072          free_map(exports);
1073          return JB_ERR_MEMORY;
1074       }
1075
1076       err = parse_http_url(url_param, url_to_query, csp);
1077
1078       free(url_param);
1079
1080       if (err == JB_ERR_MEMORY)
1081       {
1082          free_http_request(url_to_query);
1083          free_current_action(action);
1084          free_map(exports);
1085          return JB_ERR_MEMORY;
1086       }
1087       else if (err)
1088       {
1089          /* Invalid URL */
1090
1091          err = map(exports, "matches", 1, "<b>[Invalid URL specified!]</b>" , 1);
1092          if (!err) err = map(exports, "final", 1, lookup(exports, "default"), 1);
1093
1094          free_current_action(action);
1095          free_http_request(url_to_query);
1096
1097          if (err)
1098          {
1099             free_map(exports);
1100             return JB_ERR_MEMORY;
1101          }
1102
1103          return template_fill_for_cgi(csp, "show-url-info", exports, rsp);
1104       }
1105
1106       /*
1107        * We have a warning about SSL paths.  Hide it for insecure sites.
1108        */
1109       if (!url_to_query->ssl)
1110       {
1111          if (map_block_killer(exports, "https"))
1112          {
1113             free_current_action(action);
1114             free_map(exports);
1115             free_http_request(url_to_query);
1116             return JB_ERR_MEMORY;
1117          }
1118       }
1119
1120       matches = strdup("<table class=\"transparent\">");
1121
1122       for (i = 0; i < MAX_ACTION_FILES; i++)
1123       {
1124          if (NULL == csp->config->actions_file_short[i]
1125              || !strcmp(csp->config->actions_file_short[i], "standard")) continue;
1126
1127          b = NULL;
1128          hits = 1;
1129          if ((fl = csp->actions_list[i]) != NULL)
1130          {
1131             if ((b = fl->f) != NULL)
1132             {
1133                /* FIXME: Hardcoded HTML! */
1134                string_append(&matches, "<tr><th>In file: ");
1135                string_join  (&matches, html_encode(csp->config->actions_file_short[i]));
1136                snprintf(buf, 150, ".action <a class=\"cmd\" href=\"/show-status?file=actions&index=%d\">", i);
1137                string_append(&matches, buf);
1138                string_append(&matches, "View</a> <a class=\"cmd\" href=\"/edit-actions-list?f=");
1139                string_join  (&matches, html_encode(csp->config->actions_file_short[i]));
1140                string_append(&matches, "\">Edit</a></th></tr>\n");
1141
1142                hits = 0;
1143                b = b->next;
1144             }
1145          }
1146
1147          for (; (b != NULL) && (matches != NULL); b = b->next)
1148          {
1149             if (url_match(b->url, url_to_query))
1150             {
1151                string_append(&matches, "<tr><td>{");
1152                string_join  (&matches, actions_to_html(csp, b->action));
1153                string_append(&matches, " }</b><br>\n<code>");
1154                string_join  (&matches, html_encode(b->url->spec));
1155                string_append(&matches, "</code></td></tr>\n");
1156
1157                if (merge_current_action(action, b->action))
1158                {
1159                   freez(matches);
1160                   free_http_request(url_to_query);
1161                   free_current_action(action);
1162                   free_map(exports);
1163                   return JB_ERR_MEMORY;
1164                }
1165                hits++;
1166             }
1167          }
1168
1169          if (!hits)
1170          {
1171             string_append(&matches, "<tr><td>(no matches in this file)</td></tr>\n");
1172          }
1173       }
1174       string_append(&matches, "</table>\n");
1175
1176       free_http_request(url_to_query);
1177
1178       if (matches == NULL)
1179       {
1180          free_current_action(action);
1181          free_map(exports);
1182          return JB_ERR_MEMORY;
1183       }
1184
1185       if (map(exports, "matches", 1, matches , 0))
1186       {
1187          free_current_action(action);
1188          free_map(exports);
1189          return JB_ERR_MEMORY;
1190       }
1191
1192       s = current_action_to_html(csp, action);
1193
1194       free_current_action(action);
1195
1196       if (map(exports, "final", 1, s, 0))
1197       {
1198          free_map(exports);
1199          return JB_ERR_MEMORY;
1200       }
1201    }
1202
1203    return template_fill_for_cgi(csp, "show-url-info", exports, rsp);
1204 }
1205
1206
1207 /*********************************************************************
1208  *
1209  * Function    :  cgi_robots_txt
1210  *
1211  * Description :  CGI function to return "/robots.txt".
1212  *
1213  * Parameters  :
1214  *          1  :  csp = Current client state (buffers, headers, etc...)
1215  *          2  :  rsp = http_response data structure for output
1216  *          3  :  parameters = map of cgi parameters
1217  *
1218  * CGI Parameters : None
1219  *
1220  * Returns     :  JB_ERR_OK on success
1221  *                JB_ERR_MEMORY on out-of-memory error.  
1222  *
1223  *********************************************************************/
1224 jb_err cgi_robots_txt(struct client_state *csp,
1225                       struct http_response *rsp,
1226                       const struct map *parameters)
1227 {
1228    char buf[100];
1229    jb_err err;
1230
1231    rsp->body = strdup(
1232       "# This is the Privoxy control interface.\n"
1233       "# It isn't very useful to index it, and you're likely to break stuff.\n"
1234       "# So go away!\n"
1235       "\n"
1236       "User-agent: *\n"
1237       "Disallow: /\n"
1238       "\n");
1239    if (rsp->body == NULL)
1240    {
1241       return JB_ERR_MEMORY;
1242    }
1243
1244    err = enlist_unique(rsp->headers, "Content-Type: text/plain", 13);
1245
1246    rsp->is_static = 1;
1247
1248    get_http_time(7 * 24 * 60 * 60, buf); /* 7 days into future */
1249    if (!err) err = enlist_unique_header(rsp->headers, "Expires", buf);
1250
1251    return (err ? JB_ERR_MEMORY : JB_ERR_OK);
1252 }
1253
1254
1255 /*********************************************************************
1256  *
1257  * Function    :  show_defines
1258  *
1259  * Description :  Add to a map the state od all conditional #defines
1260  *                used when building
1261  *
1262  * Parameters  :
1263  *          1  :  exports = map to extend
1264  *
1265  * Returns     :  JB_ERR_OK on success
1266  *                JB_ERR_MEMORY on out-of-memory error.  
1267  *
1268  *********************************************************************/
1269 static jb_err show_defines(struct map *exports)
1270 {
1271    jb_err err = JB_ERR_OK;
1272
1273 #ifdef FEATURE_ACL
1274    if (!err) err = map_conditional(exports, "FEATURE_ACL", 1);
1275 #else /* ifndef FEATURE_ACL */
1276    if (!err) err = map_conditional(exports, "FEATURE_ACL", 0);
1277 #endif /* ndef FEATURE_ACL */
1278
1279 #ifdef FEATURE_CGI_EDIT_ACTIONS
1280    if (!err) err = map_conditional(exports, "FEATURE_CGI_EDIT_ACTIONS", 1);
1281 #else /* ifndef FEATURE_COOKIE_JAR */
1282    if (!err) err = map_conditional(exports, "FEATURE_CGI_EDIT_ACTIONS", 0);
1283 #endif /* ndef FEATURE_COOKIE_JAR */
1284
1285 #ifdef FEATURE_COOKIE_JAR
1286    if (!err) err = map_conditional(exports, "FEATURE_COOKIE_JAR", 1);
1287 #else /* ifndef FEATURE_COOKIE_JAR */
1288    if (!err) err = map_conditional(exports, "FEATURE_COOKIE_JAR", 0);
1289 #endif /* ndef FEATURE_COOKIE_JAR */
1290
1291 #ifdef FEATURE_FAST_REDIRECTS
1292    if (!err) err = map_conditional(exports, "FEATURE_FAST_REDIRECTS", 1);
1293 #else /* ifndef FEATURE_FAST_REDIRECTS */
1294    if (!err) err = map_conditional(exports, "FEATURE_FAST_REDIRECTS", 0);
1295 #endif /* ndef FEATURE_FAST_REDIRECTS */
1296
1297 #ifdef FEATURE_FORCE_LOAD
1298    if (!err) err = map_conditional(exports, "FEATURE_FORCE_LOAD", 1);
1299    if (!err) err = map(exports, "FORCE_PREFIX", 1, FORCE_PREFIX, 1);
1300 #else /* ifndef FEATURE_FORCE_LOAD */
1301    if (!err) err = map_conditional(exports, "FEATURE_FORCE_LOAD", 0);
1302    if (!err) err = map(exports, "FORCE_PREFIX", 1, "(none - disabled)", 1);
1303 #endif /* ndef FEATURE_FORCE_LOAD */
1304
1305 #ifdef FEATURE_IMAGE_BLOCKING
1306    if (!err) err = map_conditional(exports, "FEATURE_IMAGE_BLOCKING", 1);
1307 #else /* ifndef FEATURE_IMAGE_BLOCKING */
1308    if (!err) err = map_conditional(exports, "FEATURE_IMAGE_BLOCKING", 0);
1309 #endif /* ndef FEATURE_IMAGE_BLOCKING */
1310
1311 #ifdef FEATURE_IMAGE_DETECT_MSIE
1312    if (!err) err = map_conditional(exports, "FEATURE_IMAGE_DETECT_MSIE", 1);
1313 #else /* ifndef FEATURE_IMAGE_DETECT_MSIE */
1314    if (!err) err = map_conditional(exports, "FEATURE_IMAGE_DETECT_MSIE", 0);
1315 #endif /* ndef FEATURE_IMAGE_DETECT_MSIE */
1316
1317 #ifdef FEATURE_KILL_POPUPS
1318    if (!err) err = map_conditional(exports, "FEATURE_KILL_POPUPS", 1);
1319 #else /* ifndef FEATURE_KILL_POPUPS */
1320    if (!err) err = map_conditional(exports, "FEATURE_KILL_POPUPS", 0);
1321 #endif /* ndef FEATURE_KILL_POPUPS */
1322
1323 #ifdef FEATURE_NO_GIFS
1324    if (!err) err = map_conditional(exports, "FEATURE_NO_GIFS", 1);
1325 #else /* ifndef FEATURE_NO_GIFS */
1326    if (!err) err = map_conditional(exports, "FEATURE_NO_GIFS", 0);
1327 #endif /* ndef FEATURE_NO_GIFS */
1328
1329 #ifdef FEATURE_PTHREAD
1330    if (!err) err = map_conditional(exports, "FEATURE_PTHREAD", 1);
1331 #else /* ifndef FEATURE_PTHREAD */
1332    if (!err) err = map_conditional(exports, "FEATURE_PTHREAD", 0);
1333 #endif /* ndef FEATURE_PTHREAD */
1334
1335 #ifdef FEATURE_STATISTICS
1336    if (!err) err = map_conditional(exports, "FEATURE_STATISTICS", 1);
1337 #else /* ifndef FEATURE_STATISTICS */
1338    if (!err) err = map_conditional(exports, "FEATURE_STATISTICS", 0);
1339 #endif /* ndef FEATURE_STATISTICS */
1340
1341 #ifdef FEATURE_TOGGLE
1342    if (!err) err = map_conditional(exports, "FEATURE_TOGGLE", 1);
1343 #else /* ifndef FEATURE_TOGGLE */
1344    if (!err) err = map_conditional(exports, "FEATURE_TOGGLE", 0);
1345 #endif /* ndef FEATURE_TOGGLE */
1346
1347 #ifdef FEATURE_TRUST
1348    if (!err) err = map_conditional(exports, "FEATURE_TRUST", 1);
1349 #else /* ifndef FEATURE_TRUST */
1350    if (!err) err = map_conditional(exports, "FEATURE_TRUST", 0);
1351 #endif /* ndef FEATURE_TRUST */
1352
1353 #ifdef STATIC_PCRE
1354    if (!err) err = map_conditional(exports, "STATIC_PCRE", 1);
1355 #else /* ifndef STATIC_PCRE */
1356    if (!err) err = map_conditional(exports, "STATIC_PCRE", 0);
1357 #endif /* ndef STATIC_PCRE */
1358
1359 #ifdef STATIC_PCRS
1360    if (!err) err = map_conditional(exports, "STATIC_PCRS", 1);
1361 #else /* ifndef STATIC_PCRS */
1362    if (!err) err = map_conditional(exports, "STATIC_PCRS", 0);
1363 #endif /* ndef STATIC_PCRS */
1364
1365    return err;
1366 }
1367
1368
1369 /*********************************************************************
1370  *
1371  * Function    :  show_rcs
1372  *
1373  * Description :  Create a string with the rcs info for all sourcefiles
1374  *
1375  * Parameters  :  None
1376  *
1377  * Returns     :  A string, or NULL on out-of-memory.
1378  *
1379  *********************************************************************/
1380 static char *show_rcs(void)
1381 {
1382    char *result = strdup("");
1383    char buf[BUFFER_SIZE];
1384
1385    /* Instead of including *all* dot h's in the project (thus creating a
1386     * tremendous amount of dependencies), I will concede to declaring them
1387     * as extern's.  This forces the developer to add to this list, but oh well.
1388     */
1389
1390 #define SHOW_RCS(__x)              \
1391    {                               \
1392       extern const char __x[];     \
1393       sprintf(buf, "%s\n", __x);   \
1394       string_append(&result, buf); \
1395    }
1396
1397    /* In alphabetical order */
1398    SHOW_RCS(actions_h_rcs)
1399    SHOW_RCS(actions_rcs)
1400 #ifdef AMIGA
1401    SHOW_RCS(amiga_h_rcs)
1402    SHOW_RCS(amiga_rcs)
1403 #endif /* def AMIGA */
1404    SHOW_RCS(cgi_h_rcs)
1405    SHOW_RCS(cgi_rcs)
1406 #ifdef FEATURE_CGI_EDIT_ACTIONS
1407    SHOW_RCS(cgiedit_h_rcs)
1408    SHOW_RCS(cgiedit_rcs)
1409 #endif /* def FEATURE_CGI_EDIT_ACTIONS */
1410    SHOW_RCS(cgisimple_h_rcs)
1411    SHOW_RCS(cgisimple_rcs)
1412 #ifdef __MINGW32__
1413    SHOW_RCS(cygwin_h_rcs)
1414 #endif
1415    SHOW_RCS(deanimate_h_rcs)
1416    SHOW_RCS(deanimate_rcs)
1417    SHOW_RCS(encode_h_rcs)
1418    SHOW_RCS(encode_rcs)
1419    SHOW_RCS(errlog_h_rcs)
1420    SHOW_RCS(errlog_rcs)
1421    SHOW_RCS(filters_h_rcs)
1422    SHOW_RCS(filters_rcs)
1423    SHOW_RCS(gateway_h_rcs)
1424    SHOW_RCS(gateway_rcs)
1425    SHOW_RCS(jbsockets_h_rcs)
1426    SHOW_RCS(jbsockets_rcs)
1427    SHOW_RCS(jcc_h_rcs)
1428    SHOW_RCS(jcc_rcs)
1429 #ifdef FEATURE_KILL_POPUPS
1430    SHOW_RCS(killpopup_h_rcs)
1431    SHOW_RCS(killpopup_rcs)
1432 #endif /* def FEATURE_KILL_POPUPS */
1433    SHOW_RCS(list_h_rcs)
1434    SHOW_RCS(list_rcs)
1435    SHOW_RCS(loadcfg_h_rcs)
1436    SHOW_RCS(loadcfg_rcs)
1437    SHOW_RCS(loaders_h_rcs)
1438    SHOW_RCS(loaders_rcs)
1439    SHOW_RCS(miscutil_h_rcs)
1440    SHOW_RCS(miscutil_rcs)
1441    SHOW_RCS(parsers_h_rcs)
1442    SHOW_RCS(parsers_rcs)
1443    SHOW_RCS(pcrs_rcs)
1444    SHOW_RCS(pcrs_h_rcs)
1445    SHOW_RCS(project_h_rcs)
1446    SHOW_RCS(ssplit_h_rcs)
1447    SHOW_RCS(ssplit_rcs)
1448    SHOW_RCS(urlmatch_h_rcs)
1449    SHOW_RCS(urlmatch_rcs)
1450 #ifdef _WIN32
1451 #ifndef _WIN_CONSOLE
1452    SHOW_RCS(w32log_h_rcs)
1453    SHOW_RCS(w32log_rcs)
1454    SHOW_RCS(w32res_h_rcs)
1455    SHOW_RCS(w32taskbar_h_rcs)
1456    SHOW_RCS(w32taskbar_rcs)
1457 #endif /* ndef _WIN_CONSOLE */
1458    SHOW_RCS(win32_h_rcs)
1459    SHOW_RCS(win32_rcs)
1460 #endif /* def _WIN32 */
1461
1462 #undef SHOW_RCS
1463
1464    return result;
1465
1466 }
1467
1468
1469 /*
1470   Local Variables:
1471   tab-width: 3
1472   end:
1473 */