Merge my current work done on the kd++ branch:
[reactos.git] / rosapps / applications / net / ncftp / ncftp / syshdrs.h
1 /* syshdrs.h
2 *
3 * Copyright (c) 1992-2001 by Mike Gleason.
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 # define SELECT_TYPE_ARG1 int
14 # define SELECT_TYPE_ARG234 (fd_set *)
15 # define SELECT_TYPE_ARG5 (struct timeval *)
16 # define STDC_HEADERS 1
17 # define HAVE_GETHOSTNAME 1
18 # define HAVE_MKTIME 1
19 # define HAVE_SOCKET 1
20 # define HAVE_STRSTR 1
21 # define HAVE_MEMMOVE 1
22 # define HAVE_LONG_FILE_NAMES 1
23 # include <winsock2.h> /* Includes <windows.h> */
24 //# include <shlobj.h>
25 # ifdef HAVE_UNISTD_H
26 # include <unistd.h>
27 # else
28 # include <process.h>
29 # endif
30 # include <errno.h>
31 # include <stdio.h>
32 # include <string.h>
33 # ifdef HAVE_STRINGS_H
34 # include <strings.h>
35 # endif
36 # include <stddef.h>
37 # include <stdlib.h>
38 # include <ctype.h>
39 # include <stdarg.h>
40 # include <time.h>
41 # include <io.h>
42 # include <sys/types.h>
43 # include <sys/stat.h>
44 # include <fcntl.h>
45 # include <signal.h>
46 # include <assert.h>
47 # undef strcasecmp
48 # define strcasecmp stricmp
49 # undef strncasecmp
50 # define strncasecmp strnicmp
51 # define sleep WinSleep
52 # ifndef S_ISREG
53 # define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
54 # define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
55 # endif
56 # ifndef open
57 # define open _open
58 # define write _write
59 # define read _read
60 # define close _close
61 # define lseek _lseek
62 # define stat _stat
63 # define lstat _stat
64 # define fstat _fstat
65 # define dup _dup
66 # define utime _utime
67 # define utimbuf _utimbuf
68 # define chdir _chdir
69 # define rmdir _rmdir
70 # define getpid _getpid
71 # define popen _popen
72 # define pclose _pclose
73 # endif
74 # ifndef unlink
75 # define unlink remove
76 # endif
77 # define uid_t int
78 # define NO_SIGNALS 1
79 # define USE_SIO 1
80 # ifndef FOPEN_READ_TEXT
81 # define FOPEN_READ_TEXT "rt"
82 # define FOPEN_WRITE_TEXT "wt"
83 # define FOPEN_APPEND_TEXT "at"
84 # endif
85 #else /* UNIX */
86 # if defined(AIX) || defined(_AIX)
87 # define _ALL_SOURCE 1
88 # endif
89 # ifdef HAVE_UNISTD_H
90 # include <unistd.h>
91 # endif
92 # include <sys/types.h>
93 # include <sys/stat.h>
94 # include <sys/socket.h>
95 # include <sys/wait.h>
96 # ifdef CAN_USE_SYS_SELECT_H
97 # include <sys/select.h>
98 # endif
99 # if defined(HAVE_SYS_UTSNAME_H) && defined(HAVE_UNAME)
100 # include <sys/utsname.h>
101 # endif
102 # include <netinet/in.h>
103 # include <arpa/inet.h>
104 # include <netdb.h>
105 # include <errno.h>
106 # include <stdio.h>
107 # include <string.h>
108 # ifdef HAVE_STRINGS_H
109 # include <strings.h>
110 # endif
111 # include <stddef.h>
112 # include <stdlib.h>
113 # include <ctype.h>
114 # include <signal.h>
115 # include <setjmp.h>
116 # include <stdarg.h>
117 # include <assert.h>
118 # include <time.h>
119 # include <pwd.h>
120 # include <fcntl.h>
121 # if defined(HAVE_SYS_IOCTL_H) && defined(HAVE_TERMIOS_H)
122 # include <sys/ioctl.h>
123 # include <termios.h>
124 # endif
125 # ifdef HAVE_LOCALE_H
126 # include <locale.h>
127 # endif
128 # ifdef HAVE_GETCWD
129 # ifndef HAVE_UNISTD_H
130 extern char *getcwd();
131 # endif
132 # else
133 # ifdef HAVE_GETWD
134 # include <sys/param.h>
135 # ifndef MAXPATHLEN
136 # define MAXPATHLEN 1024
137 # endif
138 extern char *getwd(char *);
139 # endif
140 # endif
141 # ifndef FOPEN_READ_TEXT
142 # define FOPEN_READ_TEXT "r"
143 # define FOPEN_WRITE_TEXT "w"
144 # define FOPEN_APPEND_TEXT "a"
145 # endif
146 #endif /* UNIX */
147
148 #ifndef STDIN_FILENO
149 # define STDIN_FILENO 0
150 # define STDOUT_FILENO 1
151 # define STDERR_FILENO 2
152 #endif
153
154 #define NDEBUG 1 /* For assertions. */
155
156 #if defined(HAVE_LONG_LONG) && defined(HAVE_OPEN64)
157 # define Open open64
158 #else
159 # define Open open
160 #endif
161
162 #if defined(HAVE_LONG_LONG) && defined(HAVE_STAT64) && defined(HAVE_STRUCT_STAT64)
163 # define Stat stat64
164 # ifdef HAVE_FSTAT64
165 # define Fstat fstat64
166 # else
167 # define Fstat fstat
168 # endif
169 # ifdef HAVE_LSTAT64
170 # define Lstat lstat64
171 # else
172 # define Lstat lstat
173 # endif
174 #else
175 # define Stat stat
176 # define Fstat fstat
177 # define Lstat lstat
178 #endif
179
180 #if defined(HAVE_LONG_LONG) && defined(HAVE_LSEEK64)
181 # define Lseek(a,b,c) lseek64(a, (longest_int) b, c)
182 #elif defined(HAVE_LONG_LONG) && defined(HAVE_LLSEEK)
183 # if 1
184 # if defined(LINUX) && (LINUX <= 23000)
185 # define Lseek(a,b,c) lseek(a, (off_t) b, c)
186 # else
187 # define Lseek(a,b,c) llseek(a, (longest_int) b, c)
188 # endif
189 # else
190 # define Lseek(a,b,c) lseek(a, (off_t) b, c)
191 # endif
192 #else
193 # define Lseek(a,b,c) lseek(a, (off_t) b, c)
194 #endif
195
196
197 #include "Strn/Strn.h" /* Library header. */
198 #include "libncftp/ncftp.h" /* Library header. */