home *** CD-ROM | disk | FTP | other *** search
/ ftp.ncftp.com / ftp.ncftp.com.zip / ftp.ncftp.com / libncftp / libncftp-3.2.5-src.zip / libncftp-3.2.5 / sio / syshdrs.h < prev    next >
C/C++ Source or Header  |  2009-11-30  |  7KB  |  233 lines

  1. /* syshdrs.h
  2.  *
  3.  * Copyright (c) 1996-2004 Mike Gleason, NcFTP Software.
  4.  * All rights reserved.
  5.  *
  6.  */
  7. #if (defined(WIN32) || defined(_WINDOWS)) && !defined(__CYGWIN__)
  8. #    pragma once
  9. #    define _CRT_SECURE_NO_WARNINGS 1
  10. #    ifndef __MINGW32__
  11. #        pragma warning(disable : 4127)    // warning C4127: conditional expression is constant
  12. #        pragma warning(disable : 4100)    // warning C4100: 'lpReserved' : unreferenced formal parameter
  13. #        pragma warning(disable : 4514)    // warning C4514: unreferenced inline function has been removed
  14. #        pragma warning(disable : 4115)    // warning C4115: '_RPC_ASYNC_STATE' : named type definition in parentheses
  15. #        pragma warning(disable : 4201)    // warning C4201: nonstandard extension used : nameless struct/union
  16. #        pragma warning(disable : 4214)    // warning C4214: nonstandard extension used : bit field types other than int
  17. #        pragma warning(disable : 4115)    // warning C4115: 'IRpcStubBuffer' : named type definition in parentheses
  18. #        pragma warning(disable : 4711)    // warning C4711: function selected for automatic inline expansion
  19. #    endif
  20.     /* Include "wincfg.h" in place of "config.h" */
  21. #    include "wincfg.h"
  22.     /* We now try for at least Windows 2000 compatibility (0x0500).
  23.      * The code will still work on older systems, though.
  24.      * Prior versions used 0x0400 instead.
  25.      */
  26. #    ifndef WINVER
  27. #        define WINVER 0x0500
  28. #    endif
  29. #    ifndef _WIN32_WINNT
  30. #        define _WIN32_WINNT 0x0500
  31. #    endif
  32. #    include <windows.h>        /* includes <winsock2.h> if _WIN32_WINNT >= 0x400 */
  33. #    include <io.h>
  34. #    include <errno.h>
  35. #    include <stdio.h>
  36. #    include <string.h>
  37. #    include <stddef.h>
  38. #    include <stdlib.h>
  39. #    include <ctype.h>
  40. #    include <stdarg.h>
  41. #    include <sys/types.h>
  42. #    include <sys/stat.h>
  43. #    include <time.h>
  44. #    include <fcntl.h>
  45. #    ifndef strcasecmp
  46. #        define strcasecmp _stricmp
  47. #        define strncasecmp _strnicmp
  48. #    endif
  49. #    define sleep(a) Sleep(a * 1000)
  50. #    ifndef S_ISREG
  51. #        define S_ISREG(m)      (((m) & _S_IFMT) == _S_IFREG)
  52. #        define S_ISDIR(m)      (((m) & _S_IFMT) == _S_IFDIR)
  53. #    endif
  54. #    ifndef open
  55. #        define open _open
  56. #        define write _write
  57. #        define read _read
  58. #        define close _close
  59. #        define lseek _lseek
  60. #        define stat _stat
  61. #        define fstat _fstat
  62. #        define dup _dup
  63. #    endif
  64. #    ifndef unlink
  65. #        define unlink remove
  66. #    endif
  67. #    define MY_FD_ZERO FD_ZERO
  68. #    define MY_FD_SET(s,set) FD_SET((SOCKET) (s), set)
  69. #    define MY_FD_CLR(s,set) FD_CLR((SOCKET) (s), set)
  70. #    define MY_FD_ISSET FD_ISSET
  71. #    define NO_SIGNALS 1
  72. #    define NO_UNIX_DOMAIN_SOCKETS 1
  73. #else /* ---------------------------- UNIX ---------------------------- */
  74. #    if defined(HAVE_CONFIG_H)
  75. #        include <config.h>
  76. #    endif
  77. #    if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)
  78. #        define _ALL_SOURCE 1
  79. #    endif
  80. #    ifdef HAVE_UNISTD_H
  81. #        include <unistd.h>
  82. #    endif
  83. #    include <sys/types.h>
  84. #    include <sys/time.h>
  85. #    include <sys/stat.h>
  86. #    include <sys/socket.h>
  87. #    ifdef HAVE_SYS_UN_H
  88. #        include <sys/un.h>
  89. #    endif
  90. #    include <sys/ioctl.h>
  91.  
  92. #    include <netinet/in_systm.h>
  93. #    include <netinet/in.h>
  94. #    include <netinet/ip.h>
  95. #    include <netinet/tcp.h>
  96. #    include <arpa/inet.h>
  97. #    include <arpa/telnet.h>
  98. #    include <netdb.h>
  99. #    include <errno.h>
  100. #    include <stdio.h>
  101. #    include <string.h>
  102. #    ifdef HAVE_STRINGS_H
  103. #        include <strings.h>
  104. #    endif
  105. #    include <stddef.h>
  106. #    include <stdlib.h>
  107. #    include <ctype.h>
  108. #    include <signal.h>
  109. #    include <setjmp.h>
  110. #    include <stdarg.h>
  111. #    include <time.h>
  112. #    include <fcntl.h>
  113.  
  114. #    ifdef HAVE_ALLOCA_H
  115. #        include <alloca.h>
  116. #    endif
  117.  
  118. #    ifdef HAVE_NET_ERRNO_H
  119. #        include <net/errno.h>
  120. #    endif
  121. #    ifdef HAVE_ARPA_NAMESER_H
  122. #        include <arpa/nameser.h>
  123. #    endif
  124. #    ifdef HAVE_NSERVE_H
  125. #        ifdef SCO
  126. #            undef MAXDNAME
  127. #        endif
  128. #        include <nserve.h>
  129. #    endif
  130. #    ifdef HAVE_RESOLV_H
  131. #        include <resolv.h>
  132. #        ifdef HPUX
  133.             extern int res_init(void);
  134. #        endif
  135. #    endif
  136.  
  137. #    ifdef CAN_USE_SYS_SELECT_H
  138. #        include <sys/select.h>
  139. #    endif
  140. #    define MY_FD_ZERO FD_ZERO
  141. #    define MY_FD_SET FD_SET
  142. #    define MY_FD_CLR FD_CLR
  143. #    define MY_FD_ISSET FD_ISSET
  144.  
  145. #    ifndef SETSOCKOPT_ARG4
  146. #        define SETSOCKOPT_ARG4
  147. #        define GETSOCKOPT_ARG4
  148. #    endif
  149. #    if defined(MACOSX) || defined(BSDOS)
  150. #        undef SIG_DFL
  151. #        undef SIG_IGN
  152. #        undef SIG_ERR
  153. #        define SIG_DFL         (void (*)(int))0
  154. #        define SIG_IGN         (void (*)(int))1
  155. #        define SIG_ERR         (void (*)(int))-1
  156. #    endif
  157. #endif /* ---------------------------- UNIX ---------------------------- */
  158.  
  159. #if (defined(AIX) && (AIX >= 430))
  160. /* AIX 4.3's sys/socket.h doesn't properly prototype these for C */
  161. extern int naccept(int, struct sockaddr *, socklen_t *);
  162. extern int ngetpeername(int, struct sockaddr *, socklen_t *);
  163. extern int ngetsockname(int, struct sockaddr *, socklen_t *);
  164. extern ssize_t nrecvfrom(int, void *, size_t, int, struct sockaddr *, socklen_t *);
  165. extern ssize_t nrecvmsg(int, struct msghdr *, int);
  166. extern ssize_t nsendmsg(int, const struct msghdr *, int);
  167. #endif
  168.  
  169.  
  170. #ifndef IAC
  171.  
  172. /*
  173.  * Definitions for the TELNET protocol.
  174.  */
  175. #define IAC     255             /* interpret as command: */
  176. #define DONT    254             /* you are not to use option */
  177. #define DO      253             /* please, you use option */
  178. #define WONT    252             /* I won't use option */
  179. #define WILL    251             /* I will use option */
  180. #define SB      250             /* interpret as subnegotiation */
  181. #define GA      249             /* you may reverse the line */
  182. #define EL      248             /* erase the current line */
  183. #define EC      247             /* erase the current character */
  184. #define AYT     246             /* are you there */
  185. #define AO      245             /* abort output--but let prog finish */
  186. #define IP      244             /* interrupt process--permanently */
  187. #define BREAK   243             /* break */
  188. #define DM      242             /* data mark--for connect. cleaning */
  189. #define NOP     241             /* nop */
  190. #define SE      240             /* end sub negotiation */
  191. #define EOR     239             /* end of record (transparent mode) */
  192. #define ABORT   238             /* Abort process */
  193. #define SUSP    237             /* Suspend process */
  194. #define xEOF    236             /* End of file: EOF is already used... */
  195.  
  196. #define SYNCH   242             /* for telfunc calls */
  197. #endif
  198.  
  199. #if ((defined(SIGALRM)) && (defined(SIGPIPE)))
  200. #    define UNIX_SIGNALS 1
  201. #endif
  202.  
  203. /* Private decl; only for use when compiling sio code. */
  204. #ifdef HAVE_SIGSETJMP
  205. #    define SSetjmp(a) sigsetjmp(a, 1)
  206. #    define SLongjmp(a,b) siglongjmp(a, b)
  207. #    define Sjmp_buf sigjmp_buf
  208. #else
  209. #    define SSetjmp(a) setjmp(a)
  210. #    define SLongjmp(a,b) longjmp(a, b)
  211. #    define Sjmp_buf jmp_buf
  212. #endif
  213.  
  214. #include "sio.h"            /* Library header. */
  215. #ifdef HAVE_UNIX_DOMAIN_SOCKETS
  216. #    include "usio.h"
  217. #endif
  218.  
  219. #if (defined(SOCKS)) && (SOCKS >= 5)
  220. #    ifdef HAVE_SOCKS_H
  221. #        ifdef HAVE_SOCKS5P_H
  222. #            define INCLUDE_PROTOTYPES 1
  223. #        endif
  224. #        include <socks.h>
  225. #    endif
  226. #endif    /* SOCKS */
  227.  
  228. #ifdef DNSSEC_LOCAL_VALIDATION
  229. #include <validator/validator.h>
  230. #endif
  231.  
  232. /* eof */
  233.