3 #define JCC_H_VERSION "$Id: jcc.h,v 1.33 2013/11/24 14:23:28 fabiankeil Exp $"
4 /*********************************************************************
6 * File : $Source: /cvsroot/ijbswa/current/jcc.h,v $
8 * Purpose : Main file. Contains main() method, main loop, and
9 * the main connection-handling function.
11 * Copyright : Written by and Copyright (C) 2001-2006 the SourceForge
12 * Privoxy team. http://www.privoxy.org/
14 * Based on the Internet Junkbuster originally written
15 * by and Copyright (C) 1997 Anonymous Coders and
16 * Junkbusters Corporation. http://www.junkbusters.com
18 * This program is free software; you can redistribute it
19 * and/or modify it under the terms of the GNU General
20 * Public License as published by the Free Software
21 * Foundation; either version 2 of the License, or (at
22 * your option) any later version.
24 * This program is distributed in the hope that it will
25 * be useful, but WITHOUT ANY WARRANTY; without even the
26 * implied warranty of MERCHANTABILITY or FITNESS FOR A
27 * PARTICULAR PURPOSE. See the GNU General Public
28 * License for more details.
30 * The GNU General Public License should be included with
31 * this file. If not, you can view it at
32 * http://www.gnu.org/copyleft/gpl.html
33 * or write to the Free Software Foundation, Inc., 59
34 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
36 *********************************************************************/
42 /* Global variables */
44 #ifdef FEATURE_STATISTICS
46 extern int urls_rejected;
47 #endif /*def FEATURE_STATISTICS*/
49 extern struct client_states clients[1];
50 extern struct file_list files[1];
53 extern const char *pidfile;
55 extern int daemon_mode;
57 #ifdef FEATURE_GRACEFUL_TERMINATION
58 extern int g_terminate;
61 #if defined(FEATURE_PTHREAD) || defined(_WIN32)
62 #define MUTEX_LOCKS_AVAILABLE
64 #ifdef FEATURE_PTHREAD
67 typedef pthread_mutex_t privoxy_mutex_t;
71 typedef CRITICAL_SECTION privoxy_mutex_t;
75 extern void privoxy_mutex_lock(privoxy_mutex_t *mutex);
76 extern void privoxy_mutex_unlock(privoxy_mutex_t *mutex);
78 extern privoxy_mutex_t log_mutex;
79 extern privoxy_mutex_t log_init_mutex;
80 extern privoxy_mutex_t connection_reuse_mutex;
82 #ifdef FEATURE_EXTERNAL_FILTERS
83 extern privoxy_mutex_t external_filter_mutex;
87 extern privoxy_mutex_t gmtime_mutex;
88 #endif /* ndef HAVE_GMTIME_R */
90 #ifndef HAVE_LOCALTIME_R
91 extern privoxy_mutex_t localtime_mutex;
92 #endif /* ndef HAVE_GMTIME_R */
94 #if !defined(HAVE_GETHOSTBYADDR_R) || !defined(HAVE_GETHOSTBYNAME_R)
95 extern privoxy_mutex_t resolver_mutex;
96 #endif /* !defined(HAVE_GETHOSTBYADDR_R) || !defined(HAVE_GETHOSTBYNAME_R) */
99 extern privoxy_mutex_t rand_mutex;
100 #endif /* ndef HAVE_RANDOM */
102 #endif /* FEATURE_PTHREAD */
107 int real_main(int argc, char **argv);
109 int main(int argc, char **argv);
112 /* Revision control strings from this header and associated .c file */
113 extern const char jcc_rcs[];
114 extern const char jcc_h_rcs[];
116 #endif /* ndef JCC_H_INCLUDED */