diff options
author | Nils Durner <durner@gnunet.org> | 2005-07-14 11:13:29 +0000 |
---|---|---|
committer | Nils Durner <durner@gnunet.org> | 2005-07-14 11:13:29 +0000 |
commit | 018dfef48eb7e56834f994673571ed225c0c79ee (patch) | |
tree | ab43ed9b08083b7e7f0cece7cc132cbefd6bb5a5 /src/include/plibc.h | |
parent | 1b2b3e1b53d678d407ae8ee0ca0a227e942180a8 (diff) | |
download | gnunet-gtk-018dfef48eb7e56834f994673571ed225c0c79ee.tar.gz gnunet-gtk-018dfef48eb7e56834f994673571ed225c0c79ee.zip |
update
Diffstat (limited to 'src/include/plibc.h')
-rw-r--r-- | src/include/plibc.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/include/plibc.h b/src/include/plibc.h index f06e5c6c..6fce604f 100644 --- a/src/include/plibc.h +++ b/src/include/plibc.h | |||
@@ -22,7 +22,7 @@ | |||
22 | * @brief PlibC header | 22 | * @brief PlibC header |
23 | * @attention This file is usually not installed under Unix, | 23 | * @attention This file is usually not installed under Unix, |
24 | * so ship it with your application | 24 | * so ship it with your application |
25 | * @version $Revision: 1.19 $ | 25 | * @version $Revision: 1.24 $ |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #ifndef _PLIBC_H_ | 28 | #ifndef _PLIBC_H_ |
@@ -43,6 +43,7 @@ extern "C" { | |||
43 | #ifdef WINDOWS | 43 | #ifdef WINDOWS |
44 | 44 | ||
45 | #include <windows.h> | 45 | #include <windows.h> |
46 | #include <Ws2tcpip.h> | ||
46 | #include <time.h> | 47 | #include <time.h> |
47 | #include <stdio.h> | 48 | #include <stdio.h> |
48 | #include <sys/types.h> | 49 | #include <sys/types.h> |
@@ -62,11 +63,21 @@ extern "C" { | |||
62 | 63 | ||
63 | #define socklen_t int | 64 | #define socklen_t int |
64 | #define ssize_t int | 65 | #define ssize_t int |
66 | #ifndef HAVE_FTRUNCATE | ||
65 | #define ftruncate chsize | 67 | #define ftruncate chsize |
68 | #endif | ||
66 | #define off_t int | 69 | #define off_t int |
67 | #define int64_t long long | 70 | #define int64_t long long |
68 | #define int32_t long | 71 | #define int32_t long |
69 | 72 | ||
73 | #ifndef pid_t | ||
74 | #define pid_t int | ||
75 | #endif | ||
76 | |||
77 | #ifndef WEXITSTATUS | ||
78 | #define WEXITSTATUS(status) (((status) & 0xff00) >> 8) | ||
79 | #endif | ||
80 | |||
70 | /* Thanks to the Cygwin project */ | 81 | /* Thanks to the Cygwin project */ |
71 | #define ENOCSI 43 /* No CSI structure available */ | 82 | #define ENOCSI 43 /* No CSI structure available */ |
72 | #define EL2HLT 44 /* Level 2 halted */ | 83 | #define EL2HLT 44 /* Level 2 halted */ |
@@ -327,6 +338,7 @@ int _win_rmdir(const char *path); | |||
327 | int _win_access( const char *path, int mode ); | 338 | int _win_access( const char *path, int mode ); |
328 | int _win_chmod(const char *filename, int pmode); | 339 | int _win_chmod(const char *filename, int pmode); |
329 | char *realpath(const char *file_name, char *resolved_name); | 340 | char *realpath(const char *file_name, char *resolved_name); |
341 | long _win_random(void); | ||
330 | int _win_remove(const char *path); | 342 | int _win_remove(const char *path); |
331 | int _win_rename(const char *oldname, const char *newname); | 343 | int _win_rename(const char *oldname, const char *newname); |
332 | int _win_stat(const char *path, struct stat *buffer); | 344 | int _win_stat(const char *path, struct stat *buffer); |
@@ -356,6 +368,7 @@ int _win_vfscanf(FILE *stream, const char *format, va_list arg_ptr); | |||
356 | int _win_vscanf(const char *format, va_list arg_ptr); | 368 | int _win_vscanf(const char *format, va_list arg_ptr); |
357 | int _win_scanf(const char *format, ...); | 369 | int _win_scanf(const char *format, ...); |
358 | int _win_fscanf(FILE *stream, const char *format, ...); | 370 | int _win_fscanf(FILE *stream, const char *format, ...); |
371 | pid_t _win_waitpid(pid_t pid, int *stat_loc, int options); | ||
359 | int _win_bind(SOCKET s, const struct sockaddr *name, int namelen); | 372 | int _win_bind(SOCKET s, const struct sockaddr *name, int namelen); |
360 | int _win_connect(SOCKET s,const struct sockaddr *name, int namelen); | 373 | int _win_connect(SOCKET s,const struct sockaddr *name, int namelen); |
361 | int _win_getpeername(SOCKET s, struct sockaddr *name, | 374 | int _win_getpeername(SOCKET s, struct sockaddr *name, |
@@ -423,6 +436,7 @@ size_t strnlen (const char *str, size_t maxlen); | |||
423 | #define MMAP(s, l, p, f, d, o) mmap(s, l, p, f, d, o) | 436 | #define MMAP(s, l, p, f, d, o) mmap(s, l, p, f, d, o) |
424 | #define MUNMAP(s, l) munmap(s, l) | 437 | #define MUNMAP(s, l) munmap(s, l) |
425 | #define STRERROR(i) strerror(i) | 438 | #define STRERROR(i) strerror(i) |
439 | #define RANDOM() random() | ||
426 | #define READLINK(p, b, s) readlink(p, b, s) | 440 | #define READLINK(p, b, s) readlink(p, b, s) |
427 | #define LSTAT(p, b) lstat(p, b) | 441 | #define LSTAT(p, b) lstat(p, b) |
428 | #define PRINTF(f, ...) printf(f , __VA_ARGS__) | 442 | #define PRINTF(f, ...) printf(f , __VA_ARGS__) |
@@ -439,6 +453,7 @@ size_t strnlen (const char *str, size_t maxlen); | |||
439 | #define VSCANF(f, a) vscanf(f, a) | 453 | #define VSCANF(f, a) vscanf(f, a) |
440 | #define SCANF(f, ...) scanf(f, __VA_ARGS__) | 454 | #define SCANF(f, ...) scanf(f, __VA_ARGS__) |
441 | #define FSCANF(s, f, ...) fscanf(s, f, __VA_ARGS__) | 455 | #define FSCANF(s, f, ...) fscanf(s, f, __VA_ARGS__) |
456 | #define WAITPID(p, s, o) waitpid(p, s, o) | ||
442 | #define ACCEPT(s, a, l) accept(s, a, l) | 457 | #define ACCEPT(s, a, l) accept(s, a, l) |
443 | #define BIND(s, n, l) bind(s, n, l) | 458 | #define BIND(s, n, l) bind(s, n, l) |
444 | #define CONNECT(s, n, l) connect(s, n, l) | 459 | #define CONNECT(s, n, l) connect(s, n, l) |
@@ -475,6 +490,7 @@ size_t strnlen (const char *str, size_t maxlen); | |||
475 | #define ACCESS(p, m) _win_access(p, m) | 490 | #define ACCESS(p, m) _win_access(p, m) |
476 | #define CHMOD(f, p) _win_chmod(f, p) | 491 | #define CHMOD(f, p) _win_chmod(f, p) |
477 | #define PIPE(h) _win_pipe(h) | 492 | #define PIPE(h) _win_pipe(h) |
493 | #define RANDOM() _win_random() | ||
478 | #define REMOVE(p) _win_remove(p) | 494 | #define REMOVE(p) _win_remove(p) |
479 | #define RENAME(o, n) _win_rename(o, n) | 495 | #define RENAME(o, n) _win_rename(o, n) |
480 | #define STAT(p, b) _win_stat(p, b) | 496 | #define STAT(p, b) _win_stat(p, b) |
@@ -503,6 +519,7 @@ size_t strnlen (const char *str, size_t maxlen); | |||
503 | #define VSCANF(f, a) _win_vscanf(f, a) | 519 | #define VSCANF(f, a) _win_vscanf(f, a) |
504 | #define SCANF(f, ...) _win_scanf(f, __VA_ARGS__) | 520 | #define SCANF(f, ...) _win_scanf(f, __VA_ARGS__) |
505 | #define FSCANF(s, f, ...) _win_fscanf(s, f, __VA_ARGS__) | 521 | #define FSCANF(s, f, ...) _win_fscanf(s, f, __VA_ARGS__) |
522 | #define WAITPID(p, s, o) _win_waitpid(p, s, o) | ||
506 | #define ACCEPT(s, a, l) _win_accept(s, a, l) | 523 | #define ACCEPT(s, a, l) _win_accept(s, a, l) |
507 | #define BIND(s, n, l) _win_bind(s, n, l) | 524 | #define BIND(s, n, l) _win_bind(s, n, l) |
508 | #define CONNECT(s, n, l) _win_connect(s, n, l) | 525 | #define CONNECT(s, n, l) _win_connect(s, n, l) |