Introduced show-request cgi
[privoxy.git] / cgisimple.c
1 const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.3 2001/09/22 16:34:44 jongfoster Exp $";
2 /*********************************************************************
3  *
4  * File        :  $Source: /cvsroot/ijbswa/current/cgisimple.c,v $
5  *
6  * Purpose     :  Simple CGIs to get information about JunkBuster's
7  *                status.
8  *                
9  *                Functions declared include:
10  * 
11  *
12  * Copyright   :  Written by and Copyright (C) 2001 the SourceForge
13  *                IJBSWA team.  http://ijbswa.sourceforge.net
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.3  2001/09/22 16:34:44  jongfoster
40  *    Removing unneeded #includes
41  *
42  *    Revision 1.2  2001/09/19 18:01:11  oes
43  *    Fixed comments; cosmetics
44  *
45  *    Revision 1.1  2001/09/16 17:08:54  jongfoster
46  *    Moving simple CGI functions from cgi.c to new file cgisimple.c
47  *
48  *
49  **********************************************************************/
50 \f
51
52 #include "config.h"
53
54 #include <stdio.h>
55 #include <sys/types.h>
56 #include <stdlib.h>
57 #include <ctype.h>
58 #include <string.h>
59 #include <assert.h>
60
61 #ifdef _WIN32
62 #define snprintf _snprintf
63 #endif /* def _WIN32 */
64
65 #include "project.h"
66 #include "cgi.h"
67 #include "cgisimple.h"
68 #include "list.h"
69 #include "encode.h"
70 #include "jcc.h"
71 #include "filters.h"
72 #include "actions.h"
73 #include "miscutil.h"
74 #include "loadcfg.h"
75 #include "parsers.h"
76
77 const char cgisimple_h_rcs[] = CGISIMPLE_H_VERSION;
78
79
80 static char *show_rcs(void);
81 static void show_defines(struct map *exports);
82
83
84 /*********************************************************************
85  *
86  * Function    :  cgi_default
87  *
88  * Description :  CGI function that is called if no action was given.
89  *                Lists menu of available unhidden CGIs.
90  *               
91  * Parameters  :
92  *           1 :  csp = Current client state (buffers, headers, etc...)
93  *           2 :  rsp = http_response data structure for output
94  *           3 :  parameters = map of cgi parameters
95  *
96  * Returns     :  0
97  *
98  *********************************************************************/
99 int cgi_default(struct client_state *csp, struct http_response *rsp,
100                 struct map *parameters)
101 {
102    char *p;
103    char *tmp = NULL;
104    struct map *exports = default_exports(csp, "");
105
106    /* If there were other parameters, export a dump as "cgi-parameters" */
107    if(parameters)
108    {
109       p = dump_map(parameters);
110       tmp = strsav(tmp, "<p>What made you think this cgi takes parameters?\n"
111                         "Anyway, here they are, in case you're interested:</p>\n");
112       tmp = strsav(tmp, p);
113       map(exports, "cgi-parameters", 1, tmp, 0);
114       free(p);
115    }
116    else
117    {
118       map(exports, "cgi-parameters", 1, "", 1);
119    }
120
121    rsp->body = template_load(csp, "default");
122    template_fill(&rsp->body, exports);
123    free_map(exports);
124    return(0);
125
126 }
127
128
129 /*********************************************************************
130  *
131  * Function    :  cgi_show_request
132  *
133  * Description :  Show the client's request and what sed() would have
134  *                made of it.
135  *               
136  * Parameters  :
137  *           1 :  csp = Current client state (buffers, headers, etc...)
138  *           2 :  rsp = http_response data structure for output
139  *           3 :  parameters = map of cgi parameters
140  *
141  * Returns     :  0
142  *
143  *********************************************************************/
144 int cgi_show_request(struct client_state *csp, struct http_response *rsp,
145                 struct map *parameters)
146 {
147    char *p;
148    struct map *exports = default_exports(csp, "show-request");
149    
150    /*
151     * Repair the damage done to the IOB by get_header()
152     */
153    for (p = csp->iob->buf; p < csp->iob->eod; p++)
154    {
155       if (*p == '\0') *p = '\n';
156    }
157
158    /*
159     * Export the original client's request and the one we would
160     * be sending to the server if this wasn't a CGI call
161     */
162    map(exports, "client-request", 1, csp->iob->buf, 1);
163    map(exports, "processed-request", 1, sed(client_patterns, add_client_headers, csp), 0);
164    
165    rsp->body = template_load(csp, "show-request");
166    template_fill(&rsp->body, exports);
167    free_map(exports);
168    return(0);
169  
170 }
171
172
173 /*********************************************************************
174  *
175  * Function    :  cgi_send_banner
176  *
177  * Description :  CGI function that returns a banner. 
178  *
179  * Parameters  :
180  *           1 :  csp = Current client state (buffers, headers, etc...)
181  *           2 :  rsp = http_response data structure for output
182  *           3 :  parameters = map of cgi parameters
183  *
184  * CGI Parameters :
185  *           type : Selects the type of banner between "trans" and "jb".
186  *                  Defaults to "jb" if absent or != "trans".
187  *
188  * Returns     :  0
189  *
190  *********************************************************************/
191 int cgi_send_banner(struct client_state *csp, struct http_response *rsp,
192                     struct map *parameters)
193 {
194    if(strcmp(lookup(parameters, "type"), "trans"))
195    {
196       rsp->body = bindup(image_junkbuster_gif_data, image_junkbuster_gif_length);
197       rsp->content_length = image_junkbuster_gif_length;
198    }
199    else
200    {
201       rsp->body = bindup(image_blank_gif_data, image_blank_gif_length);
202       rsp->content_length = image_blank_gif_length;
203    }   
204
205    enlist(rsp->headers, "Content-Type: image/gif");
206    rsp->is_static = 1;
207
208    return(0);
209
210 }
211
212
213 /*********************************************************************
214  *
215  * Function    :  cgi_show_version
216  *
217  * Description :  CGI function that returns a a web page describing the
218  *                file versions of IJB.
219  *
220  * Parameters  :
221  *           1 :  csp = Current client state (buffers, headers, etc...)
222  *           2 :  rsp = http_response data structure for output
223  *           3 :  parameters = map of cgi parameters
224  *
225  * CGI Parameters : none
226  *
227  * Returns     :  0
228  *
229  *********************************************************************/
230 int cgi_show_version(struct client_state *csp, struct http_response *rsp,
231                      struct map *parameters)
232 {
233    struct map * exports = default_exports(csp, "show-version");
234
235    map(exports, "sourceversions", 1, show_rcs(), 0);  
236
237    rsp->body = template_load(csp, "show-version");
238    template_fill(&rsp->body, exports);
239    free_map(exports);
240
241    return(0);
242
243 }
244
245  
246 /*********************************************************************
247  *
248  * Function    :  cgi_show_status
249  *
250  * Description :  CGI function that returns a a web page describing the
251  *                current status of IJB.
252  *
253  * Parameters  :
254  *           1 :  csp = Current client state (buffers, headers, etc...)
255  *           2 :  rsp = http_response data structure for output
256  *           3 :  parameters = map of cgi parameters
257  *
258  * CGI Parameters : none
259  *
260  * Returns     :  0
261  *
262  *********************************************************************/
263 int cgi_show_status(struct client_state *csp, struct http_response *rsp,
264                     struct map *parameters)
265 {
266    char *s = NULL;
267    int i;
268
269    FILE * fp;
270    char buf[BUFFER_SIZE];
271    char * p;
272    const char * filename = NULL;
273    char * file_description = NULL;
274 #ifdef FEATURE_STATISTICS
275    float perc_rej;   /* Percentage of http requests rejected */
276    int local_urls_read;
277    int local_urls_rejected;
278 #endif /* ndef FEATURE_STATISTICS */
279
280    struct map * exports = default_exports(csp, "show-status");
281
282    switch (*(lookup(parameters, "file")))
283    {
284    case 'p':
285       if (csp->actions_list)
286       {
287          filename = csp->actions_list->filename;
288          file_description = "Actions List";
289       }
290       break;
291
292    case 'r':
293       if (csp->rlist)
294       {
295          filename = csp->rlist->filename;
296          file_description = "Regex Filter List";
297       }
298       break;
299
300 #ifdef FEATURE_TRUST
301    case 't':
302       if (csp->tlist)
303       {
304          filename = csp->tlist->filename;
305          file_description = "Trust List";
306       }
307       break;
308 #endif /* def FEATURE_TRUST */
309    }
310
311    if (NULL != filename)
312    {
313       map(exports, "file-description", 1, file_description, 1);
314       map(exports, "filepath", 1, html_encode(filename), 0);
315
316       if ((fp = fopen(filename, "r")) == NULL)
317       {
318          map(exports, "content", 1, "<h1>ERROR OPENING FILE!</h1>", 1);
319       }
320       else
321       {
322          while (fgets(buf, sizeof(buf), fp))
323          {
324             p = html_encode(buf);
325             if (p)
326             {
327                s = strsav(s, p);
328                freez(p);
329                s = strsav(s, "<br>");
330             }
331          }
332          fclose(fp);
333          map(exports, "contents", 1, s, 0);
334       }
335       rsp->body = template_load(csp, "show-status-file");
336       template_fill(&rsp->body, exports);
337       free_map(exports);
338       return(0);
339
340    }
341
342    map(exports, "redirect-url", 1, REDIRECT_URL, 1);
343    
344    s = NULL;
345    for (i=0; i < Argc; i++)
346    {
347       s = strsav(s, Argv[i]);
348       s = strsav(s, " ");
349    }
350    map(exports, "invocation", 1, s, 0);
351
352    map(exports, "options", 1, csp->config->proxy_args, 1);
353    show_defines(exports);
354
355 #ifdef FEATURE_STATISTICS
356    local_urls_read     = urls_read;
357    local_urls_rejected = urls_rejected;
358
359    /*
360     * Need to alter the stats not to include the fetch of this
361     * page.
362     *
363     * Can't do following thread safely! doh!
364     *
365     * urls_read--;
366     * urls_rejected--; * This will be incremented subsequently *
367     */
368
369    if (local_urls_read == 0)
370    {
371       map_block_killer(exports, "have-stats");
372    }
373    else
374    {
375       map_block_killer(exports, "have-no-stats");
376
377       perc_rej = (float)local_urls_rejected * 100.0F /
378             (float)local_urls_read;
379
380       sprintf(buf, "%d", local_urls_read);
381       map(exports, "requests-received", 1, buf, 1);
382
383       sprintf(buf, "%d", local_urls_rejected);
384       map(exports, "requests-blocked", 1, buf, 1);
385
386       sprintf(buf, "%6.2f", perc_rej);
387       map(exports, "percent-blocked", 1, buf, 1);
388    }
389
390 #else /* ndef FEATURE_STATISTICS */
391    map_block_killer(exports, "statistics");
392 #endif /* ndef FEATURE_STATISTICS */
393
394    if (csp->actions_list)
395    {
396       map(exports, "actions-filename", 1,  csp->actions_list->filename, 1);
397    }
398    else
399    {
400       map(exports, "actions-filename", 1, "None specified", 1);
401    }
402
403    if (csp->rlist)
404    {
405       map(exports, "re-filter-filename", 1,  csp->rlist->filename, 1);
406    }
407    else
408    {
409       map(exports, "re-filter-filename", 1, "None specified", 1);
410    }
411
412 #ifdef FEATURE_TRUST
413    if (csp->tlist)
414    {
415       map(exports, "trust-filename", 1,  csp->tlist->filename, 1);
416    }
417    else
418    {
419        map(exports, "trust-filename", 1, "None specified", 1);
420    }
421 #else
422    map_block_killer(exports, "trust-support");
423 #endif /* ndef FEATURE_TRUST */
424
425    rsp->body = template_load(csp, "show-status");
426    template_fill(&rsp->body, exports);
427    free_map(exports);
428    return(0);
429
430 }
431
432  
433 /*********************************************************************
434  *
435  * Function    :  cgi_show_url_info
436  *
437  * Description :  CGI function that determines and shows which actions
438  *                junkbuster will perform for a given url, and which
439  *                matches starting from the defaults have lead to that.
440  *
441  * Parameters  :
442  *           1 :  csp = Current client state (buffers, headers, etc...)
443  *           2 :  rsp = http_response data structure for output
444  *           3 :  parameters = map of cgi parameters
445  *
446  * CGI Parameters :
447  *            url : The url whose actions are to be determined.
448  *                  If url is unset, the url-given conditional will be
449  *                  set, so that all but the form can be suppressed in
450  *                  the template.
451  *
452  * Returns     :  0
453  *
454  *********************************************************************/
455 int cgi_show_url_info(struct client_state *csp, struct http_response *rsp,
456                       struct map *parameters)
457 {
458    char *url_param;
459    char *host = NULL;
460    struct map * exports = default_exports(csp, "show-url-info");
461
462    if (NULL == (url_param = strdup(lookup(parameters, "url"))) || *url_param == '\0')
463    {
464       map_block_killer(exports, "url-given");
465       map(exports, "url", 1, "", 1);
466    }
467    else
468    {
469       char *matches = NULL;
470       char *path;
471       char *s;
472       int port = 80;
473       int hits = 0;
474       struct file_list *fl;
475       struct url_actions *b;
476       struct url_spec url[1];
477       struct current_action_spec action[1];
478       
479       host = url_param;
480       host += (strncmp(url_param, "http://", 7)) ? 0 : 7;
481
482       map(exports, "url", 1, host, 1);
483       map(exports, "url-html", 1, html_encode(host), 0);
484
485       init_current_action(action);
486
487       s = current_action_to_text(action);
488       map(exports, "default", 1, s , 0);
489
490       if (((fl = csp->actions_list) == NULL) || ((b = fl->f) == NULL))
491       {
492          map(exports, "matches", 1, "none" , 1);
493          map(exports, "final", 1, lookup(exports, "default"), 1);
494
495          freez(url_param);
496          free_current_action(action);
497
498          rsp->body = template_load(csp, "show-url-info");
499          template_fill(&rsp->body, exports);
500          free_map(exports);
501
502          return 0;
503       }
504
505       s = strchr(host, '/');
506       if (s != NULL)
507       {
508          path = strdup(s);
509          *s = '\0';
510       }
511       else
512       {
513          path = strdup("");
514       }
515       s = strchr(host, ':');
516       if (s != NULL)
517       {
518          *s++ = '\0';
519          port = atoi(s);
520          s = NULL;
521       }
522
523       *url = dsplit(host);
524
525       /* if splitting the domain fails, punt */
526       if (url->dbuf == NULL)
527       {
528          map(exports, "matches", 1, "none" , 1);
529          map(exports, "final", 1, lookup(exports, "default"), 1);
530
531          freez(url_param);
532          freez(path);
533          free_current_action(action);
534
535          rsp->body = template_load(csp, "show-url-info");
536          template_fill(&rsp->body, exports);
537          free_map(exports);
538
539          return 0;
540       }
541
542       for (b = b->next; NULL != b; b = b->next)
543       {
544          if ((b->url->port == 0) || (b->url->port == port))
545          {
546             if ((b->url->domain[0] == '\0') || (domaincmp(b->url, url) == 0))
547             {
548                if ((b->url->path == NULL) ||
549 #ifdef REGEX
550                   (regexec(b->url->preg, path, 0, NULL, 0) == 0)
551 #else
552                   (strncmp(b->url->path, path, b->url->pathlen) == 0)
553 #endif
554                )
555                {
556                   s = actions_to_text(b->action);
557                   matches = strsav(matches, "<b>{");
558                   matches = strsav(matches, s);
559                   matches = strsav(matches, " }</b><br>\n<code>");
560                   matches = strsav(matches, b->url->spec);
561                   matches = strsav(matches, "</code><br>\n<br>\n");
562                   freez(s);
563
564                   merge_current_action(action, b->action);
565                   hits++;
566                }
567             }
568          }
569       }
570
571       if (hits)
572       {
573          map(exports, "matches", 1, matches , 0);
574       }
575       else
576       {
577          map(exports, "matches", 1, "none", 1);
578       }
579       matches = NULL;
580
581       freez(url->dbuf);
582       freez(url->dvec);
583
584       freez(url_param);
585       freez(path);
586
587       s = current_action_to_text(action);
588       map(exports, "final", 1, s, 0);
589       s = NULL;
590
591       free_current_action(action);
592    }
593
594    rsp->body = template_load(csp, "show-url-info");
595    template_fill(&rsp->body, exports);
596    free_map(exports);
597    return 0;
598
599 }
600
601
602 /*********************************************************************
603  *
604  * Function    :  cgi_robots_txt
605  *
606  * Description :  CGI function to return "/robots.txt".
607  *
608  * Parameters  :
609  *           1 :  csp = Current client state (buffers, headers, etc...)
610  *           2 :  rsp = http_response data structure for output
611  *           3 :  parameters = map of cgi parameters
612  *
613  * CGI Parameters : None
614  *
615  * Returns     :  0
616  *
617  *********************************************************************/
618 int cgi_robots_txt(struct client_state *csp, struct http_response *rsp,
619                    struct map *parameters)
620 {
621    char buf[100];
622
623    rsp->body = strdup(
624       "# This is the Internet Junkbuster control interface.\n"
625       "# It isn't very useful to index it, and you're likely to break stuff.\n"
626       "# So go away!\n"
627       "\n"
628       "User-agent: *\n"
629       "Disallow: /\n"
630       "\n");
631
632    enlist_unique(rsp->headers, "Content-Type: text/plain", 13);
633
634    rsp->is_static = 1;
635
636    get_http_time(7 * 24 * 60 * 60, buf); /* 7 days into future */
637    enlist_unique_header(rsp->headers, "Expires", buf);
638
639    return 0;
640
641 }
642
643
644 /*********************************************************************
645  *
646  * Function    :  show_defines
647  *
648  * Description :  Create a string with all conditional #defines used
649  *                when building
650  *
651  * Parameters  :  None
652  *
653  * Returns     :  string 
654  *
655  *********************************************************************/
656 static void show_defines(struct map *exports)
657 {
658
659 #ifdef FEATURE_ACL
660    map_conditional(exports, "FEATURE_ACL", 1);
661 #else /* ifndef FEATURE_ACL */
662    map_conditional(exports, "FEATURE_ACL", 0);
663 #endif /* ndef FEATURE_ACL */
664
665 #ifdef FEATURE_COOKIE_JAR
666    map_conditional(exports, "FEATURE_COOKIE_JAR", 1);
667 #else /* ifndef FEATURE_COOKIE_JAR */
668    map_conditional(exports, "FEATURE_COOKIE_JAR", 0);
669 #endif /* ndef FEATURE_COOKIE_JAR */
670
671 #ifdef FEATURE_DENY_GZIP
672    map_conditional(exports, "FEATURE_DENY_GZIP", 1);
673 #else /* ifndef FEATURE_DENY_GZIP */
674    map_conditional(exports, "FEATURE_DENY_GZIP", 0);
675 #endif /* ndef FEATURE_DENY_GZIP */
676
677 #ifdef FEATURE_FAST_REDIRECTS
678    map_conditional(exports, "FEATURE_FAST_REDIRECTS", 1);
679 #else /* ifndef FEATURE_FAST_REDIRECTS */
680    map_conditional(exports, "FEATURE_FAST_REDIRECTS", 0);
681 #endif /* ndef FEATURE_FAST_REDIRECTS */
682
683 #ifdef FEATURE_FORCE_LOAD
684    map_conditional(exports, "FEATURE_FORCE_LOAD", 1);
685 #else /* ifndef FEATURE_FORCE_LOAD */
686    map_conditional(exports, "FEATURE_FORCE_LOAD", 0);
687 #endif /* ndef FEATURE_FORCE_LOAD */
688
689 #ifdef FEATURE_IMAGE_BLOCKING
690    map_conditional(exports, "FEATURE_IMAGE_BLOCKING", 1);
691 #else /* ifndef FEATURE_IMAGE_BLOCKING */
692    map_conditional(exports, "FEATURE_IMAGE_BLOCKING", 0);
693 #endif /* ndef FEATURE_IMAGE_BLOCKING */
694
695 #ifdef FEATURE_IMAGE_DETECT_MSIE
696    map_conditional(exports, "FEATURE_IMAGE_DETECT_MSIE", 1);
697 #else /* ifndef FEATURE_IMAGE_DETECT_MSIE */
698    map_conditional(exports, "FEATURE_IMAGE_DETECT_MSIE", 0);
699 #endif /* ndef FEATURE_IMAGE_DETECT_MSIE */
700
701 #ifdef FEATURE_KILL_POPUPS
702    map_conditional(exports, "FEATURE_KILL_POPUPS", 1);
703 #else /* ifndef FEATURE_KILL_POPUPS */
704    map_conditional(exports, "FEATURE_KILL_POPUPS", 0);
705 #endif /* ndef FEATURE_KILL_POPUPS */
706
707 #ifdef FEATURE_PTHREAD
708    map_conditional(exports, "FEATURE_PTHREAD", 1);
709 #else /* ifndef FEATURE_PTHREAD */
710    map_conditional(exports, "FEATURE_PTHREAD", 0);
711 #endif /* ndef FEATURE_PTHREAD */
712
713 #ifdef FEATURE_STATISTICS
714    map_conditional(exports, "FEATURE_STATISTICS", 1);
715 #else /* ifndef FEATURE_STATISTICS */
716    map_conditional(exports, "FEATURE_STATISTICS", 0);
717 #endif /* ndef FEATURE_STATISTICS */
718
719 #ifdef FEATURE_TOGGLE
720    map_conditional(exports, "FEATURE_TOGGLE", 1);
721 #else /* ifndef FEATURE_TOGGLE */
722    map_conditional(exports, "FEATURE_TOGGLE", 0);
723 #endif /* ndef FEATURE_TOGGLE */
724
725 #ifdef FEATURE_TRUST
726    map_conditional(exports, "FEATURE_TRUST", 1);
727 #else /* ifndef FEATURE_TRUST */
728    map_conditional(exports, "FEATURE_TRUST", 0);
729 #endif /* ndef FEATURE_TRUST */
730
731 #ifdef REGEX_GNU
732    map_conditional(exports, "REGEX_GNU", 1);
733 #else /* ifndef REGEX_GNU */
734    map_conditional(exports, "REGEX_GNU", 0);
735 #endif /* def REGEX_GNU */
736
737 #ifdef REGEX_PCRE
738    map_conditional(exports, "REGEX_PCRE", 1);
739 #else /* ifndef REGEX_PCRE */
740    map_conditional(exports, "REGEX_PCRE", 0);
741 #endif /* def REGEX_PCRE */
742
743 #ifdef STATIC_PCRE
744    map_conditional(exports, "STATIC_PCRE", 1);
745 #else /* ifndef STATIC_PCRE */
746    map_conditional(exports, "STATIC_PCRE", 0);
747 #endif /* ndef STATIC_PCRE */
748
749 #ifdef STATIC_PCRS
750    map_conditional(exports, "STATIC_PCRS", 1);
751 #else /* ifndef STATIC_PCRS */
752    map_conditional(exports, "STATIC_PCRS", 0);
753 #endif /* ndef STATIC_PCRS */
754
755    map(exports, "FORCE_PREFIX", 1, FORCE_PREFIX, 1);
756
757 }
758
759
760 /*********************************************************************
761  *
762  * Function    :  show_rcs
763  *
764  * Description :  Create a string with the rcs info for all sourcefiles
765  *
766  * Parameters  :  None
767  *
768  * Returns     :  string 
769  *
770  *********************************************************************/
771 static char *show_rcs(void)
772 {
773    char *b = NULL;
774    char buf[BUFFER_SIZE];
775
776    /* Instead of including *all* dot h's in the project (thus creating a
777     * tremendous amount of dependencies), I will concede to declaring them
778     * as extern's.  This forces the developer to add to this list, but oh well.
779     */
780
781 #define SHOW_RCS(__x)            \
782    {                             \
783       extern const char __x[];   \
784       sprintf(buf, "%s\n", __x); \
785       b = strsav(b, buf);        \
786    }
787
788    /* In alphabetical order */
789    SHOW_RCS(actions_h_rcs)
790    SHOW_RCS(actions_rcs)
791    SHOW_RCS(cgi_h_rcs)
792    SHOW_RCS(cgi_rcs)
793 #ifdef FEATURE_CGI_EDIT_ACTIONS
794    SHOW_RCS(cgiedit_h_rcs)
795    SHOW_RCS(cgiedit_rcs)
796 #endif /* def FEATURE_CGI_EDIT_ACTIONS */
797    SHOW_RCS(cgisimple_h_rcs)
798    SHOW_RCS(cgisimple_rcs)
799 #ifdef __MINGW32__
800    SHOW_RCS(cygwin_h_rcs)
801 #endif
802    SHOW_RCS(deanimate_h_rcs)
803    SHOW_RCS(deanimate_rcs)
804    SHOW_RCS(encode_h_rcs)
805    SHOW_RCS(encode_rcs)
806    SHOW_RCS(errlog_h_rcs)
807    SHOW_RCS(errlog_rcs)
808    SHOW_RCS(filters_h_rcs)
809    SHOW_RCS(filters_rcs)
810    SHOW_RCS(gateway_h_rcs)
811    SHOW_RCS(gateway_rcs)
812 #ifdef GNU_REGEX
813    SHOW_RCS(gnu_regex_h_rcs)
814    SHOW_RCS(gnu_regex_rcs)
815 #endif /* def GNU_REGEX */
816    SHOW_RCS(jbsockets_h_rcs)
817    SHOW_RCS(jbsockets_rcs)
818    SHOW_RCS(jcc_h_rcs)
819    SHOW_RCS(jcc_rcs)
820 #ifdef FEATURE_KILL_POPUPS
821    SHOW_RCS(killpopup_h_rcs)
822    SHOW_RCS(killpopup_rcs)
823 #endif /* def FEATURE_KILL_POPUPS */
824    SHOW_RCS(list_h_rcs)
825    SHOW_RCS(list_rcs)
826    SHOW_RCS(loadcfg_h_rcs)
827    SHOW_RCS(loadcfg_rcs)
828    SHOW_RCS(loaders_h_rcs)
829    SHOW_RCS(loaders_rcs)
830    SHOW_RCS(miscutil_h_rcs)
831    SHOW_RCS(miscutil_rcs)
832    SHOW_RCS(parsers_h_rcs)
833    SHOW_RCS(parsers_rcs)
834    SHOW_RCS(pcrs_rcs)
835    SHOW_RCS(pcrs_h_rcs)
836    SHOW_RCS(project_h_rcs)
837    SHOW_RCS(ssplit_h_rcs)
838    SHOW_RCS(ssplit_rcs)
839 #ifdef _WIN32
840 #ifndef _WIN_CONSOLE
841    SHOW_RCS(w32log_h_rcs)
842    SHOW_RCS(w32log_rcs)
843    SHOW_RCS(w32res_h_rcs)
844    SHOW_RCS(w32taskbar_h_rcs)
845    SHOW_RCS(w32taskbar_rcs)
846 #endif /* ndef _WIN_CONSOLE */
847    SHOW_RCS(win32_h_rcs)
848    SHOW_RCS(win32_rcs)
849 #endif /* def _WIN32 */
850
851 #undef SHOW_RCS
852
853    return(b);
854
855 }
856
857
858 /*
859   Local Variables:
860   tab-width: 3
861   end:
862 */