home *** CD-ROM | disk | FTP | other *** search
/ ftp.ncftp.com / ftp.ncftp.com.zip / ftp.ncftp.com / libncftp / older_versions / libncftp-3.1.5-src.tar.gz / libncftp-3.1.5-src.tar / libncftp-3.1.5 / sio / syshdrs.h < prev    next >
C/C++ Source or Header  |  2002-03-27  |  6KB  |  197 lines

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