Add a missing space
[privoxy.git] / loaders.h
1 #ifndef LOADERS_H_INCLUDED
2 #define LOADERS_H_INCLUDED
3 /*********************************************************************
4  *
5  * File        :  $Source: /cvsroot/ijbswa/current/loaders.h,v $
6  *
7  * Purpose     :  Functions to load and unload the various
8  *                configuration files.  Also contains code to manage
9  *                the list of active loaders, and to automatically
10  *                unload files that are no longer in use.
11  *
12  * Copyright   :  Written by and Copyright (C) 2001-2010 the
13  *                Privoxy team. http://www.privoxy.org/
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  *********************************************************************/
38
39
40 extern unsigned int sweep(void);
41 extern void free_csp_resources(struct client_state *csp);
42 extern char *read_config_line(FILE *fp, unsigned long *linenum, char **buf);
43 extern int check_file_changed(const struct file_list * current,
44                               const char * filename,
45                               struct file_list ** newfl);
46
47 extern jb_err edit_read_line(FILE *fp,
48                              char **raw_out,
49                              char **prefix_out,
50                              char **data_out,
51                              int *newline,
52                              unsigned long *line_number);
53
54 extern jb_err simple_read_line(FILE *fp, char **dest, int *newline);
55
56 /*
57  * Various types of newlines that a file may contain.
58  */
59 #define NEWLINE_UNKNOWN 0  /* Newline convention in file is unknown */
60 #define NEWLINE_UNIX    1  /* Newline convention in file is '\n'   (ASCII 10) */
61 #define NEWLINE_DOS     2  /* Newline convention in file is '\r\n' (ASCII 13,10) */
62 #define NEWLINE_MAC     3  /* Newline convention in file is '\r'   (ASCII 13) */
63
64 /*
65  * Types of newlines that a file may contain, as strings.  If you have an
66  * extremely weird compiler that does not have '\r' == CR == ASCII 13 and
67  * '\n' == LF == ASCII 10), then fix CHAR_CR and CHAR_LF in loaders.c as
68  * well as these definitions.
69  */
70 #define NEWLINE(style) ((style)==NEWLINE_DOS ? "\r\n" : \
71                         ((style)==NEWLINE_MAC ? "\r" : "\n"))
72
73
74 extern short int MustReload;
75 extern int load_action_files(struct client_state *csp);
76 extern int load_re_filterfiles(struct client_state *csp);
77 #ifdef FUZZ
78 extern int load_one_re_filterfile(struct client_state *csp, int fileid);
79 #endif
80
81 #ifdef FEATURE_TRUST
82 extern int load_trustfile(struct client_state *csp);
83 #endif /* def FEATURE_TRUST */
84
85 #ifdef FEATURE_GRACEFUL_TERMINATION
86 #ifdef FEATURE_TRUST
87 void unload_current_trust_file(void);
88 #endif
89 void unload_current_re_filterfile(void);
90 #endif /* FEATURE_GRACEFUL_TERMINATION */
91
92 void unload_forward_spec(struct forward_spec *fwd);
93
94 extern void add_loader(int (*loader)(struct client_state *),
95                        struct configuration_spec * config);
96 extern int run_loader(struct client_state *csp);
97
98 extern int any_loaded_file_changed(const struct client_state *csp);
99
100 #endif /* ndef LOADERS_H_INCLUDED */
101
102 /*
103   Local Variables:
104   tab-width: 3
105   end:
106 */