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