[THEMES]
[reactos.git] / rosapps / applications / net / ncftp / sio / syshdrs.h
1 /* syshdrs.h
2 *
3 * Copyright (c) 1999 Mike Gleason, NCEMRSoft.
4 * All rights reserved.
5 *
6 */
7
8 #if defined(HAVE_CONFIG_H)
9 # include "config.h"
10 #endif
11
12 #if defined(WIN32) || defined(_WINDOWS)
13 /* Include "wincfg.h" in place of "config.h" */
14 # include "wincfg.h"
15 # include <winsock2.h> /* includes <windows.h> */
16 # define _POSIX_ 1
17 # ifdef HAVE_UNISTD_H
18 # include <unistd.h>
19 # endif
20 # include <errno.h>
21 # include <stdio.h>
22 # include <string.h>
23 # ifdef HAVE_STRINGS_H
24 # include <strings.h>
25 # endif
26 # include <stddef.h>
27 # include <stdlib.h>
28 # include <ctype.h>
29 # include <stdarg.h>
30 # include <time.h>
31 # include <io.h>
32 # include <sys/types.h>
33 # include <sys/stat.h>
34 # include <fcntl.h>
35 # undef strcasecmp
36 # define strcasecmp stricmp
37 # undef strncasecmp
38 # define strncasecmp strnicmp
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 NO_SIGNALS 1
58 # define NO_UNIX_DOMAIN_SOCKETS 1
59 #else /* UNIX */
60
61 #if defined(AIX) || defined(_AIX)
62 # define _ALL_SOURCE 1
63 #endif
64 #ifdef HAVE_UNISTD_H
65 # include <unistd.h>
66 #endif
67 #include <sys/types.h>
68 #include <sys/time.h>
69 #include <sys/stat.h>
70 #include <sys/socket.h>
71 #include <sys/un.h>
72 #include <sys/ioctl.h>
73 #if !defined(HAVE_GETCWD) && defined(HAVE_GETWD)
74 # include <sys/param.h>
75 #endif
76
77 #include <netinet/in.h>
78 #include <netinet/tcp.h>
79 #include <arpa/inet.h>
80 #include <arpa/telnet.h>
81 #include <netdb.h>
82 #include <errno.h>
83 #include <stdio.h>
84 #include <string.h>
85 #ifdef HAVE_STRINGS_H
86 # include <strings.h>
87 #endif
88 #include <stddef.h>
89 #include <stdlib.h>
90 #include <ctype.h>
91 #include <signal.h>
92 #include <setjmp.h>
93 #include <stdarg.h>
94 #include <time.h>
95 #include <fcntl.h>
96
97 #ifdef HAVE_NET_ERRNO_H
98 # include <net/errno.h>
99 #endif
100 #ifdef HAVE_ARPA_NAMESER_H
101 # include <arpa/nameser.h>
102 #endif
103 #ifdef HAVE_NSERVE_H
104 # include <nserve.h>
105 #endif
106 #ifdef HAVE_RESOLV_H
107 # include <resolv.h>
108 #endif
109 #ifdef CAN_USE_SYS_SELECT_H
110 # include <sys/select.h>
111 #endif
112
113 #ifdef HAVE_GETCWD
114 # ifndef HAVE_UNISTD_H
115 extern char *getcwd();
116 # endif
117 #else
118 # ifdef HAVE_GETWD
119 # include <sys/param.h>
120 # ifndef MAXPATHLEN
121 # define MAXPATHLEN 1024
122 # endif
123 extern char *getwd(char *);
124 # endif
125 #endif
126
127 #define HAVE_RECVMSG 1
128
129 #endif /* UNIX */
130
131 #if defined(HAVE_LONG_LONG) && defined(HAVE_OPEN64)
132 # define Open open64
133 #else
134 # define Open open
135 #endif
136
137 #if defined(HAVE_LONG_LONG) && defined(HAVE_STAT64) && defined(HAVE_STRUCT_STAT64)
138 # define Stat stat64
139 # ifdef HAVE_FSTAT64
140 # define Fstat fstat64
141 # else
142 # define Fstat fstat
143 # endif
144 # ifdef HAVE_LSTAT64
145 # define Lstat lstat64
146 # else
147 # define Lstat lstat
148 # endif
149 #else
150 # define Stat stat
151 # define Fstat fstat
152 # define Lstat lstat
153 #endif
154
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)
158 # if 1
159 # if defined(LINUX) && (LINUX <= 23000)
160 # define Lseek(a,b,c) lseek(a, (off_t) b, c)
161 # else
162 # define Lseek(a,b,c) llseek(a, (longest_int) b, c)
163 # endif
164 # else
165 # define Lseek(a,b,c) lseek(a, (off_t) b, c)
166 # endif
167 #else
168 # define Lseek(a,b,c) lseek(a, (off_t) b, c)
169 #endif
170
171
172 #ifndef IAC
173
174 /*
175 * Definitions for the TELNET protocol.
176 */
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... */
197
198 #define SYNCH 242 /* for telfunc calls */
199 #endif
200
201 #include "sio.h" /* Library header. */
202 #ifndef NO_UNIX_DOMAIN_SOCKETS
203 # include "usio.h"
204 #endif
205 /* eof */