302240dd5c7999c795d78a870f7a99c5a45b7e87
[reactos.git] / rosapps / applications / net / ncftp / libncftp / syshdrs.h
1 /* syshdrs.h
2 *
3 * Copyright (c) 1996-2001 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"
14 # include <winsock2.h> /* Includes <windows.h> */
15 //# include <shlobj.h>
16 # ifdef HAVE_UNISTD_H
17 # include <unistd.h>
18 # endif
19 # include <errno.h>
20 # include <stdio.h>
21 # include <string.h>
22 # ifdef HAVE_STRINGS_H
23 # include <strings.h>
24 # endif
25 # include <stddef.h>
26 # include <stdlib.h>
27 # include <ctype.h>
28 # include <stdarg.h>
29 # include <time.h>
30 # include <io.h>
31 # include <sys/types.h>
32 # include <sys/stat.h>
33 # include <fcntl.h>
34 # define strcasecmp stricmp
35 # define strncasecmp strnicmp
36 # define sleep WinSleep
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 lstat _stat
49 # define fstat _fstat
50 # define dup _dup
51 # define utime _utime
52 # define utimbuf _utimbuf
53 # endif
54 # ifndef unlink
55 # define unlink remove
56 # endif
57 # define NO_SIGNALS 1
58 # define USE_SIO 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/stat.h>
69 #include <sys/time.h>
70 #include <sys/socket.h>
71 #include <sys/ioctl.h>
72 #include <sys/wait.h>
73 #if !defined(HAVE_GETCWD) && defined(HAVE_GETWD)
74 # include <sys/param.h>
75 #endif
76
77 #include <netinet/in.h>
78 #include <arpa/inet.h>
79 #include <arpa/telnet.h>
80 #include <netdb.h>
81 #include <errno.h>
82 #include <stdio.h>
83 #include <string.h>
84 #ifdef HAVE_STRINGS_H
85 # include <strings.h>
86 #endif
87 #include <stddef.h>
88 #include <stdlib.h>
89 #include <ctype.h>
90 #include <signal.h>
91 #include <setjmp.h>
92 #include <stdarg.h>
93 #include <time.h>
94 #include <pwd.h>
95 #include <dirent.h>
96 #include <fcntl.h>
97
98 #ifdef HAVE_NET_ERRNO_H
99 # include <net/errno.h>
100 #endif
101 #ifdef HAVE_ARPA_NAMESER_H
102 # include <arpa/nameser.h>
103 #endif
104 #ifdef HAVE_NSERVE_H
105 # include <nserve.h>
106 #endif
107 #ifdef HAVE_RESOLV_H
108 # include <resolv.h>
109 #endif
110 #ifdef CAN_USE_SYS_SELECT_H
111 # include <sys/select.h>
112 #endif
113
114 #ifdef HAVE_GETCWD
115 # ifndef HAVE_UNISTD_H
116 extern char *getcwd();
117 # endif
118 #else
119 # ifdef HAVE_GETWD
120 # include <sys/param.h>
121 # ifndef MAXPATHLEN
122 # define MAXPATHLEN 1024
123 # endif
124 extern char *getwd(char *);
125 # endif
126 #endif
127
128 #endif /* UNIX */
129
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 #ifdef HAVE_UTIME_H
202 # include <utime.h>
203 #else
204 struct utimbuf { time_t actime, modtime; };
205 #endif
206
207
208 #ifdef HAVE_LIBSOCKS5
209 # define SOCKS 5
210 # include <socks.h>
211 #endif
212
213 #if 1 /* %config2% -- set by configure script -- do not modify */
214 # ifndef USE_SIO
215 # define USE_SIO 1
216 # endif
217 # ifndef NO_SIGNALS
218 # define NO_SIGNALS 1
219 # endif
220 #else
221 # ifndef USE_SIO
222 # define USE_SIO 0
223 # endif
224 /* #undef NO_SIGNALS */
225 #endif
226
227 #if USE_SIO
228 # include "sio/sio.h" /* Library header. */
229 #endif
230
231 #include "Strn/Strn.h" /* Library header. */
232 #include "ncftp.h" /* Library header. */
233
234 #include "util.h"
235 #include "ftp.h"
236
237 /* eof */