In socks4_connect(), don't comment on connect_to() failures.
[privoxy.git] / jcc.h
1 #ifndef JCC_H_INCLUDED
2 #define JCC_H_INCLUDED
3 #define JCC_H_VERSION "$Id: jcc.h,v 1.28 2010/01/03 12:37:14 fabiankeil Exp $"
4 /*********************************************************************
5  *
6  * File        :  $Source: /cvsroot/ijbswa/current/jcc.h,v $
7  *
8  * Purpose     :  Main file.  Contains main() method, main loop, and 
9  *                the main connection-handling function.
10  *
11  * Copyright   :  Written by and Copyright (C) 2001-2006 the SourceForge
12  *                Privoxy team. http://www.privoxy.org/
13  *
14  *                Based on the Internet Junkbuster originally written
15  *                by and Copyright (C) 1997 Anonymous Coders and 
16  *                Junkbusters Corporation.  http://www.junkbusters.com
17  *
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.
23  *
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.
29  *
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.
35  *
36  *********************************************************************/
37
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 struct client_state;
44 struct file_list;
45
46 /* Global variables */
47
48 #ifdef FEATURE_STATISTICS
49 extern int urls_read;
50 extern int urls_rejected;
51 #endif /*def FEATURE_STATISTICS*/
52
53 extern struct client_states clients[1];
54 extern struct file_list    files[1];
55
56 #ifdef unix
57 extern const char *pidfile;
58 #endif
59 extern int daemon_mode;
60
61 #ifdef FEATURE_GRACEFUL_TERMINATION
62 extern int g_terminate;
63 #endif
64
65 #if defined(FEATURE_PTHREAD) || defined(_WIN32)
66 #define MUTEX_LOCKS_AVAILABLE
67
68 #ifdef FEATURE_PTHREAD
69 #include <pthread.h>
70
71 typedef pthread_mutex_t privoxy_mutex_t;
72
73 #else
74
75 typedef CRITICAL_SECTION privoxy_mutex_t;
76
77 #endif
78
79 extern void privoxy_mutex_lock(privoxy_mutex_t *mutex);
80 extern void privoxy_mutex_unlock(privoxy_mutex_t *mutex);
81
82 extern privoxy_mutex_t log_mutex;
83 extern privoxy_mutex_t log_init_mutex;
84 extern privoxy_mutex_t connection_reuse_mutex;
85
86 #ifndef HAVE_GMTIME_R
87 extern privoxy_mutex_t gmtime_mutex;
88 #endif /* ndef HAVE_GMTIME_R */
89
90 #ifndef HAVE_LOCALTIME_R
91 extern privoxy_mutex_t localtime_mutex;
92 #endif /* ndef HAVE_GMTIME_R */
93
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) */
97
98 #ifndef HAVE_RANDOM
99 extern privoxy_mutex_t rand_mutex;
100 #endif /* ndef HAVE_RANDOM */
101
102 #endif /* FEATURE_PTHREAD */
103
104 /* Functions */
105
106 #ifdef __MINGW32__
107 int real_main(int argc, char **argv);
108 #else
109 int main(int argc, char **argv);
110 #endif
111
112 /* Revision control strings from this header and associated .c file */
113 extern const char jcc_rcs[];
114 extern const char jcc_h_rcs[];
115
116 #ifdef __cplusplus
117 } /* extern "C" */
118 #endif
119
120 #endif /* ndef JCC_H_INCLUDED */
121
122 /*
123   Local Variables:
124   tab-width: 3
125   end:
126 */