Remove useless parentheses in get_destination_from_headers()
[privoxy.git] / project.h
index 100f832..dac7013 100644 (file)
--- a/project.h
+++ b/project.h
@@ -1,7 +1,7 @@
 #ifndef PROJECT_H_INCLUDED
 #define PROJECT_H_INCLUDED
 /** Version string. */
-#define PROJECT_H_VERSION "$Id: project.h,v 1.158 2010/07/21 14:35:09 fabiankeil Exp $"
+#define PROJECT_H_VERSION "$Id: project.h,v 1.162 2011/02/19 13:56:55 fabiankeil Exp $"
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/project.h,v $
 /* Needed for pcre choice */
 #include "config.h"
 
-#ifdef HAVE_RFC2553
 /* Need for struct sockaddr_storage */
-#include <sys/socket.h>
+#ifdef HAVE_RFC2553
+#  ifndef _WIN32
+#    include <netdb.h>
+#    include <sys/socket.h>
+#  else
+#    include <stdint.h>
+#    include <winsock2.h>
+#    include <ws2tcpip.h>
+     typedef unsigned short in_port_t;
+#  endif
 #endif
 
 
@@ -757,7 +765,7 @@ struct reusable_connection
 #define CSP_FLAG_SERVER_CONTENT_LENGTH_SET     0x00002000U
 
 /**
- * Flag for csp->flags: Set if we know the content lenght,
+ * Flag for csp->flags: Set if we know the content length,
  * either because the server set it, or we figured it out
  * on our own.
  */
@@ -1023,12 +1031,16 @@ struct block_spec
 
 #endif /* def FEATURE_TRUST */
 
-
-#define SOCKS_NONE    0    /**< Don't use a SOCKS server               */
-#define SOCKS_4      40    /**< original SOCKS 4 protocol              */
-#define SOCKS_4A     41    /**< as modified for hosts w/o external DNS */
-#define SOCKS_5      50    /**< as modified for hosts w/o external DNS */
-
+enum forwarder_type {
+   /**< Don't use a SOCKS server               */
+   SOCKS_NONE =  0,
+   /**< original SOCKS 4 protocol              */
+   SOCKS_4    = 40,
+   /**< SOCKS 4A, DNS resolution is done by the SOCKS server */
+   SOCKS_4A   = 41,
+   /**< SOCKS 5 with hostnames, DNS resolution is done by the SOCKS server */
+   SOCKS_5    = 50,
+};
 
 /**
  * How to forward a connection to a parent proxy.
@@ -1039,7 +1051,7 @@ struct forward_spec
    struct url_spec url[1];
 
    /** Connection type.  Must be SOCKS_NONE, SOCKS_4, SOCKS_4A or SOCKS_5. */
-   int   type;
+   enum forwarder_type type;
 
    /** SOCKS server hostname.  Only valid if "type" is SOCKS_4 or SOCKS_4A. */
    char *gateway_host;