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