4 // Copyright transferred from Raider Solutions, Inc to
5 // Kern Sibbald and John Walker by express permission.
7 // Copyright (C) 2004 Kern Sibbald and John Walker
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License as
11 // published by the Free Software Foundation; either version 2 of
12 // the License, or (at your option) any later version.
14 // This program is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // General Public License for more details.
19 // You should have received a copy of the GNU General Public
20 // License along with this program; if not, write to the Free
21 // Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
22 // MA 02111-1307, USA.
25 * Author : Christopher S. Hull
26 * Created On : Fri Jan 30 13:00:51 2004
27 * Last Modified By: Nicolas Boichat
28 * Last Modified On: Sat Apr 17 19:30:00 2004
38 #ifndef HAVE_WXCONSOLE
46 #include <sys/types.h>
69 #if defined HAVE_MINGW
80 #error should not be used under cygwin...
85 typedef UINT64 u_int64_t;
86 typedef UINT64 uint64_t;
87 typedef INT64 int64_t;
88 typedef UINT32 uint32_t;
90 typedef INT64 intmax_t;
91 typedef unsigned char uint8_t;
92 typedef float float32_t;
93 typedef unsigned short uint16_t;
94 typedef signed short int16_t;
96 typedef signed char int8_t;
100 typedef _dev_t dev_t;
101 #ifndef HAVE_WXCONSOLE
102 typedef __int64 ino_t;
103 typedef __int64 off_t; /* STDC=1 means we can define this */
107 typedef long _off_t; /* must be same as sys/types.h */
111 #ifndef HAVE_WXCONSOLE
117 typedef double float64_t;
118 typedef UINT32 u_int32_t;
119 typedef unsigned char u_int8_t;
120 typedef unsigned short u_int16_t;
128 typedef UINT32 key_t;
132 typedef UINT32 uid_t;
133 typedef UINT32 gid_t;
136 typedef UINT32 uid_t;
137 typedef UINT32 gid_t;
138 typedef UINT32 mode_t;
139 typedef INT64 ssize_t;
164 int strcasecmp(const char*, const char *);
165 int strncasecmp(const char*, const char *, int);
166 int gettimeofday(struct timeval *, struct timezone *);
189 #define S_IFMT 0170000 /* file type mask */
191 #define S_IFDIR 0040000 /* directory */
192 #define S_IFCHR 0020000 /* character special */
193 #define S_IFIFO 0010000 /* pipe */
195 #define S_IFREG 0100000 /* regular */
196 #define S_IREAD 0000400 /* read permission, owner */
197 #define S_IWRITE 0000200 /* write permission, owner */
198 #define S_IEXEC 0000100 /* execute/search permission, owner */
200 #define S_IRUSR S_IREAD
201 #define S_IWUSR S_IWRITE
202 #define S_IXUSR S_IEXEC
203 #define S_ISREG(x) (((x) & S_IFREG) == S_IFREG)
204 #define S_ISDIR(x) (((x) & S_IFDIR) == S_IFDIR)
207 #define S_ISFIFO(x) 0
210 #define S_IRGRP 000040
211 #define S_IWGRP 000020
212 #define S_IXGRP 000010
214 #define S_IROTH 00004
215 #define S_IWOTH 00002
216 #define S_IXOTH 00001
218 #define S_IRWXO 000007
219 #define S_IRWXG 000070
220 #define S_ISUID 004000
221 #define S_ISGID 002000
222 #define S_ISVTX 001000
223 #define S_ISSOCK(x) 0
227 #define O_RDONLY _O_RDONLY
228 #define O_WRONLY _O_WRONLY
229 #define O_RDWR _O_RDWR
230 #define O_CREAT _O_CREAT
231 #define O_TRUNC _O_TRUNC
233 #define isascii __isascii
234 #define toascii __toascii
235 #define iscsymf __iscsymf
236 #define iscsym __iscsym
241 int lchown(const char *, uid_t uid, gid_t gid);
242 int chown(const char *, uid_t uid, gid_t gid);
243 int chmod(const char *, mode_t mode);
244 off_t lseek(int, off_t, int);
245 int inet_aton(const char *cp, struct in_addr *inp);
246 int kill(int pid, int signo);
250 int waitpid(int, int *, int);
253 int utime(const char *filename, struct utimbuf *buf);
254 int open(const char *, int, int);
255 #define vsnprintf __vsnprintf
256 int __vsnprintf(char *s, size_t count, const char *format, va_list args);
258 #define vsprintf __vsprintf
259 int __vsprintf(char *s, const char *format, va_list args);
261 #define snprintf __snprintf
262 int __snprintf(char *str, size_t count, const char *fmt, ...);
264 #define sprintf __sprintf
265 int __sprintf(char *str, const char *fmt, ...);
267 #ifndef HAVE_WXCONSOLE
268 ssize_t read(int fd, void *, ssize_t nbytes);
269 ssize_t write(int fd, const void *, ssize_t nbytes);
277 #define WIFEXITED(x) 0
278 #define WEXITSTATUS(x) x
279 #define WIFSIGNALED(x) 0
283 #define HAVE_OLD_SOCKOPT
285 int readdir(unsigned int fd, struct dirent *dirp, unsigned int count);
286 int nanosleep(const struct timespec*, struct timespec *);
287 struct tm *localtime_r(const time_t *, struct tm *);
288 struct tm *gmtime_r(const time_t *, struct tm *);
289 long int random(void);
290 void srandom(unsigned int seed);
291 int lstat(const char *, struct stat *);
292 long pathconf(const char *, int);
293 int readlink(const char *, char *, int);
294 #define _PC_PATH_MAX 1
295 #define _PC_NAME_MAX 2
301 DIR *opendir(const char *name);
302 int closedir(DIR *dir);
312 struct passwd *getpwuid(uid_t);
313 struct group *getgrgid(uid_t);
322 void (*sa_handler)(int);
324 #define sigfillset(x)
325 #define sigaction(a, b, c)
327 #define mkdir(p, m) _mkdir(p)
328 #define chdir win32_chdir
329 int syslog(int, const char *, const char *);
334 int stat(const char *, struct stat *);
336 #define access _access
337 extern "C" _CRTIMP int __cdecl _access(const char *, int);
338 int execvp(const char *, char *[]);
339 extern "C" void * __cdecl _alloca(size_t);
343 #define getpid _getpid
346 #define gethostid() 0
350 #define getcwd win32_getcwd
351 #define chdir win32_chdir
352 char *win32_getcwd(char *buf, int maxlen);
353 int win32_chdir(const char *buf);
361 #endif /* __COMPAT_H_ */