200 lines
7.3 KiB
C
200 lines
7.3 KiB
C
|
#ifndef LOADCFG_H_INCLUDED
|
|||
|
#define LOADCFG_H_INCLUDED
|
|||
|
#define LOADCFG_H_VERSION "$Id: loadcfg.h,v 1.13 2006/07/18 14:48:46 david__schmidt Exp $"
|
|||
|
/*********************************************************************
|
|||
|
*
|
|||
|
* File : $Source: /cvsroot/ijbswa/current/loadcfg.h,v $
|
|||
|
*
|
|||
|
* Purpose : Loads settings from the configuration file into
|
|||
|
* global variables. This file contains both the
|
|||
|
* routine to load the configuration and the global
|
|||
|
* variables it writes to.
|
|||
|
*
|
|||
|
* Copyright : Written by and Copyright (C) 2001 the SourceForge
|
|||
|
* Privoxy team. http://www.privoxy.org/
|
|||
|
*
|
|||
|
* Based on the Internet Junkbuster originally written
|
|||
|
* by and Copyright (C) 1997 Anonymous Coders and
|
|||
|
* Junkbusters Corporation. http://www.junkbusters.com
|
|||
|
*
|
|||
|
* This program is free software; you can redistribute it
|
|||
|
* and/or modify it under the terms of the GNU General
|
|||
|
* Public License as published by the Free Software
|
|||
|
* Foundation; either version 2 of the License, or (at
|
|||
|
* your option) any later version.
|
|||
|
*
|
|||
|
* This program is distributed in the hope that it will
|
|||
|
* be useful, but WITHOUT ANY WARRANTY; without even the
|
|||
|
* implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|||
|
* PARTICULAR PURPOSE. See the GNU General Public
|
|||
|
* License for more details.
|
|||
|
*
|
|||
|
* The GNU General Public License should be included with
|
|||
|
* this file. If not, you can view it at
|
|||
|
* http://www.gnu.org/copyleft/gpl.html
|
|||
|
* or write to the Free Software Foundation, Inc., 59
|
|||
|
* Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
*
|
|||
|
* Revisions :
|
|||
|
* $Log: loadcfg.h,v $
|
|||
|
* Revision 1.13 2006/07/18 14:48:46 david__schmidt
|
|||
|
* Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
|
|||
|
* with what was really the latest development (the v_3_0_branch branch)
|
|||
|
*
|
|||
|
* Revision 1.11.2.1 2003/03/11 11:53:59 oes
|
|||
|
* Cosmetic: Renamed cryptic variable
|
|||
|
*
|
|||
|
* Revision 1.11 2002/03/26 22:29:55 swa
|
|||
|
* we have a new homepage!
|
|||
|
*
|
|||
|
* Revision 1.10 2002/03/24 13:25:43 swa
|
|||
|
* name change related issues
|
|||
|
*
|
|||
|
* Revision 1.9 2002/03/16 23:54:06 jongfoster
|
|||
|
* Adding graceful termination feature, to help look for memory leaks.
|
|||
|
* If you enable this (which, by design, has to be done by hand
|
|||
|
* editing config.h) and then go to http://i.j.b/die, then the program
|
|||
|
* will exit cleanly after the *next* request. It should free all the
|
|||
|
* memory that was used.
|
|||
|
*
|
|||
|
* Revision 1.8 2001/12/30 14:07:32 steudten
|
|||
|
* - Add signal handling (unix)
|
|||
|
* - Add SIGHUP handler (unix)
|
|||
|
* - Add creation of pidfile (unix)
|
|||
|
* - Add action 'top' in rc file (RH)
|
|||
|
* - Add entry 'SIGNALS' to manpage
|
|||
|
* - Add exit message to logfile (unix)
|
|||
|
*
|
|||
|
* Revision 1.7 2001/07/30 22:08:36 jongfoster
|
|||
|
* Tidying up #defines:
|
|||
|
* - All feature #defines are now of the form FEATURE_xxx
|
|||
|
* - Permanently turned off WIN_GUI_EDIT
|
|||
|
* - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS
|
|||
|
*
|
|||
|
* Revision 1.6 2001/07/29 18:58:15 jongfoster
|
|||
|
* Removing nested #includes, adding forward declarations for needed
|
|||
|
* structures, and changing the #define _FILENAME_H to FILENAME_H_INCLUDED.
|
|||
|
*
|
|||
|
* Revision 1.5 2001/05/26 00:28:36 jongfoster
|
|||
|
* Automatic reloading of config file.
|
|||
|
* Removed obsolete SIGHUP support (Unix) and Reload menu option (Win32).
|
|||
|
* Most of the global variables have been moved to a new
|
|||
|
* struct configuration_spec, accessed through csp->config->globalname
|
|||
|
* Most of the globals remaining are used by the Win32 GUI.
|
|||
|
*
|
|||
|
* Revision 1.4 2001/05/22 18:46:04 oes
|
|||
|
*
|
|||
|
* - Enabled filtering banners by size rather than URL
|
|||
|
* by adding patterns that replace all standard banner
|
|||
|
* sizes with the "Junkbuster" gif to the re_filterfile
|
|||
|
*
|
|||
|
* - Enabled filtering WebBugs by providing a pattern
|
|||
|
* which kills all 1x1 images
|
|||
|
*
|
|||
|
* - Added support for PCRE_UNGREEDY behaviour to pcrs,
|
|||
|
* which is selected by the (nonstandard and therefore
|
|||
|
* capital) letter 'U' in the option string.
|
|||
|
* It causes the quantifiers to be ungreedy by default.
|
|||
|
* Appending a ? turns back to greedy (!).
|
|||
|
*
|
|||
|
* - Added a new interceptor ijb-send-banner, which
|
|||
|
* sends back the "Junkbuster" gif. Without imagelist or
|
|||
|
* MSIE detection support, or if tinygif = 1, or the
|
|||
|
* URL isn't recognized as an imageurl, a lame HTML
|
|||
|
* explanation is sent instead.
|
|||
|
*
|
|||
|
* - Added new feature, which permits blocking remote
|
|||
|
* script redirects and firing back a local redirect
|
|||
|
* to the browser.
|
|||
|
* The feature is conditionally compiled, i.e. it
|
|||
|
* can be disabled with --disable-fast-redirects,
|
|||
|
* plus it must be activated by a "fast-redirects"
|
|||
|
* line in the config file, has its own log level
|
|||
|
* and of course wants to be displayed by show-proxy-args
|
|||
|
* Note: Boy, all the #ifdefs in 1001 locations and
|
|||
|
* all the fumbling with configure.in and acconfig.h
|
|||
|
* were *way* more work than the feature itself :-(
|
|||
|
*
|
|||
|
* - Because a generic redirect template was needed for
|
|||
|
* this, tinygif = 3 now uses the same.
|
|||
|
*
|
|||
|
* - Moved GIFs, and other static HTTP response templates
|
|||
|
* to project.h
|
|||
|
*
|
|||
|
* - Some minor fixes
|
|||
|
*
|
|||
|
* - Removed some >400 CRs again (Jon, you really worked
|
|||
|
* a lot! ;-)
|
|||
|
*
|
|||
|
* Revision 1.3 2001/05/20 01:21:20 jongfoster
|
|||
|
* Version 2.9.4 checkin.
|
|||
|
* - Merged popupfile and cookiefile, and added control over PCRS
|
|||
|
* filtering, in new "permissionsfile".
|
|||
|
* - Implemented LOG_LEVEL_FATAL, so that if there is a configuration
|
|||
|
* file error you now get a message box (in the Win32 GUI) rather
|
|||
|
* than the program exiting with no explanation.
|
|||
|
* - Made killpopup use the PCRS MIME-type checking and HTTP-header
|
|||
|
* skipping.
|
|||
|
* - Removed tabs from "config"
|
|||
|
* - Moved duplicated url parsing code in "loaders.c" to a new funcition.
|
|||
|
* - Bumped up version number.
|
|||
|
*
|
|||
|
* Revision 1.2 2001/05/17 23:01:01 oes
|
|||
|
* - Cleaned CRLF's from the sources and related files
|
|||
|
*
|
|||
|
* Revision 1.1.1.1 2001/05/15 13:58:58 oes
|
|||
|
* Initial import of version 2.9.3 source tree
|
|||
|
*
|
|||
|
*
|
|||
|
*********************************************************************/
|
|||
|
|
|||
|
|
|||
|
#ifdef __cplusplus
|
|||
|
extern "C" {
|
|||
|
#endif
|
|||
|
|
|||
|
/* Don't need project.h, only this: */
|
|||
|
struct configuration_spec;
|
|||
|
|
|||
|
/* Global variables */
|
|||
|
|
|||
|
#ifdef FEATURE_TOGGLE
|
|||
|
/* Privoxy's toggle state */
|
|||
|
extern int global_toggle_state;
|
|||
|
#endif /* def FEATURE_TOGGLE */
|
|||
|
|
|||
|
extern const char *configfile;
|
|||
|
|
|||
|
|
|||
|
/* The load_config function is now going to call:
|
|||
|
* init_proxy_args, so it will need argc and argv.
|
|||
|
* Since load_config will also be a signal handler,
|
|||
|
* we need to have these globally available.
|
|||
|
*/
|
|||
|
extern int Argc;
|
|||
|
extern const char **Argv;
|
|||
|
extern short int MustReload;
|
|||
|
|
|||
|
|
|||
|
extern struct configuration_spec * load_config(void);
|
|||
|
|
|||
|
#ifdef FEATURE_GRACEFUL_TERMINATION
|
|||
|
void unload_current_config_file(void);
|
|||
|
#endif
|
|||
|
|
|||
|
/* Revision control strings from this header and associated .c file */
|
|||
|
extern const char loadcfg_rcs[];
|
|||
|
extern const char loadcfg_h_rcs[];
|
|||
|
|
|||
|
#ifdef __cplusplus
|
|||
|
} /* extern "C" */
|
|||
|
#endif
|
|||
|
|
|||
|
#endif /* ndef LOADCFG_H_INCLUDED */
|
|||
|
|
|||
|
/*
|
|||
|
Local Variables:
|
|||
|
tab-width: 3
|
|||
|
end:
|
|||
|
*/
|