Import of code from heimdal
[openafs.git] / src / external / heimdal / roken / roken.h.in
index 7194edf..598ff24 100644 (file)
@@ -39,6 +39,7 @@
 #include <stdint.h>
 #endif
 #include <string.h>
+#include <limits.h>
 #include <signal.h>
 
 #ifndef ROKEN_LIB_FUNCTION
@@ -259,6 +260,10 @@ struct sockaddr_dl;
 #include <dirent.h>
 #endif
 
+#ifdef HAVE_DIRECT_H
+#include <direct.h>
+#endif
+
 #ifdef BACKSLASH_PATH_DELIM
 #define rk_PATH_DELIM '\\'
 #endif
@@ -352,12 +357,29 @@ rk_vsnprintf (char *str, size_t sz, const char *format, va_list args);
  S_ISBLK(m)
 */
 
+/* The following symbolic constants are provided for rk_mkdir mode */
+
+#define S_IRWXU 00700 /* user (file owner) has read, write and execute permission */
+#define S_IRUSR 00400 /* user has read permission */
+#define S_IWUSR 00200 /* user has write permission */
+#define S_IXUSR 00100 /* user has execute permission */
+#define S_IRWXG 00070 /* group has read, write and execute permission */
+#define S_IRGRP 00040 /* group has read permission */
+#define S_IWGRP 00020 /* group has write permission */
+#define S_IXGRP 00010 /* group has execute permission */
+#define S_IRWXO 00007 /* others have read, write and execute permission */
+#define S_IROTH 00004 /* others have read permission */
+#define S_IWOTH 00002 /* others have write permission */
+#define S_IXOTH 00001 /* others have execute permission */
+
 #if !defined(ROKEN_NO_DEFINE_ALLOCATORS)
 /* Ensure that a common memory allocator is used by all */
 #define calloc  rk_calloc
 #define free    rk_free
 #define malloc  rk_malloc
 #define realloc rk_realloc
+#define strdup  rk_strdup
+#define wcsdup  rk_wcsdup
 #endif
 
 ROKEN_LIB_FUNCTION void * ROKEN_LIB_CALL
@@ -372,6 +394,12 @@ rk_malloc(size_t);
 ROKEN_LIB_FUNCTION void * ROKEN_LIB_CALL
 rk_realloc(void *, size_t);
 
+ROKEN_LIB_FUNCTION char * ROKEN_LIB_CALL
+rk_strdup(const char *);
+
+ROKEN_LIB_FUNCTION unsigned short * ROKEN_LIB_CALL
+rk_wcsdup(const unsigned short *);
+
 #endif  /* _MSC_VER */
 
 #ifdef HAVE_WINSOCK
@@ -1043,7 +1071,7 @@ localtime_r(const time_t *, struct tm *);
 #define strtoll rk_strtoll
 #endif
 ROKEN_LIB_FUNCTION long long ROKEN_LIB_CALL
-strtoll(const char * __restrict nptr, char ** __restrict endptr, int base);
+strtoll(const char * nptr, char ** endptr, int base);
 #endif
 
 #if !defined(HAVE_STRTOULL) || defined(NEED_STRTOULL_PROTO)
@@ -1051,7 +1079,7 @@ strtoll(const char * __restrict nptr, char ** __restrict endptr, int base);
 #define strtoull rk_strtoull
 #endif
 ROKEN_LIB_FUNCTION unsigned long long ROKEN_LIB_CALL
-strtoull(const char * __restrict nptr, char ** __restrict endptr, int base);
+strtoull(const char * nptr, char ** endptr, int base);
 #endif
 
 #if !defined(HAVE_STRSVIS) || defined(NEED_STRSVIS_PROTO)
@@ -1167,6 +1195,9 @@ int ROKEN_LIB_FUNCTION rk_socket(int, int, int);
 #ifndef EAFNOSUPPORT
 #define EAFNOSUPPORT            102
 #endif
+#ifndef EINPROGRESS
+#define EINPROGRESS             112
+#endif
 #ifndef ENOTSOCK
 #define ENOTSOCK               128
 #endif