f4483d2ab16f3fa2c375251aa5b1cd4c28e542be
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>
35 # define strcasecmp stricmp
36 # define strncasecmp strnicmp
37 # define sleep(a) Sleep(a * 1000)
39 # define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
40 # define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
53 # define unlink remove
56 # define NO_UNIX_DOMAIN_SOCKETS 1
59 #if defined(AIX) || defined(_AIX)
60 # define _ALL_SOURCE 1
65 #include <sys/types.h>
68 #include <sys/socket.h>
70 #include <sys/ioctl.h>
71 #if !defined(HAVE_GETCWD) && defined(HAVE_GETWD)
72 # include <sys/param.h>
75 #include <netinet/in.h>
76 #include <netinet/tcp.h>
77 #include <arpa/inet.h>
78 #include <arpa/telnet.h>
95 #ifdef HAVE_NET_ERRNO_H
96 # include <net/errno.h>
98 #ifdef HAVE_ARPA_NAMESER_H
99 # include <arpa/nameser.h>
107 #ifdef CAN_USE_SYS_SELECT_H
108 # include <sys/select.h>
112 # ifndef HAVE_UNISTD_H
113 extern char *getcwd();
117 # include <sys/param.h>
119 # define MAXPATHLEN 1024
121 extern char *getwd(char *);
125 #define HAVE_RECVMSG 1
129 #if defined(HAVE_LONG_LONG) && defined(HAVE_OPEN64)
135 #if defined(HAVE_LONG_LONG) && defined(HAVE_STAT64) && defined(HAVE_STRUCT_STAT64)
138 # define Fstat fstat64
143 # define Lstat lstat64
153 #if defined(HAVE_LONG_LONG) && defined(HAVE_LSEEK64)
154 # define Lseek(a,b,c) lseek64(a, (longest_int) b, c)
155 #elif defined(HAVE_LONG_LONG) && defined(HAVE_LLSEEK)
157 # if defined(LINUX) && (LINUX <= 23000)
158 # define Lseek(a,b,c) lseek(a, (off_t) b, c)
160 # define Lseek(a,b,c) llseek(a, (longest_int) b, c)
163 # define Lseek(a,b,c) lseek(a, (off_t) b, c)
166 # define Lseek(a,b,c) lseek(a, (off_t) b, c)
173 * Definitions for the TELNET protocol.
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... */
196 #define SYNCH 242 /* for telfunc calls */
199 #include "sio.h" /* Library header. */
200 #ifndef NO_UNIX_DOMAIN_SOCKETS