uagen: Update Privoxy man page reference now that the section is 8
[privoxy.git] / jcc.h
1 #ifndef JCC_H_INCLUDED
2 #define JCC_H_INCLUDED
3 /*********************************************************************
4  *
5  * File        :  $Source: /cvsroot/ijbswa/current/jcc.h,v $
6  *
7  * Purpose     :  Main file.  Contains main() method, main loop, and
8  *                the main connection-handling function.
9  *
10  * Copyright   :  Written by and Copyright (C) 2001-2014 the
11  *                Privoxy team. https://www.privoxy.org/
12  *
13  *                Based on the Internet Junkbuster originally written
14  *                by and Copyright (C) 1997 Anonymous Coders and
15  *                Junkbusters Corporation.  http://www.junkbusters.com
16  *
17  *                This program is free software; you can redistribute it
18  *                and/or modify it under the terms of the GNU General
19  *                Public License as published by the Free Software
20  *                Foundation; either version 2 of the License, or (at
21  *                your option) any later version.
22  *
23  *                This program is distributed in the hope that it will
24  *                be useful, but WITHOUT ANY WARRANTY; without even the
25  *                implied warranty of MERCHANTABILITY or FITNESS FOR A
26  *                PARTICULAR PURPOSE.  See the GNU General Public
27  *                License for more details.
28  *
29  *                The GNU General Public License should be included with
30  *                this file.  If not, you can view it at
31  *                http://www.gnu.org/copyleft/gpl.html
32  *                or write to the Free Software Foundation, Inc., 59
33  *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
34  *
35  *********************************************************************/
36
37
38 struct client_state;
39 struct file_list;
40
41 /* Global variables */
42
43 #ifdef FEATURE_STATISTICS
44 extern int urls_read;
45 extern int urls_rejected;
46 #endif /*def FEATURE_STATISTICS*/
47
48 extern struct client_states clients[1];
49 extern struct file_list    files[1];
50
51 #ifdef unix
52 extern const char *pidfile;
53 #endif
54 extern int daemon_mode;
55
56 #ifdef FEATURE_GRACEFUL_TERMINATION
57 extern int g_terminate;
58 #endif
59
60 #if defined(FEATURE_PTHREAD) || defined(_WIN32)
61 #define MUTEX_LOCKS_AVAILABLE
62
63 #ifdef FEATURE_PTHREAD
64 #include <pthread.h>
65
66 typedef pthread_mutex_t privoxy_mutex_t;
67
68 #else
69
70 typedef CRITICAL_SECTION privoxy_mutex_t;
71
72 #endif
73
74 extern void privoxy_mutex_lock(privoxy_mutex_t *mutex);
75 extern void privoxy_mutex_unlock(privoxy_mutex_t *mutex);
76
77 extern privoxy_mutex_t log_mutex;
78 extern privoxy_mutex_t log_init_mutex;
79 extern privoxy_mutex_t connection_reuse_mutex;
80
81 #ifdef FEATURE_EXTERNAL_FILTERS
82 extern privoxy_mutex_t external_filter_mutex;
83 #endif
84
85 #ifdef FEATURE_CLIENT_TAGS
86 extern privoxy_mutex_t client_tags_mutex;
87 #endif
88
89 #ifdef FEATURE_EXTENDED_STATISTICS
90 extern privoxy_mutex_t filter_statistics_mutex;
91 extern privoxy_mutex_t block_statistics_mutex;
92 #endif
93
94 #ifndef HAVE_GMTIME_R
95 extern privoxy_mutex_t gmtime_mutex;
96 #endif /* ndef HAVE_GMTIME_R */
97
98 #ifndef HAVE_LOCALTIME_R
99 extern privoxy_mutex_t localtime_mutex;
100 #endif /* ndef HAVE_GMTIME_R */
101
102 #if !defined(HAVE_GETHOSTBYADDR_R) || !defined(HAVE_GETHOSTBYNAME_R)
103 extern privoxy_mutex_t resolver_mutex;
104 #endif /* !defined(HAVE_GETHOSTBYADDR_R) || !defined(HAVE_GETHOSTBYNAME_R) */
105
106 #ifndef HAVE_RANDOM
107 extern privoxy_mutex_t rand_mutex;
108 #endif /* ndef HAVE_RANDOM */
109
110 #ifdef FEATURE_HTTPS_INSPECTION
111 extern privoxy_mutex_t certificate_mutex;
112 extern privoxy_mutex_t ssl_init_mutex;
113 #endif
114
115 #endif /* FEATURE_PTHREAD */
116
117 /* Functions */
118
119 #ifdef __MINGW32__
120 int real_main(int argc, char **argv);
121 #else
122 int main(int argc, char **argv);
123 #endif
124
125 #ifdef FUZZ
126 extern int fuzz_client_request(struct client_state *csp, char *fuzz_input_file);
127 extern int fuzz_server_response(struct client_state *csp, char *fuzz_input_file);
128 extern int fuzz_chunked_transfer_encoding(struct client_state *csp, char *fuzz_input_file);
129 #endif
130
131 #endif /* ndef JCC_H_INCLUDED */
132
133 /*
134   Local Variables:
135   tab-width: 3
136   end:
137 */