344db2ec41c30cc371b1b22a83ee399923f89223
[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 # undef strcasecmp
35 # define strcasecmp stricmp
36 # undef strncasecmp
37 # define strncasecmp strnicmp
38 # define sleep WinSleep
39 # ifndef S_ISREG
40 # define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
41 # define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
42 # endif
43 # ifndef open
44 # define open _open
45 # define write _write
46 # define read _read
47 # define close _close
48 # define lseek _lseek
49 # define stat _stat
50 # define lstat _stat
51 # define fstat _fstat
52 # define dup _dup
53 # define utime _utime
54 # define utimbuf _utimbuf
55 # endif
56 # ifndef unlink
57 # define unlink remove
58 # endif
59 # define NO_SIGNALS 1
60 # define USE_SIO 1
61 #else /* UNIX */
62
63 #if defined(AIX) || defined(_AIX)
64 # define _ALL_SOURCE 1
65 #endif
66 #ifdef HAVE_UNISTD_H
67 # include <unistd.h>
68 #endif
69 #include <sys/types.h>
70 #include <sys/stat.h>
71 #include <sys/time.h>
72 #include <sys/socket.h>
73 #include <sys/ioctl.h>
74 #include <sys/wait.h>
75 #if !defined(HAVE_GETCWD) && defined(HAVE_GETWD)
76 # include <sys/param.h>
77 #endif
78
79 #include <netinet/in.h>
80 #include <arpa/inet.h>
81 #include <arpa/telnet.h>
82 #include <netdb.h>
83 #include <errno.h>
84 #include <stdio.h>
85 #include <string.h>
86 #ifdef HAVE_STRINGS_H
87 # include <strings.h>
88 #endif
89 #include <stddef.h>
90 #include <stdlib.h>
91 #include <ctype.h>
92 #include <signal.h>
93 #include <setjmp.h>
94 #include <stdarg.h>
95 #include <time.h>
96 #include <pwd.h>
97 #include <dirent.h>
98 #include <fcntl.h>
99
100 #ifdef HAVE_NET_ERRNO_H
101 # include <net/errno.h>
102 #endif
103 #ifdef HAVE_ARPA_NAMESER_H
104 # include <arpa/nameser.h>
105 #endif
106 #ifdef HAVE_NSERVE_H
107 # include <nserve.h>
108 #endif
109 #ifdef HAVE_RESOLV_H
110 # include <resolv.h>
111 #endif
112 #ifdef CAN_USE_SYS_SELECT_H
113 # include <sys/select.h>
114 #endif
115
116 #ifdef HAVE_GETCWD
117 # ifndef HAVE_UNISTD_H
118 extern char *getcwd();
119 # endif
120 #else
121 # ifdef HAVE_GETWD
122 # include <sys/param.h>
123 # ifndef MAXPATHLEN
124 # define MAXPATHLEN 1024
125 # endif
126 extern char *getwd(char *);
127 # endif
128 #endif
129
130 #endif /* UNIX */
131
132
133 #if defined(HAVE_LONG_LONG) && defined(HAVE_OPEN64)
134 # define Open open64
135 #else
136 # define Open open
137 #endif
138
139 #if defined(HAVE_LONG_LONG) && defined(HAVE_STAT64) && defined(HAVE_STRUCT_STAT64)
140 # define Stat stat64
141 # ifdef HAVE_FSTAT64
142 # define Fstat fstat64
143 # else
144 # define Fstat fstat
145 # endif
146 # ifdef HAVE_LSTAT64
147 # define Lstat lstat64
148 # else
149 # define Lstat lstat
150 # endif
151 #else
152 # define Stat stat
153 # define Fstat fstat
154 # define Lstat lstat
155 #endif
156
157 #if defined(HAVE_LONG_LONG) && defined(HAVE_LSEEK64)
158 # define Lseek(a,b,c) lseek64(a, (longest_int) b, c)
159 #elif defined(HAVE_LONG_LONG) && defined(HAVE_LLSEEK)
160 # if 1
161 # if defined(LINUX) && (LINUX <= 23000)
162 # define Lseek(a,b,c) lseek(a, (off_t) b, c)
163 # else
164 # define Lseek(a,b,c) llseek(a, (longest_int) b, c)
165 # endif
166 # else
167 # define Lseek(a,b,c) lseek(a, (off_t) b, c)
168 # endif
169 #else
170 # define Lseek(a,b,c) lseek(a, (off_t) b, c)
171 #endif
172
173
174 #ifndef IAC
175
176 /*
177 * Definitions for the TELNET protocol.
178 */
179 #define IAC 255 /* interpret as command: */
180 #define DONT 254 /* you are not to use option */
181 #define DO 253 /* please, you use option */
182 #define WONT 252 /* I won't use option */
183 #define WILL 251 /* I will use option */
184 #define SB 250 /* interpret as subnegotiation */
185 #define GA 249 /* you may reverse the line */
186 #define EL 248 /* erase the current line */
187 #define EC 247 /* erase the current character */
188 #define AYT 246 /* are you there */
189 #define AO 245 /* abort output--but let prog finish */
190 #define IP 244 /* interrupt process--permanently */
191 #define BREAK 243 /* break */
192 #define DM 242 /* data mark--for connect. cleaning */
193 #define NOP 241 /* nop */
194 #define SE 240 /* end sub negotiation */
195 #define EOR 239 /* end of record (transparent mode) */
196 #define ABORT 238 /* Abort process */
197 #define SUSP 237 /* Suspend process */
198 #define xEOF 236 /* End of file: EOF is already used... */
199
200 #define SYNCH 242 /* for telfunc calls */
201 #endif
202
203 #ifdef HAVE_UTIME_H
204 # include <utime.h>
205 #else
206 struct utimbuf { time_t actime, modtime; };
207 #endif
208
209
210 #ifdef HAVE_LIBSOCKS5
211 # define SOCKS 5
212 # include <socks.h>
213 #endif
214
215 #if 1 /* %config2% -- set by configure script -- do not modify */
216 # ifndef USE_SIO
217 # define USE_SIO 1
218 # endif
219 # ifndef NO_SIGNALS
220 # define NO_SIGNALS 1
221 # endif
222 #else
223 # ifndef USE_SIO
224 # define USE_SIO 0
225 # endif
226 /* #undef NO_SIGNALS */
227 #endif
228
229 #if USE_SIO
230 # include "sio/sio.h" /* Library header. */
231 #endif
232
233 #include "Strn/Strn.h" /* Library header. */
234 #include "ncftp.h" /* Library header. */
235
236 #include "util.h"
237 #include "ftp.h"
238
239 /* eof */