Tidying up memory allocation. New function init_action().
[privoxy.git] / loadcfg.h
1 #ifndef LOADCFG_H_INCLUDED
2 #define LOADCFG_H_INCLUDED
3 #define LOADCFG_H_VERSION "$Id: loadcfg.h,v 1.6 2001/07/29 18:58:15 jongfoster 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  *                IJBSWA team.  http://ijbswa.sourceforge.net
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.6  2001/07/29 18:58:15  jongfoster
41  *    Removing nested #includes, adding forward declarations for needed
42  *    structures, and changing the #define _FILENAME_H to FILENAME_H_INCLUDED.
43  *
44  *    Revision 1.5  2001/05/26 00:28:36  jongfoster
45  *    Automatic reloading of config file.
46  *    Removed obsolete SIGHUP support (Unix) and Reload menu option (Win32).
47  *    Most of the global variables have been moved to a new
48  *    struct configuration_spec, accessed through csp->config->globalname
49  *    Most of the globals remaining are used by the Win32 GUI.
50  *
51  *    Revision 1.4  2001/05/22 18:46:04  oes
52  *
53  *    - Enabled filtering banners by size rather than URL
54  *      by adding patterns that replace all standard banner
55  *      sizes with the "Junkbuster" gif to the re_filterfile
56  *
57  *    - Enabled filtering WebBugs by providing a pattern
58  *      which kills all 1x1 images
59  *
60  *    - Added support for PCRE_UNGREEDY behaviour to pcrs,
61  *      which is selected by the (nonstandard and therefore
62  *      capital) letter 'U' in the option string.
63  *      It causes the quantifiers to be ungreedy by default.
64  *      Appending a ? turns back to greedy (!).
65  *
66  *    - Added a new interceptor ijb-send-banner, which
67  *      sends back the "Junkbuster" gif. Without imagelist or
68  *      MSIE detection support, or if tinygif = 1, or the
69  *      URL isn't recognized as an imageurl, a lame HTML
70  *      explanation is sent instead.
71  *
72  *    - Added new feature, which permits blocking remote
73  *      script redirects and firing back a local redirect
74  *      to the browser.
75  *      The feature is conditionally compiled, i.e. it
76  *      can be disabled with --disable-fast-redirects,
77  *      plus it must be activated by a "fast-redirects"
78  *      line in the config file, has its own log level
79  *      and of course wants to be displayed by show-proxy-args
80  *      Note: Boy, all the #ifdefs in 1001 locations and
81  *      all the fumbling with configure.in and acconfig.h
82  *      were *way* more work than the feature itself :-(
83  *
84  *    - Because a generic redirect template was needed for
85  *      this, tinygif = 3 now uses the same.
86  *
87  *    - Moved GIFs, and other static HTTP response templates
88  *      to project.h
89  *
90  *    - Some minor fixes
91  *
92  *    - Removed some >400 CRs again (Jon, you really worked
93  *      a lot! ;-)
94  *
95  *    Revision 1.3  2001/05/20 01:21:20  jongfoster
96  *    Version 2.9.4 checkin.
97  *    - Merged popupfile and cookiefile, and added control over PCRS
98  *      filtering, in new "permissionsfile".
99  *    - Implemented LOG_LEVEL_FATAL, so that if there is a configuration
100  *      file error you now get a message box (in the Win32 GUI) rather
101  *      than the program exiting with no explanation.
102  *    - Made killpopup use the PCRS MIME-type checking and HTTP-header
103  *      skipping.
104  *    - Removed tabs from "config"
105  *    - Moved duplicated url parsing code in "loaders.c" to a new funcition.
106  *    - Bumped up version number.
107  *
108  *    Revision 1.2  2001/05/17 23:01:01  oes
109  *     - Cleaned CRLF's from the sources and related files
110  *
111  *    Revision 1.1.1.1  2001/05/15 13:58:58  oes
112  *    Initial import of version 2.9.3 source tree
113  *
114  *
115  *********************************************************************/
116 \f
117
118 #ifdef __cplusplus
119 extern "C" {
120 #endif
121
122 /* Don't need project.h, only this: */
123 struct configuration_spec;
124
125 /* Global variables */
126
127 #ifdef FEATURE_TOGGLE
128 /* indicates if ijb is enabled */
129 extern int g_bToggleIJB;
130 #endif /* def FEATURE_TOGGLE */
131
132 extern const char *configfile;
133
134
135 /* The load_config function is now going to call:
136  * init_proxy_args, so it will need argc and argv.
137  * Since load_config will also be a signal handler,
138  * we need to have these globally available.
139  */
140 extern int Argc;
141 extern const char **Argv;
142
143
144 extern struct configuration_spec * load_config(void);
145
146
147 /* Revision control strings from this header and associated .c file */
148 extern const char loadcfg_rcs[];
149 extern const char loadcfg_h_rcs[];
150
151 #ifdef __cplusplus
152 } /* extern "C" */
153 #endif
154
155 #endif /* ndef LOADCFG_H_INCLUDED */
156
157 /*
158   Local Variables:
159   tab-width: 3
160   end:
161 */