3 * Copyright (c) 1999 Mike Gleason, NCEMRSoft.
8 #if defined(HAVE_CONFIG_H)
12 #if defined(WIN32) || defined(_WINDOWS)
13 /* Include "wincfg.h" in place of "config.h" */
15 # include <winsock2.h> /* includes <windows.h> */
23 # ifdef HAVE_STRINGS_H
32 # include <sys/types.h>
33 # include <sys/stat.h>
36 # define strcasecmp stricmp
38 # define strncasecmp strnicmp
39 # define sleep(a) Sleep(a * 1000)
41 # define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
42 # define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
55 # define unlink remove
58 # define NO_UNIX_DOMAIN_SOCKETS 1
61 #if defined(AIX) || defined(_AIX)
62 # define _ALL_SOURCE 1
67 #include <sys/types.h>
70 #include <sys/socket.h>
72 #include <sys/ioctl.h>
73 #if !defined(HAVE_GETCWD) && defined(HAVE_GETWD)
74 # include <sys/param.h>
77 #include <netinet/in.h>
78 #include <netinet/tcp.h>
79 #include <arpa/inet.h>
80 #include <arpa/telnet.h>
97 #ifdef HAVE_NET_ERRNO_H
98 # include <net/errno.h>
100 #ifdef HAVE_ARPA_NAMESER_H
101 # include <arpa/nameser.h>
109 #ifdef CAN_USE_SYS_SELECT_H
110 # include <sys/select.h>
114 # ifndef HAVE_UNISTD_H
115 extern char *getcwd();
119 # include <sys/param.h>
121 # define MAXPATHLEN 1024
123 extern char *getwd(char *);
127 #define HAVE_RECVMSG 1
131 #if defined(HAVE_LONG_LONG) && defined(HAVE_OPEN64)
137 #if defined(HAVE_LONG_LONG) && defined(HAVE_STAT64) && defined(HAVE_STRUCT_STAT64)
140 # define Fstat fstat64
145 # define Lstat lstat64
155 #if defined(HAVE_LONG_LONG) && defined(HAVE_LSEEK64)
156 # define Lseek(a,b,c) lseek64(a, (longest_int) b, c)
157 #elif defined(HAVE_LONG_LONG) && defined(HAVE_LLSEEK)
159 # if defined(LINUX) && (LINUX <= 23000)
160 # define Lseek(a,b,c) lseek(a, (off_t) b, c)
162 # define Lseek(a,b,c) llseek(a, (longest_int) b, c)
165 # define Lseek(a,b,c) lseek(a, (off_t) b, c)
168 # define Lseek(a,b,c) lseek(a, (off_t) b, c)
175 * Definitions for the TELNET protocol.
177 #define IAC 255 /* interpret as command: */
178 #define DONT 254 /* you are not to use option */
179 #define DO 253 /* please, you use option */
180 #define WONT 252 /* I won't use option */
181 #define WILL 251 /* I will use option */
182 #define SB 250 /* interpret as subnegotiation */
183 #define GA 249 /* you may reverse the line */
184 #define EL 248 /* erase the current line */
185 #define EC 247 /* erase the current character */
186 #define AYT 246 /* are you there */
187 #define AO 245 /* abort output--but let prog finish */
188 #define IP 244 /* interrupt process--permanently */
189 #define BREAK 243 /* break */
190 #define DM 242 /* data mark--for connect. cleaning */
191 #define NOP 241 /* nop */
192 #define SE 240 /* end sub negotiation */
193 #define EOR 239 /* end of record (transparent mode) */
194 #define ABORT 238 /* Abort process */
195 #define SUSP 237 /* Suspend process */
196 #define xEOF 236 /* End of file: EOF is already used... */
198 #define SYNCH 242 /* for telfunc calls */
201 #include "sio.h" /* Library header. */
202 #ifndef NO_UNIX_DOMAIN_SOCKETS