setup.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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 _might_ be a good Borland fix. Please report whether this works or
  38. not! */
  39. #define WIN32
  40. #endif
  41. #ifdef HAVE_CONFIG_H
  42. #ifdef VMS
  43. #include "config-vms.h"
  44. #else
  45. #include "config.h" /* the configure script results */
  46. #endif
  47. #else
  48. #ifdef WIN32
  49. /* hand-modified win32 config.h! */
  50. #include "config-win32.h"
  51. #endif
  52. #ifdef macintosh
  53. /* hand-modified MacOS config.h! */
  54. #include "config-mac.h"
  55. #endif
  56. #endif
  57. #ifndef __cplusplus /* (rabe) */
  58. typedef unsigned char bool;
  59. #define typedef_bool
  60. #endif /* (rabe) */
  61. #ifdef NEED_REENTRANT
  62. /* Solaris machines needs _REENTRANT set for a few function prototypes and
  63. things to appear in the #include files. We need to #define it before all
  64. #include files */
  65. #define _REENTRANT
  66. #endif
  67. #include <stdio.h>
  68. #ifndef OS
  69. #ifdef WIN32
  70. #define OS "win32"
  71. #else
  72. #define OS "unknown"
  73. #endif
  74. #endif
  75. #if defined(HAVE_X509_H) && defined(HAVE_SSL_H) && defined(HAVE_RSA_H) && \
  76. defined(HAVE_PEM_H) && defined(HAVE_ERR_H) && defined(HAVE_CRYPTO_H) && \
  77. defined(HAVE_LIBSSL) && defined(HAVE_LIBCRYPTO)
  78. /* the six important includes files all exist and so do both libs,
  79. defined SSLeay usage */
  80. #define USE_SSLEAY 1
  81. #endif
  82. #if defined(HAVE_OPENSSL_X509_H) && defined(HAVE_OPENSSL_SSL_H) && \
  83. defined(HAVE_OPENSSL_RSA_H) && defined(HAVE_OPENSSL_PEM_H) && \
  84. defined(HAVE_OPENSSL_ERR_H) && defined(HAVE_OPENSSL_CRYPTO_H) && \
  85. defined(HAVE_LIBSSL) && defined(HAVE_LIBCRYPTO)
  86. /* the six important includes files all exist and so do both libs,
  87. defined SSLeay usage */
  88. #define USE_SSLEAY 1
  89. #define USE_OPENSSL 1
  90. #endif
  91. #ifndef STDC_HEADERS /* no standard C headers! */
  92. #ifdef VMS
  93. #include "../include/curl/stdcheaders.h"
  94. #else
  95. #include <curl/stdcheaders.h>
  96. #endif
  97. #else
  98. #ifdef _AIX
  99. #include <curl/stdcheaders.h>
  100. #endif
  101. #endif
  102. /* Below we define four functions. They should
  103. 1. close a socket
  104. 2. read from a socket
  105. 3. write to a socket
  106. 4. set the SIGALRM signal timeout
  107. 5. set dir/file naming defines
  108. */
  109. #ifdef WIN32
  110. #if !defined(__GNUC__) || defined(__MINGW32__)
  111. #define sclose(x) closesocket(x)
  112. #define sread(x,y,z) recv(x,y,z,0)
  113. #define swrite(x,y,z) (size_t)send(x,y,z,0)
  114. #undef HAVE_ALARM
  115. #else
  116. /* gcc-for-win is still good :) */
  117. #define sclose(x) close(x)
  118. #define sread(x,y,z) recv(x,y,z,0)
  119. #define swrite(x,y,z) send(x,y,z,0)
  120. #define HAVE_ALARM
  121. #endif
  122. #define PATH_CHAR ";"
  123. #define DIR_CHAR "\\"
  124. #define DOT_CHAR "_"
  125. #else
  126. #define sclose(x) close(x)
  127. #define sread(x,y,z) recv(x,y,z,0)
  128. #define swrite(x,y,z) send(x,y,z,0)
  129. #define HAVE_ALARM
  130. #define PATH_CHAR ":"
  131. #define DIR_CHAR "/"
  132. #define DOT_CHAR "."
  133. #ifdef HAVE_STRCASECMP
  134. /* this is for "-ansi -Wall -pedantic" to stop complaining! */
  135. extern int (strcasecmp)(const char *s1, const char *s2);
  136. extern int (strncasecmp)(const char *s1, const char *s2, size_t n);
  137. #ifndef fileno /* sunos 4 have this as a macro! */
  138. int fileno( FILE *stream);
  139. #endif
  140. #endif
  141. #endif
  142. /*
  143. * Curl_addrinfo MUST be used for name resolving information.
  144. * Information regarding a single IP witin a Curl_addrinfo MUST be stored in
  145. * a Curl_ipconnect struct.
  146. */
  147. #ifdef ENABLE_IPV6
  148. typedef struct addrinfo Curl_addrinfo;
  149. typedef struct addrinfo Curl_ipconnect;
  150. #else
  151. typedef struct hostent Curl_addrinfo;
  152. typedef struct in_addr Curl_ipconnect;
  153. #endif
  154. #endif /* __CONFIG_H */