- New function add_help_link
[privoxy.git] / loadcfg.h
1 #ifndef LOADCFG_H_INCLUDED
2 #define LOADCFG_H_INCLUDED
3 #define LOADCFG_H_VERSION "$Id: loadcfg.h,v 1.10 2002/03/24 13:25:43 swa Exp $"
4 /*********************************************************************
5  *
6  * File        :  $Source: /cvsroot/ijbswa/current/loadcfg.h,v $
7  *
8  * Purpose     :  Loads settings from the configuration file into
9  *                global variables.  This file contains both the 
10  *                routine to load the configuration and the global
11  *                variables it writes to.
12  *
13  * Copyright   :  Written by and Copyright (C) 2001 the SourceForge
14  *                Privoxy team. http://www.privoxy.org/
15  *
16  *                Based on the Internet Junkbuster originally written
17  *                by and Copyright (C) 1997 Anonymous Coders and 
18  *                Junkbusters Corporation.  http://www.junkbusters.com
19  *
20  *                This program is free software; you can redistribute it 
21  *                and/or modify it under the terms of the GNU General
22  *                Public License as published by the Free Software
23  *                Foundation; either version 2 of the License, or (at
24  *                your option) any later version.
25  *
26  *                This program is distributed in the hope that it will
27  *                be useful, but WITHOUT ANY WARRANTY; without even the
28  *                implied warranty of MERCHANTABILITY or FITNESS FOR A
29  *                PARTICULAR PURPOSE.  See the GNU General Public
30  *                License for more details.
31  *
32  *                The GNU General Public License should be included with
33  *                this file.  If not, you can view it at
34  *                http://www.gnu.org/copyleft/gpl.html
35  *                or write to the Free Software Foundation, Inc., 59
36  *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
37  *
38  * Revisions   :
39  *    $Log: loadcfg.h,v $
40  *    Revision 1.10  2002/03/24 13:25:43  swa
41  *    name change related issues
42  *
43  *    Revision 1.9  2002/03/16 23:54:06  jongfoster
44  *    Adding graceful termination feature, to help look for memory leaks.
45  *    If you enable this (which, by design, has to be done by hand
46  *    editing config.h) and then go to http://i.j.b/die, then the program
47  *    will exit cleanly after the *next* request.  It should free all the
48  *    memory that was used.
49  *
50  *    Revision 1.8  2001/12/30 14:07:32  steudten
51  *    - Add signal handling (unix)
52  *    - Add SIGHUP handler (unix)
53  *    - Add creation of pidfile (unix)
54  *    - Add action 'top' in rc file (RH)
55  *    - Add entry 'SIGNALS' to manpage
56  *    - Add exit message to logfile (unix)
57  *
58  *    Revision 1.7  2001/07/30 22:08:36  jongfoster
59  *    Tidying up #defines:
60  *    - All feature #defines are now of the form FEATURE_xxx
61  *    - Permanently turned off WIN_GUI_EDIT
62  *    - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS
63  *
64  *    Revision 1.6  2001/07/29 18:58:15  jongfoster
65  *    Removing nested #includes, adding forward declarations for needed
66  *    structures, and changing the #define _FILENAME_H to FILENAME_H_INCLUDED.
67  *
68  *    Revision 1.5  2001/05/26 00:28:36  jongfoster
69  *    Automatic reloading of config file.
70  *    Removed obsolete SIGHUP support (Unix) and Reload menu option (Win32).
71  *    Most of the global variables have been moved to a new
72  *    struct configuration_spec, accessed through csp->config->globalname
73  *    Most of the globals remaining are used by the Win32 GUI.
74  *
75  *    Revision 1.4  2001/05/22 18:46:04  oes
76  *
77  *    - Enabled filtering banners by size rather than URL
78  *      by adding patterns that replace all standard banner
79  *      sizes with the "Junkbuster" gif to the re_filterfile
80  *
81  *    - Enabled filtering WebBugs by providing a pattern
82  *      which kills all 1x1 images
83  *
84  *    - Added support for PCRE_UNGREEDY behaviour to pcrs,
85  *      which is selected by the (nonstandard and therefore
86  *      capital) letter 'U' in the option string.
87  *      It causes the quantifiers to be ungreedy by default.
88  *      Appending a ? turns back to greedy (!).
89  *
90  *    - Added a new interceptor ijb-send-banner, which
91  *      sends back the "Junkbuster" gif. Without imagelist or
92  *      MSIE detection support, or if tinygif = 1, or the
93  *      URL isn't recognized as an imageurl, a lame HTML
94  *      explanation is sent instead.
95  *
96  *    - Added new feature, which permits blocking remote
97  *      script redirects and firing back a local redirect
98  *      to the browser.
99  *      The feature is conditionally compiled, i.e. it
100  *      can be disabled with --disable-fast-redirects,
101  *      plus it must be activated by a "fast-redirects"
102  *      line in the config file, has its own log level
103  *      and of course wants to be displayed by show-proxy-args
104  *      Note: Boy, all the #ifdefs in 1001 locations and
105  *      all the fumbling with configure.in and acconfig.h
106  *      were *way* more work than the feature itself :-(
107  *
108  *    - Because a generic redirect template was needed for
109  *      this, tinygif = 3 now uses the same.
110  *
111  *    - Moved GIFs, and other static HTTP response templates
112  *      to project.h
113  *
114  *    - Some minor fixes
115  *
116  *    - Removed some >400 CRs again (Jon, you really worked
117  *      a lot! ;-)
118  *
119  *    Revision 1.3  2001/05/20 01:21:20  jongfoster
120  *    Version 2.9.4 checkin.
121  *    - Merged popupfile and cookiefile, and added control over PCRS
122  *      filtering, in new "permissionsfile".
123  *    - Implemented LOG_LEVEL_FATAL, so that if there is a configuration
124  *      file error you now get a message box (in the Win32 GUI) rather
125  *      than the program exiting with no explanation.
126  *    - Made killpopup use the PCRS MIME-type checking and HTTP-header
127  *      skipping.
128  *    - Removed tabs from "config"
129  *    - Moved duplicated url parsing code in "loaders.c" to a new funcition.
130  *    - Bumped up version number.
131  *
132  *    Revision 1.2  2001/05/17 23:01:01  oes
133  *     - Cleaned CRLF's from the sources and related files
134  *
135  *    Revision 1.1.1.1  2001/05/15 13:58:58  oes
136  *    Initial import of version 2.9.3 source tree
137  *
138  *
139  *********************************************************************/
140 \f
141
142 #ifdef __cplusplus
143 extern "C" {
144 #endif
145
146 /* Don't need project.h, only this: */
147 struct configuration_spec;
148
149 /* Global variables */
150
151 #ifdef FEATURE_TOGGLE
152 /* indicates if ijb is enabled */
153 extern int g_bToggleIJB;
154 #endif /* def FEATURE_TOGGLE */
155
156 extern const char *configfile;
157
158
159 /* The load_config function is now going to call:
160  * init_proxy_args, so it will need argc and argv.
161  * Since load_config will also be a signal handler,
162  * we need to have these globally available.
163  */
164 extern int Argc;
165 extern const char **Argv;
166 extern short int MustReload;
167
168
169 extern struct configuration_spec * load_config(void);
170
171 #ifdef FEATURE_GRACEFUL_TERMINATION
172 void unload_current_config_file(void);
173 #endif
174
175 /* Revision control strings from this header and associated .c file */
176 extern const char loadcfg_rcs[];
177 extern const char loadcfg_h_rcs[];
178
179 #ifdef __cplusplus
180 } /* extern "C" */
181 #endif
182
183 #endif /* ndef LOADCFG_H_INCLUDED */
184
185 /*
186   Local Variables:
187   tab-width: 3
188   end:
189 */