1 #ifndef CGISIMPLE_H_INCLUDED
2 #define CGISIMPLE_H_INCLUDED
3 #define CGISIMPLE_H_VERSION "$Id: cgisimple.h,v 1.15 2007/01/23 15:51:17 fabiankeil Exp $"
4 /*********************************************************************
6 * File : $Source: /cvsroot/ijbswa/current/cgisimple.h,v $
8 * Purpose : Declares functions to intercept request, generate
9 * html or gif answers, and to compose HTTP resonses.
11 * Functions declared include:
14 * Copyright : Written by and Copyright (C) 2001-2007 the SourceForge
15 * Privoxy team. http://www.privoxy.org/
17 * Based on the Internet Junkbuster originally written
18 * by and Copyright (C) 1997 Anonymous Coders and
19 * Junkbusters Corporation. http://www.junkbusters.com
21 * This program is free software; you can redistribute it
22 * and/or modify it under the terms of the GNU General
23 * Public License as published by the Free Software
24 * Foundation; either version 2 of the License, or (at
25 * your option) any later version.
27 * This program is distributed in the hope that it will
28 * be useful, but WITHOUT ANY WARRANTY; without even the
29 * implied warranty of MERCHANTABILITY or FITNESS FOR A
30 * PARTICULAR PURPOSE. See the GNU General Public
31 * License for more details.
33 * The GNU General Public License should be included with
34 * this file. If not, you can view it at
35 * http://www.gnu.org/copyleft/gpl.html
36 * or write to the Free Software Foundation, Inc., 59
37 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
40 * $Log: cgisimple.h,v $
41 * Revision 1.15 2007/01/23 15:51:17 fabiankeil
42 * Add favicon delivery functions.
44 * Revision 1.14 2006/09/06 18:45:03 fabiankeil
45 * Incorporate modified version of Roland Rosenfeld's patch to
46 * optionally access the user-manual via Privoxy. Closes patch 679075.
48 * Formatting changed to Privoxy style, added call to
49 * cgi_error_no_template if the requested file doesn't
50 * exist and modified check whether or not Privoxy itself
51 * should serve the manual. Should work cross-platform now.
53 * Revision 1.13 2006/07/18 14:48:45 david__schmidt
54 * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
55 * with what was really the latest development (the v_3_0_branch branch)
57 * Revision 1.11 2002/04/05 15:50:53 oes
58 * added send-stylesheet CGI
60 * Revision 1.10 2002/03/26 22:29:54 swa
61 * we have a new homepage!
63 * Revision 1.9 2002/03/24 13:25:43 swa
64 * name change related issues
66 * Revision 1.8 2002/03/16 23:54:06 jongfoster
67 * Adding graceful termination feature, to help look for memory leaks.
68 * If you enable this (which, by design, has to be done by hand
69 * editing config.h) and then go to http://i.j.b/die, then the program
70 * will exit cleanly after the *next* request. It should free all the
71 * memory that was used.
73 * Revision 1.7 2002/03/08 16:43:59 oes
74 * Renamed cgi_transparent_png to cgi_transparent_image
76 * Revision 1.6 2002/03/07 03:48:59 oes
77 * - Changed built-in images from GIF to PNG
78 * (with regard to Unisys patent issue)
80 * Revision 1.5 2002/01/22 23:26:03 jongfoster
81 * Adding cgi_transparent_gif() for http://i.j.b/t
83 * Revision 1.4 2001/10/23 21:48:19 jongfoster
84 * Cleaning up error handling in CGI functions - they now send back
85 * a HTML error page and should never cause a FATAL error. (Fixes one
86 * potential source of "denial of service" attacks).
88 * CGI actions file editor that works and is actually useful.
90 * Ability to toggle JunkBuster remotely using a CGI call.
92 * You can turn off both the above features in the main configuration
93 * file, e.g. if you are running a multi-user proxy.
95 * Revision 1.3 2001/10/14 22:00:32 jongfoster
96 * Adding support for a 404 error when an invalid CGI page is requested.
98 * Revision 1.2 2001/10/02 15:31:20 oes
99 * Introduced show-request cgi
101 * Revision 1.1 2001/09/16 17:08:54 jongfoster
102 * Moving simple CGI functions from cgi.c to new file cgisimple.c
105 **********************************************************************/
117 extern jb_err cgi_default (struct client_state *csp,
118 struct http_response *rsp,
119 const struct map *parameters);
120 extern jb_err cgi_error_404 (struct client_state *csp,
121 struct http_response *rsp,
122 const struct map *parameters);
123 extern jb_err cgi_robots_txt (struct client_state *csp,
124 struct http_response *rsp,
125 const struct map *parameters);
126 extern jb_err cgi_send_banner (struct client_state *csp,
127 struct http_response *rsp,
128 const struct map *parameters);
129 extern jb_err cgi_show_status (struct client_state *csp,
130 struct http_response *rsp,
131 const struct map *parameters);
132 extern jb_err cgi_show_url_info(struct client_state *csp,
133 struct http_response *rsp,
134 const struct map *parameters);
135 extern jb_err cgi_show_version (struct client_state *csp,
136 struct http_response *rsp,
137 const struct map *parameters);
138 extern jb_err cgi_show_request (struct client_state *csp,
139 struct http_response *rsp,
140 const struct map *parameters);
141 extern jb_err cgi_transparent_image (struct client_state *csp,
142 struct http_response *rsp,
143 const struct map *parameters);
144 extern jb_err cgi_send_error_favicon (struct client_state *csp,
145 struct http_response *rsp,
146 const struct map *parameters);
147 extern jb_err cgi_send_default_favicon (struct client_state *csp,
148 struct http_response *rsp,
149 const struct map *parameters);
150 extern jb_err cgi_send_stylesheet(struct client_state *csp,
151 struct http_response *rsp,
152 const struct map *parameters);
153 extern jb_err cgi_send_url_info_osd(struct client_state *csp,
154 struct http_response *rsp,
155 const struct map *parameters);
156 extern jb_err cgi_send_user_manual(struct client_state *csp,
157 struct http_response *rsp,
158 const struct map *parameters);
161 #ifdef FEATURE_GRACEFUL_TERMINATION
162 extern jb_err cgi_die (struct client_state *csp,
163 struct http_response *rsp,
164 const struct map *parameters);
167 /* Revision control strings from this header and associated .c file */
168 extern const char cgisimple_rcs[];
169 extern const char cgisimple_h_rcs[];
175 #endif /* ndef CGISIMPLE_H_INCLUDED */