3 /*********************************************************************
5 * File : $Source: /cvsroot/ijbswa/current/jcc.h,v $
7 * Purpose : Main file. Contains main() method, main loop, and
8 * the main connection-handling function.
10 * Copyright : Written by and Copyright (C) 2001-2014 the
11 * Privoxy team. http://www.privoxy.org/
13 * Based on the Internet Junkbuster originally written
14 * by and Copyright (C) 1997 Anonymous Coders and
15 * Junkbusters Corporation. http://www.junkbusters.com
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.
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.
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.
35 *********************************************************************/
41 /* Global variables */
43 #ifdef FEATURE_STATISTICS
45 extern int urls_rejected;
46 #endif /*def FEATURE_STATISTICS*/
48 extern struct client_states clients[1];
49 extern struct file_list files[1];
52 extern const char *pidfile;
54 extern int daemon_mode;
56 #ifdef FEATURE_GRACEFUL_TERMINATION
57 extern int g_terminate;
60 #if defined(FEATURE_PTHREAD) || defined(_WIN32)
61 #define MUTEX_LOCKS_AVAILABLE
63 #ifdef FEATURE_PTHREAD
66 typedef pthread_mutex_t privoxy_mutex_t;
70 typedef CRITICAL_SECTION privoxy_mutex_t;
74 extern void privoxy_mutex_lock(privoxy_mutex_t *mutex);
75 extern void privoxy_mutex_unlock(privoxy_mutex_t *mutex);
77 extern privoxy_mutex_t log_mutex;
78 extern privoxy_mutex_t log_init_mutex;
79 extern privoxy_mutex_t connection_reuse_mutex;
81 #ifdef FEATURE_EXTERNAL_FILTERS
82 extern privoxy_mutex_t external_filter_mutex;
85 #ifdef FEATURE_CLIENT_TAGS
86 extern privoxy_mutex_t client_tags_mutex;
90 extern privoxy_mutex_t gmtime_mutex;
91 #endif /* ndef HAVE_GMTIME_R */
93 #ifndef HAVE_LOCALTIME_R
94 extern privoxy_mutex_t localtime_mutex;
95 #endif /* ndef HAVE_GMTIME_R */
97 #if !defined(HAVE_GETHOSTBYADDR_R) || !defined(HAVE_GETHOSTBYNAME_R)
98 extern privoxy_mutex_t resolver_mutex;
99 #endif /* !defined(HAVE_GETHOSTBYADDR_R) || !defined(HAVE_GETHOSTBYNAME_R) */
102 extern privoxy_mutex_t rand_mutex;
103 #endif /* ndef HAVE_RANDOM */
105 #endif /* FEATURE_PTHREAD */
110 int real_main(int argc, char **argv);
112 int main(int argc, char **argv);
116 extern int fuzz_client_request(struct client_state *csp, char *fuzz_input_file);
117 extern int fuzz_server_response(struct client_state *csp, char *fuzz_input_file);
118 extern int fuzz_chunked_transfer_encoding(struct client_state *csp, char *fuzz_input_file);
121 #endif /* ndef JCC_H_INCLUDED */