aboutsummaryrefslogtreecommitdiff
path: root/src/include/plibc.h
diff options
context:
space:
mode:
authorNils Durner <durner@gnunet.org>2010-10-08 17:34:16 +0000
committerNils Durner <durner@gnunet.org>2010-10-08 17:34:16 +0000
commitbf373f6c39138016ab84928d4e29780d1c02a424 (patch)
treedb3df93992a47d6e094e3cad536eada792aee9e4 /src/include/plibc.h
parent60d8d0fe3dcc6cca06ac73cc63c7c348021413e2 (diff)
downloadgnunet-bf373f6c39138016ab84928d4e29780d1c02a424.tar.gz
gnunet-bf373f6c39138016ab84928d4e29780d1c02a424.zip
up
Diffstat (limited to 'src/include/plibc.h')
-rw-r--r--src/include/plibc.h31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/include/plibc.h b/src/include/plibc.h
index 82225019d..284d7efd4 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: 55 $ 25 * @version $Revision: 66 $
26 */ 26 */
27 27
28#ifndef _PLIBC_H_ 28#ifndef _PLIBC_H_
@@ -51,7 +51,8 @@ extern "C" {
51#endif 51#endif
52 52
53#include <windows.h> 53#include <windows.h>
54#include <Ws2tcpip.h> 54#include <ws2tcpip.h>
55#include <sys/types.h>
55#include <time.h> 56#include <time.h>
56#include <stdio.h> 57#include <stdio.h>
57#include <sys/types.h> 58#include <sys/types.h>
@@ -70,12 +71,6 @@ extern "C" {
70#define Li2Double(x) ((double)((x).HighPart) * 4.294967296E9 + \ 71#define Li2Double(x) ((double)((x).HighPart) * 4.294967296E9 + \
71 (double)((x).LowPart)) 72 (double)((x).LowPart))
72 73
73#define socklen_t int
74#define ssize_t int
75#define off_t int
76#define int64_t long long
77#define int32_t long
78
79struct stat64 74struct stat64
80{ 75{
81 _dev_t st_dev; 76 _dev_t st_dev;
@@ -91,6 +86,13 @@ struct stat64
91 __time64_t st_ctime; 86 __time64_t st_ctime;
92}; 87};
93 88
89typedef unsigned int sa_family_t;
90
91struct sockaddr_un {
92 short sun_family; /*AF_UNIX*/
93 char sun_path[108]; /*path name */
94};
95
94#ifndef pid_t 96#ifndef pid_t
95 #define pid_t HANDLE 97 #define pid_t HANDLE
96#endif 98#endif
@@ -107,6 +109,12 @@ struct stat64
107 #define MSG_DONTWAIT 0 109 #define MSG_DONTWAIT 0
108#endif 110#endif
109 111
112enum
113{
114 _SC_PAGESIZE = 30,
115 _SC_PAGE_SIZE = 30
116};
117
110/* Thanks to the Cygwin project */ 118/* Thanks to the Cygwin project */
111#define ENOCSI 43 /* No CSI structure available */ 119#define ENOCSI 43 /* No CSI structure available */
112#define EL2HLT 44 /* Level 2 halted */ 120#define EL2HLT 44 /* Level 2 halted */
@@ -388,6 +396,7 @@ int _win_remove(const char *path);
388int _win_rename(const char *oldname, const char *newname); 396int _win_rename(const char *oldname, const char *newname);
389int _win_stat(const char *path, struct stat *buffer); 397int _win_stat(const char *path, struct stat *buffer);
390int _win_stat64(const char *path, struct stat64 *buffer); 398int _win_stat64(const char *path, struct stat64 *buffer);
399long _win_sysconf(int name);
391int _win_unlink(const char *filename); 400int _win_unlink(const char *filename);
392int _win_write(int fildes, const void *buf, size_t nbyte); 401int _win_write(int fildes, const void *buf, size_t nbyte);
393int _win_read(int fildes, void *buf, size_t nbyte); 402int _win_read(int fildes, void *buf, size_t nbyte);
@@ -462,7 +471,7 @@ char *strcasestr(const char *haystack_start, const char *needle_start);
462 #define DIR_SEPARATOR '/' 471 #define DIR_SEPARATOR '/'
463 #define DIR_SEPARATOR_STR "/" 472 #define DIR_SEPARATOR_STR "/"
464 #define PATH_SEPARATOR ';' 473 #define PATH_SEPARATOR ';'
465 #define PATH_SEPARATOR_STR ";" 474 #define PATH_SEPARATOR_STR ":"
466 #define NEWLINE "\n" 475 #define NEWLINE "\n"
467 476
468#ifdef ENABLE_NLS 477#ifdef ENABLE_NLS
@@ -489,6 +498,7 @@ char *strcasestr(const char *haystack_start, const char *needle_start);
489 #define RENAME(o, n) rename(o, n) 498 #define RENAME(o, n) rename(o, n)
490 #define STAT(p, b) stat(p, b) 499 #define STAT(p, b) stat(p, b)
491 #define STAT64(p, b) stat64(p, b) 500 #define STAT64(p, b) stat64(p, b)
501 #define SYSCONF(n) sysconf(n)
492 #define UNLINK(f) unlink(f) 502 #define UNLINK(f) unlink(f)
493 #define WRITE(f, b, n) write(f, b, n) 503 #define WRITE(f, b, n) write(f, b, n)
494 #define READ(f, b, n) read(f, b, n) 504 #define READ(f, b, n) read(f, b, n)
@@ -555,7 +565,7 @@ char *strcasestr(const char *haystack_start, const char *needle_start);
555 #define DIR_SEPARATOR '\\' 565 #define DIR_SEPARATOR '\\'
556 #define DIR_SEPARATOR_STR "\\" 566 #define DIR_SEPARATOR_STR "\\"
557 #define PATH_SEPARATOR ':' 567 #define PATH_SEPARATOR ':'
558 #define PATH_SEPARATOR_STR ":" 568 #define PATH_SEPARATOR_STR ";"
559 #define NEWLINE "\r\n" 569 #define NEWLINE "\r\n"
560 570
561#ifdef ENABLE_NLS 571#ifdef ENABLE_NLS
@@ -583,6 +593,7 @@ char *strcasestr(const char *haystack_start, const char *needle_start);
583 #define RENAME(o, n) _win_rename(o, n) 593 #define RENAME(o, n) _win_rename(o, n)
584 #define STAT(p, b) _win_stat(p, b) 594 #define STAT(p, b) _win_stat(p, b)
585 #define STAT64(p, b) _win_stat64(p, b) 595 #define STAT64(p, b) _win_stat64(p, b)
596 #define SYSCONF(n) _win_sysconf(n)
586 #define UNLINK(f) _win_unlink(f) 597 #define UNLINK(f) _win_unlink(f)
587 #define WRITE(f, b, n) _win_write(f, b, n) 598 #define WRITE(f, b, n) _win_write(f, b, n)
588 #define READ(f, b, n) _win_read(f, b, n) 599 #define READ(f, b, n) _win_read(f, b, n)