setup.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. #ifndef __SETUP_H
  2. #define __SETUP_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2002, Daniel Stenberg, <[email protected]>, et al.
  11. *
  12. * This software is licensed as described in the file COPYING, which
  13. * you should have received as part of this distribution. The terms
  14. * are also available at http://curl.haxx.se/docs/copyright.html.
  15. *
  16. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  17. * copies of the Software, and permit persons to whom the Software is
  18. * furnished to do so, under the terms of the COPYING file.
  19. *
  20. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  21. * KIND, either express or implied.
  22. *
  23. * $Id$
  24. ***************************************************************************/
  25. /* MN 06/07/02 */
  26. /* #define HTTP_ONLY
  27. */
  28. #ifdef HTTP_ONLY
  29. #define CURL_DISABLE_FTP
  30. #define CURL_DISABLE_LDAP
  31. #define CURL_DISABLE_TELNET
  32. #define CURL_DISABLE_DICT
  33. #define CURL_DISABLE_FILE
  34. #define CURL_DISABLE_GOPHER
  35. #endif
  36. #if !defined(WIN32) && defined(__WIN32__)
  37. /* This should be a good Borland fix. Alexander J. Oss told us! */
  38. #define WIN32
  39. #endif
  40. #ifdef HAVE_CONFIG_H
  41. #ifdef VMS
  42. #include "config-vms.h"
  43. #else
  44. #include "config.h" /* the configure script results */
  45. #endif
  46. #else
  47. #ifdef WIN32
  48. /* hand-modified win32 config.h! */
  49. #include "config-win32.h"
  50. #endif
  51. #ifdef macintosh
  52. /* hand-modified MacOS config.h! */
  53. #include "config-mac.h"
  54. #endif
  55. #endif
  56. #ifndef __cplusplus /* (rabe) */
  57. typedef unsigned char bool;
  58. #define typedef_bool
  59. #endif /* (rabe) */
  60. #ifdef NEED_REENTRANT
  61. /* Solaris machines needs _REENTRANT set for a few function prototypes and
  62. things to appear in the #include files. We need to #define it before all
  63. #include files */
  64. #define _REENTRANT
  65. #endif
  66. #include <stdio.h>
  67. #ifndef OS
  68. #ifdef WIN32
  69. #define OS "win32"
  70. #else
  71. #define OS "unknown"
  72. #endif
  73. #endif
  74. #if defined(HAVE_X509_H) && defined(HAVE_SSL_H) && defined(HAVE_RSA_H) && \
  75. defined(HAVE_PEM_H) && defined(HAVE_ERR_H) && defined(HAVE_CRYPTO_H) && \
  76. defined(HAVE_LIBSSL) && defined(HAVE_LIBCRYPTO)
  77. /* the six important includes files all exist and so do both libs,
  78. defined SSLeay usage */
  79. #define USE_SSLEAY 1
  80. #endif
  81. #if defined(HAVE_OPENSSL_X509_H) && defined(HAVE_OPENSSL_SSL_H) && \
  82. defined(HAVE_OPENSSL_RSA_H) && defined(HAVE_OPENSSL_PEM_H) && \
  83. defined(HAVE_OPENSSL_ERR_H) && defined(HAVE_OPENSSL_CRYPTO_H) && \
  84. defined(HAVE_LIBSSL) && defined(HAVE_LIBCRYPTO)
  85. /* the six important includes files all exist and so do both libs,
  86. defined SSLeay usage */
  87. #define USE_SSLEAY 1
  88. #define USE_OPENSSL 1
  89. #endif
  90. #ifndef STDC_HEADERS /* no standard C headers! */
  91. #ifdef VMS
  92. #include "../include/curl/stdcheaders.h"
  93. #else
  94. #include <curl/stdcheaders.h>
  95. #endif
  96. #else
  97. #ifdef _AIX
  98. #include <curl/stdcheaders.h>
  99. #endif
  100. #endif
  101. /* Below we define four functions. They should
  102. 1. close a socket
  103. 2. read from a socket
  104. 3. write to a socket
  105. 4. set the SIGALRM signal timeout
  106. 5. set dir/file naming defines
  107. */
  108. #ifdef WIN32
  109. #if !defined(__GNUC__) || defined(__MINGW32__)
  110. #define sclose(x) closesocket(x)
  111. #define sread(x,y,z) recv(x,y,z,0)
  112. #define swrite(x,y,z) (size_t)send(x,y,z,0)
  113. #undef HAVE_ALARM
  114. #else
  115. /* gcc-for-win is still good :) */
  116. #define sclose(x) close(x)
  117. #define sread(x,y,z) recv(x,y,z,0)
  118. #define swrite(x,y,z) send(x,y,z,0)
  119. #define HAVE_ALARM
  120. #endif
  121. #define PATH_CHAR ";"
  122. #define DIR_CHAR "\\"
  123. #define DOT_CHAR "_"
  124. #else
  125. #define sclose(x) close(x)
  126. #define sread(x,y,z) recv(x,y,z,0)
  127. #define swrite(x,y,z) send(x,y,z,0)
  128. #define HAVE_ALARM
  129. #define PATH_CHAR ":"
  130. #define DIR_CHAR "/"
  131. #define DOT_CHAR "."
  132. #ifdef HAVE_STRCASECMP
  133. /* this is for "-ansi -Wall -pedantic" to stop complaining! */
  134. extern int (strcasecmp)(const char *s1, const char *s2);
  135. extern int (strncasecmp)(const char *s1, const char *s2, size_t n);
  136. #ifndef fileno /* sunos 4 have this as a macro! */
  137. int fileno( FILE *stream);
  138. #endif
  139. #endif
  140. #endif
  141. /*
  142. * Curl_addrinfo MUST be used for name resolving information.
  143. * Information regarding a single IP witin a Curl_addrinfo MUST be stored in
  144. * a Curl_ipconnect struct.
  145. */
  146. #ifdef ENABLE_IPV6
  147. typedef struct addrinfo Curl_addrinfo;
  148. typedef struct addrinfo Curl_ipconnect;
  149. #else
  150. typedef struct hostent Curl_addrinfo;
  151. typedef struct in_addr Curl_ipconnect;
  152. #endif
  153. #endif /* __CONFIG_H */