Use more precise example descriptions for the mysterious domain patterns.
[privoxy.git] / gateway.h
1 #ifndef GATEWAY_H_INCLUDED
2 #define GATEWAY_H_INCLUDED
3 #define GATEWAY_H_VERSION "$Id: gateway.h,v 1.7 2002/03/26 22:29:54 swa Exp $"
4 /*********************************************************************
5  *
6  * File        :  $Source: /cvsroot/ijbswa/current/Attic/gateway.h,v $
7  *
8  * Purpose     :  Contains functions to connect to a server, possibly
9  *                using a "gateway" (i.e. HTTP proxy and/or SOCKS4
10  *                proxy).  Also contains the list of gateway types.
11  *
12  * Copyright   :  Written by and Copyright (C) 2001 the SourceForge
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  * Revisions   :
38  *    $Log: gateway.h,v $
39  *    Revision 1.7  2002/03/26 22:29:54  swa
40  *    we have a new homepage!
41  *
42  *    Revision 1.6  2002/03/25 22:12:45  oes
43  *    Added fix for undefined INADDR_NONE on Solaris by Bart Schelstraete
44  *
45  *    Revision 1.5  2002/03/24 13:25:43  swa
46  *    name change related issues
47  *
48  *    Revision 1.4  2002/03/09 20:03:52  jongfoster
49  *    - Making various functions return int rather than size_t.
50  *      (Undoing a recent change).  Since size_t is unsigned on
51  *      Windows, functions like read_socket that return -1 on
52  *      error cannot return a size_t.
53  *
54  *      THIS WAS A MAJOR BUG - it caused frequent, unpredictable
55  *      crashes, and also frequently caused JB to jump to 100%
56  *      CPU and stay there.  (Because it thought it had just
57  *      read ((unsigned)-1) == 4Gb of data...)
58  *
59  *    - The signature of write_socket has changed, it now simply
60  *      returns success=0/failure=nonzero.
61  *
62  *    - Trying to get rid of a few warnings --with-debug on
63  *      Windows, I've introduced a new type "jb_socket".  This is
64  *      used for the socket file descriptors.  On Windows, this
65  *      is SOCKET (a typedef for unsigned).  Everywhere else, it's
66  *      an int.  The error value can't be -1 any more, so it's
67  *      now JB_INVALID_SOCKET (which is -1 on UNIX, and in
68  *      Windows it maps to the #define INVALID_SOCKET.)
69  *
70  *    - The signature of bind_port has changed.
71  *
72  *    Revision 1.3  2001/07/29 18:58:15  jongfoster
73  *    Removing nested #includes, adding forward declarations for needed
74  *    structures, and changing the #define _FILENAME_H to FILENAME_H_INCLUDED.
75  *
76  *    Revision 1.2  2001/06/07 23:12:14  jongfoster
77  *    Removing gateways[] list - no longer used.
78  *    Replacing function pointer in struct gateway with a directly
79  *    called function forwarded_connect(), which can do the common
80  *    task of deciding whether to connect to the web server or HTTP
81  *    proxy.
82  *    Replacing struct gateway with struct forward_spec
83  *
84  *    Revision 1.1.1.1  2001/05/15 13:58:54  oes
85  *    Initial import of version 2.9.3 source tree
86  *
87  *
88  *********************************************************************/
89 \f
90
91 #ifdef __cplusplus
92 extern "C" {
93 #endif
94
95 struct forward_spec;
96 struct http_request;
97 struct client_state;
98
99 extern jb_socket forwarded_connect(const struct forward_spec * fwd, 
100                                    struct http_request *http, 
101                                    struct client_state *csp);
102
103 /*
104  * Solaris fix
105  */
106 #ifndef INADDR_NONE
107 #define INADDR_NONE -1
108 #endif
109
110 /*
111  * Revision control strings from this header and associated .c file
112  */
113 extern const char gateway_rcs[];
114 extern const char gateway_h_rcs[];
115
116 #ifdef __cplusplus
117 } /* extern "C" */
118 #endif
119
120 #endif /* ndef GATEWAY_H_INCLUDED */
121
122 /*
123   Local Variables:
124   tab-width: 3
125   end:
126 */