check
[oweals/gnunet.git] / src / include / plibc.h
index 60d5778b237abd3f25f869df4f65a2a5d75a74ff..a59e53de9c982dfc6e643e9591c67f7fe5b394ec 100644 (file)
@@ -22,7 +22,7 @@
  * @brief PlibC header
  * @attention This file is usually not installed under Unix,
  *            so ship it with your application
- * @version $Revision: 58 $
+ * @version $Revision: 69 $
  */
 
 #ifndef _PLIBC_H_
@@ -50,8 +50,9 @@ extern "C" {
   #include "langinfo.h"
 #endif
 
-#include <windows.h>
+#include <winsock2.h>
 #include <ws2tcpip.h>
+#include <windows.h>
 #include <sys/types.h>
 #include <time.h>
 #include <stdio.h>
@@ -94,7 +95,7 @@ struct sockaddr_un {
 };
 
 #ifndef pid_t
-       #define pid_t int
+  #define pid_t DWORD
 #endif
 
 #ifndef error_t
@@ -109,6 +110,12 @@ struct sockaddr_un {
   #define MSG_DONTWAIT 0
 #endif
 
+enum
+{
+  _SC_PAGESIZE = 30,
+  _SC_PAGE_SIZE = 30
+};
+
 /* Thanks to the Cygwin project */
 #define ENOCSI 43      /* No CSI structure available */
 #define EL2HLT 44      /* Level 2 halted */
@@ -328,7 +335,7 @@ BOOL _plibc_CreateShortcut(const char *pszSrc, const char *pszDest);
 BOOL _plibc_DereferenceShortcut(char *pszShortcut);
 char *plibc_ChooseDir(char *pszTitle, unsigned long ulFlags);
 char *plibc_ChooseFile(char *pszTitle, unsigned long ulFlags);
-long QueryRegistry(HKEY hMainKey, char *pszKey, char *pszSubKey,
+long QueryRegistry(HKEY hMainKey, const char *pszKey, const char *pszSubKey,
               char *pszBuffer, long *pdLength);
 
 BOOL __win_IsHandleMarkedAsBlocking(int hHandle);
@@ -390,6 +397,7 @@ int _win_remove(const char *path);
 int _win_rename(const char *oldname, const char *newname);
 int _win_stat(const char *path, struct stat *buffer);
 int _win_stat64(const char *path, struct stat64 *buffer);
+long _win_sysconf(int name);
 int _win_unlink(const char *filename);
 int _win_write(int fildes, const void *buf, size_t nbyte);
 int _win_read(int fildes, void *buf, size_t nbyte);
@@ -463,8 +471,8 @@ char *strcasestr(const char *haystack_start, const char *needle_start);
 #ifndef WINDOWS
  #define DIR_SEPARATOR '/'
  #define DIR_SEPARATOR_STR "/"
- #define PATH_SEPARATOR ';'
- #define PATH_SEPARATOR_STR ";"
+ #define PATH_SEPARATOR ':'
+ #define PATH_SEPARATOR_STR ":"
  #define NEWLINE "\n"
 
 #ifdef ENABLE_NLS
@@ -491,6 +499,7 @@ char *strcasestr(const char *haystack_start, const char *needle_start);
  #define RENAME(o, n) rename(o, n)
  #define STAT(p, b) stat(p, b)
  #define STAT64(p, b) stat64(p, b)
+ #define SYSCONF(n) sysconf(n)
  #define UNLINK(f) unlink(f)
  #define WRITE(f, b, n) write(f, b, n)
  #define READ(f, b, n) read(f, b, n)
@@ -556,8 +565,8 @@ char *strcasestr(const char *haystack_start, const char *needle_start);
 #else
  #define DIR_SEPARATOR '\\'
  #define DIR_SEPARATOR_STR "\\"
- #define PATH_SEPARATOR ':'
- #define PATH_SEPARATOR_STR ":"
+ #define PATH_SEPARATOR ';'
+ #define PATH_SEPARATOR_STR ";"
  #define NEWLINE "\r\n"
 
 #ifdef ENABLE_NLS
@@ -585,6 +594,7 @@ char *strcasestr(const char *haystack_start, const char *needle_start);
  #define RENAME(o, n) _win_rename(o, n)
  #define STAT(p, b) _win_stat(p, b)
  #define STAT64(p, b) _win_stat64(p, b)
+ #define SYSCONF(n) _win_sysconf(n)
  #define UNLINK(f) _win_unlink(f)
  #define WRITE(f, b, n) _win_write(f, b, n)
  #define READ(f, b, n) _win_read(f, b, n)