diff options
Diffstat (limited to 'src/daemon/plibc.h')
-rw-r--r-- | src/daemon/plibc.h | 776 |
1 files changed, 389 insertions, 387 deletions
diff --git a/src/daemon/plibc.h b/src/daemon/plibc.h index 92cd8035..8eafcc89 100644 --- a/src/daemon/plibc.h +++ b/src/daemon/plibc.h | |||
@@ -29,21 +29,22 @@ | |||
29 | #define _PLIBC_H_ | 29 | #define _PLIBC_H_ |
30 | 30 | ||
31 | #ifndef SIGALRM | 31 | #ifndef SIGALRM |
32 | #define SIGALRM 14 | 32 | #define SIGALRM 14 |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | #ifdef __cplusplus | 35 | #ifdef __cplusplus |
36 | extern "C" { | 36 | extern "C" |
37 | { | ||
37 | #endif | 38 | #endif |
38 | 39 | ||
39 | #ifdef Q_OS_WIN32 | 40 | #ifdef Q_OS_WIN32 |
40 | #define WINDOWS 1 | 41 | #define WINDOWS 1 |
41 | #endif | 42 | #endif |
42 | 43 | ||
43 | #ifdef WINDOWS | 44 | #ifdef WINDOWS |
44 | 45 | ||
45 | #if ENABLE_NLS | 46 | #if ENABLE_NLS |
46 | #include "langinfo.h" | 47 | #include "langinfo.h" |
47 | #endif | 48 | #endif |
48 | 49 | ||
49 | #include <windows.h> | 50 | #include <windows.h> |
@@ -75,8 +76,8 @@ extern "C" { | |||
75 | #define int64_t long long | 76 | #define int64_t long long |
76 | #define int32_t long | 77 | #define int32_t long |
77 | 78 | ||
78 | struct stat64 | 79 | struct stat64 |
79 | { | 80 | { |
80 | _dev_t st_dev; | 81 | _dev_t st_dev; |
81 | _ino_t st_ino; | 82 | _ino_t st_ino; |
82 | _mode_t st_mode; | 83 | _mode_t st_mode; |
@@ -88,112 +89,112 @@ struct stat64 | |||
88 | __time64_t st_atime; | 89 | __time64_t st_atime; |
89 | __time64_t st_mtime; | 90 | __time64_t st_mtime; |
90 | __time64_t st_ctime; | 91 | __time64_t st_ctime; |
91 | }; | 92 | }; |
92 | 93 | ||
93 | #ifndef pid_t | 94 | #ifndef pid_t |
94 | #define pid_t int | 95 | #define pid_t int |
95 | #endif | 96 | #endif |
96 | 97 | ||
97 | #ifndef WEXITSTATUS | 98 | #ifndef WEXITSTATUS |
98 | #define WEXITSTATUS(status) (((status) & 0xff00) >> 8) | 99 | #define WEXITSTATUS(status) (((status) & 0xff00) >> 8) |
99 | #endif | 100 | #endif |
100 | 101 | ||
101 | /* Thanks to the Cygwin project */ | 102 | /* Thanks to the Cygwin project */ |
102 | #define ENOCSI 43 /* No CSI structure available */ | 103 | #define ENOCSI 43 /* No CSI structure available */ |
103 | #define EL2HLT 44 /* Level 2 halted */ | 104 | #define EL2HLT 44 /* Level 2 halted */ |
104 | #ifndef EDEADLK | 105 | #ifndef EDEADLK |
105 | #define EDEADLK 45 /* Deadlock condition */ | 106 | #define EDEADLK 45 /* Deadlock condition */ |
106 | #endif | 107 | #endif |
107 | #ifndef ENOLCK | 108 | #ifndef ENOLCK |
108 | #define ENOLCK 46 /* No record locks available */ | 109 | #define ENOLCK 46 /* No record locks available */ |
109 | #endif | 110 | #endif |
110 | #define EBADE 50 /* Invalid exchange */ | 111 | #define EBADE 50 /* Invalid exchange */ |
111 | #define EBADR 51 /* Invalid request descriptor */ | 112 | #define EBADR 51 /* Invalid request descriptor */ |
112 | #define EXFULL 52 /* Exchange full */ | 113 | #define EXFULL 52 /* Exchange full */ |
113 | #define ENOANO 53 /* No anode */ | 114 | #define ENOANO 53 /* No anode */ |
114 | #define EBADRQC 54 /* Invalid request code */ | 115 | #define EBADRQC 54 /* Invalid request code */ |
115 | #define EBADSLT 55 /* Invalid slot */ | 116 | #define EBADSLT 55 /* Invalid slot */ |
116 | #ifndef EDEADLOCK | 117 | #ifndef EDEADLOCK |
117 | #define EDEADLOCK EDEADLK /* File locking deadlock error */ | 118 | #define EDEADLOCK EDEADLK /* File locking deadlock error */ |
118 | #endif | 119 | #endif |
119 | #define EBFONT 57 /* Bad font file fmt */ | 120 | #define EBFONT 57 /* Bad font file fmt */ |
120 | #define ENOSTR 60 /* Device not a stream */ | 121 | #define ENOSTR 60 /* Device not a stream */ |
121 | #define ENODATA 61 /* No data (for no delay io) */ | 122 | #define ENODATA 61 /* No data (for no delay io) */ |
122 | #define ETIME 62 /* Timer expired */ | 123 | #define ETIME 62 /* Timer expired */ |
123 | #define ENOSR 63 /* Out of streams resources */ | 124 | #define ENOSR 63 /* Out of streams resources */ |
124 | #define ENONET 64 /* Machine is not on the network */ | 125 | #define ENONET 64 /* Machine is not on the network */ |
125 | #define ENOPKG 65 /* Package not installed */ | 126 | #define ENOPKG 65 /* Package not installed */ |
126 | #define EREMOTE 66 /* The object is remote */ | 127 | #define EREMOTE 66 /* The object is remote */ |
127 | #define ENOLINK 67 /* The link has been severed */ | 128 | #define ENOLINK 67 /* The link has been severed */ |
128 | #define EADV 68 /* Advertise error */ | 129 | #define EADV 68 /* Advertise error */ |
129 | #define ESRMNT 69 /* Srmount error */ | 130 | #define ESRMNT 69 /* Srmount error */ |
130 | #define ECOMM 70 /* Communication error on send */ | 131 | #define ECOMM 70 /* Communication error on send */ |
131 | #define EPROTO 71 /* Protocol error */ | 132 | #define EPROTO 71 /* Protocol error */ |
132 | #define EMULTIHOP 74 /* Multihop attempted */ | 133 | #define EMULTIHOP 74 /* Multihop attempted */ |
133 | #define ELBIN 75 /* Inode is remote (not really error) */ | 134 | #define ELBIN 75 /* Inode is remote (not really error) */ |
134 | #define EDOTDOT 76 /* Cross mount point (not really error) */ | 135 | #define EDOTDOT 76 /* Cross mount point (not really error) */ |
135 | #define EBADMSG 77 /* Trying to read unreadable message */ | 136 | #define EBADMSG 77 /* Trying to read unreadable message */ |
136 | #define ENOTUNIQ 80 /* Given log. name not unique */ | 137 | #define ENOTUNIQ 80 /* Given log. name not unique */ |
137 | #define EBADFD 81 /* f.d. invalid for this operation */ | 138 | #define EBADFD 81 /* f.d. invalid for this operation */ |
138 | #define EREMCHG 82 /* Remote address changed */ | 139 | #define EREMCHG 82 /* Remote address changed */ |
139 | #define ELIBACC 83 /* Can't access a needed shared lib */ | 140 | #define ELIBACC 83 /* Can't access a needed shared lib */ |
140 | #define ELIBBAD 84 /* Accessing a corrupted shared lib */ | 141 | #define ELIBBAD 84 /* Accessing a corrupted shared lib */ |
141 | #define ELIBSCN 85 /* .lib section in a.out corrupted */ | 142 | #define ELIBSCN 85 /* .lib section in a.out corrupted */ |
142 | #define ELIBMAX 86 /* Attempting to link in too many libs */ | 143 | #define ELIBMAX 86 /* Attempting to link in too many libs */ |
143 | #define ELIBEXEC 87 /* Attempting to exec a shared library */ | 144 | #define ELIBEXEC 87 /* Attempting to exec a shared library */ |
144 | #ifndef ENOSYS | 145 | #ifndef ENOSYS |
145 | #define ENOSYS 88 /* Function not implemented */ | 146 | #define ENOSYS 88 /* Function not implemented */ |
146 | #endif | 147 | #endif |
147 | #define ENMFILE 89 /* No more files */ | 148 | #define ENMFILE 89 /* No more files */ |
148 | #ifndef ENOTEMPTY | 149 | #ifndef ENOTEMPTY |
149 | #define ENOTEMPTY 90 /* Directory not empty */ | 150 | #define ENOTEMPTY 90 /* Directory not empty */ |
150 | #endif | 151 | #endif |
151 | #ifndef ENAMETOOLONG | 152 | #ifndef ENAMETOOLONG |
152 | #define ENAMETOOLONG 91 /* File or path name too long */ | 153 | #define ENAMETOOLONG 91 /* File or path name too long */ |
153 | #endif | 154 | #endif |
154 | #define ELOOP 92 /* Too many symbolic links */ | 155 | #define ELOOP 92 /* Too many symbolic links */ |
155 | #define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ | 156 | #define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ |
156 | #define EPFNOSUPPORT 96 /* Protocol family not supported */ | 157 | #define EPFNOSUPPORT 96 /* Protocol family not supported */ |
157 | #define ECONNRESET 104 /* Connection reset by peer */ | 158 | #define ECONNRESET 104 /* Connection reset by peer */ |
158 | #define ENOBUFS 105 /* No buffer space available */ | 159 | #define ENOBUFS 105 /* No buffer space available */ |
159 | #define EAFNOSUPPORT 106 /* Address family not supported by protocol family */ | 160 | #define EAFNOSUPPORT 106 /* Address family not supported by protocol family */ |
160 | #define EPROTOTYPE 107 /* Protocol wrong type for socket */ | 161 | #define EPROTOTYPE 107 /* Protocol wrong type for socket */ |
161 | #define ENOTSOCK 108 /* Socket operation on non-socket */ | 162 | #define ENOTSOCK 108 /* Socket operation on non-socket */ |
162 | #define ENOPROTOOPT 109 /* Protocol not available */ | 163 | #define ENOPROTOOPT 109 /* Protocol not available */ |
163 | #define ESHUTDOWN 110 /* Can't send after socket shutdown */ | 164 | #define ESHUTDOWN 110 /* Can't send after socket shutdown */ |
164 | #define ECONNREFUSED 111 /* Connection refused */ | 165 | #define ECONNREFUSED 111 /* Connection refused */ |
165 | #define EADDRINUSE 112 /* Address already in use */ | 166 | #define EADDRINUSE 112 /* Address already in use */ |
166 | #define ECONNABORTED 113 /* Connection aborted */ | 167 | #define ECONNABORTED 113 /* Connection aborted */ |
167 | #define ENETUNREACH 114 /* Network is unreachable */ | 168 | #define ENETUNREACH 114 /* Network is unreachable */ |
168 | #define ENETDOWN 115 /* Network interface is not configured */ | 169 | #define ENETDOWN 115 /* Network interface is not configured */ |
169 | #ifndef ETIMEDOUT | 170 | #ifndef ETIMEDOUT |
170 | #define ETIMEDOUT 116 /* Connection timed out */ | 171 | #define ETIMEDOUT 116 /* Connection timed out */ |
171 | #endif | 172 | #endif |
172 | #define EHOSTDOWN 117 /* Host is down */ | 173 | #define EHOSTDOWN 117 /* Host is down */ |
173 | #define EHOSTUNREACH 118 /* Host is unreachable */ | 174 | #define EHOSTUNREACH 118 /* Host is unreachable */ |
174 | #define EINPROGRESS 119 /* Connection already in progress */ | 175 | #define EINPROGRESS 119 /* Connection already in progress */ |
175 | #define EALREADY 120 /* Socket already connected */ | 176 | #define EALREADY 120 /* Socket already connected */ |
176 | #define EDESTADDRREQ 121 /* Destination address required */ | 177 | #define EDESTADDRREQ 121 /* Destination address required */ |
177 | #define EMSGSIZE 122 /* Message too long */ | 178 | #define EMSGSIZE 122 /* Message too long */ |
178 | #define EPROTONOSUPPORT 123 /* Unknown protocol */ | 179 | #define EPROTONOSUPPORT 123 /* Unknown protocol */ |
179 | #define ESOCKTNOSUPPORT 124 /* Socket type not supported */ | 180 | #define ESOCKTNOSUPPORT 124 /* Socket type not supported */ |
180 | #define EADDRNOTAVAIL 125 /* Address not available */ | 181 | #define EADDRNOTAVAIL 125 /* Address not available */ |
181 | #define ENETRESET 126 /* Connection aborted by network */ | 182 | #define ENETRESET 126 /* Connection aborted by network */ |
182 | #define EISCONN 127 /* Socket is already connected */ | 183 | #define EISCONN 127 /* Socket is already connected */ |
183 | #define ENOTCONN 128 /* Socket is not connected */ | 184 | #define ENOTCONN 128 /* Socket is not connected */ |
184 | #define ETOOMANYREFS 129 /* Too many references: cannot splice */ | 185 | #define ETOOMANYREFS 129 /* Too many references: cannot splice */ |
185 | #define EPROCLIM 130 /* Too many processes */ | 186 | #define EPROCLIM 130 /* Too many processes */ |
186 | #define EUSERS 131 /* Too many users */ | 187 | #define EUSERS 131 /* Too many users */ |
187 | #define EDQUOT 132 /* Disk quota exceeded */ | 188 | #define EDQUOT 132 /* Disk quota exceeded */ |
188 | #define ESTALE 133 /* Unknown error */ | 189 | #define ESTALE 133 /* Unknown error */ |
189 | #ifndef ENOTSUP | 190 | #ifndef ENOTSUP |
190 | #define ENOTSUP 134 /* Not supported */ | 191 | #define ENOTSUP 134 /* Not supported */ |
191 | #endif | 192 | #endif |
192 | #define ENOMEDIUM 135 /* No medium (in tape drive) */ | 193 | #define ENOMEDIUM 135 /* No medium (in tape drive) */ |
193 | #define ENOSHARE 136 /* No such host or network path */ | 194 | #define ENOSHARE 136 /* No such host or network path */ |
194 | #define ECASECLASH 137 /* Filename exists with different case */ | 195 | #define ECASECLASH 137 /* Filename exists with different case */ |
195 | #define EWOULDBLOCK EAGAIN /* Operation would block */ | 196 | #define EWOULDBLOCK EAGAIN /* Operation would block */ |
196 | #define EOVERFLOW 139 /* Value too large for defined data type */ | 197 | #define EOVERFLOW 139 /* Value too large for defined data type */ |
197 | 198 | ||
198 | #undef HOST_NOT_FOUND | 199 | #undef HOST_NOT_FOUND |
199 | #define HOST_NOT_FOUND 1 | 200 | #define HOST_NOT_FOUND 1 |
@@ -207,65 +208,65 @@ struct stat64 | |||
207 | #define PROT_READ 0x1 | 208 | #define PROT_READ 0x1 |
208 | #define PROT_WRITE 0x2 | 209 | #define PROT_WRITE 0x2 |
209 | #define MAP_SHARED 0x1 | 210 | #define MAP_SHARED 0x1 |
210 | #define MAP_PRIVATE 0x2 /* unsupported */ | 211 | #define MAP_PRIVATE 0x2 /* unsupported */ |
211 | #define MAP_FIXED 0x10 | 212 | #define MAP_FIXED 0x10 |
212 | #define MAP_FAILED ((void *)-1) | 213 | #define MAP_FAILED ((void *)-1) |
213 | 214 | ||
214 | struct statfs | 215 | struct statfs |
215 | { | 216 | { |
216 | long f_type; /* type of filesystem (see below) */ | 217 | long f_type; /* type of filesystem (see below) */ |
217 | long f_bsize; /* optimal transfer block size */ | 218 | long f_bsize; /* optimal transfer block size */ |
218 | long f_blocks; /* total data blocks in file system */ | 219 | long f_blocks; /* total data blocks in file system */ |
219 | long f_bfree; /* free blocks in fs */ | 220 | long f_bfree; /* free blocks in fs */ |
220 | long f_bavail; /* free blocks avail to non-superuser */ | 221 | long f_bavail; /* free blocks avail to non-superuser */ |
221 | long f_files; /* total file nodes in file system */ | 222 | long f_files; /* total file nodes in file system */ |
222 | long f_ffree; /* free file nodes in fs */ | 223 | long f_ffree; /* free file nodes in fs */ |
223 | long f_fsid; /* file system id */ | 224 | long f_fsid; /* file system id */ |
224 | long f_namelen; /* maximum length of filenames */ | 225 | long f_namelen; /* maximum length of filenames */ |
225 | long f_spare[6]; /* spare for later */ | 226 | long f_spare[6]; /* spare for later */ |
226 | }; | 227 | }; |
227 | 228 | ||
228 | /* Taken from the Wine project <http://www.winehq.org> | 229 | /* Taken from the Wine project <http://www.winehq.org> |
229 | /wine/include/winternl.h */ | 230 | /wine/include/winternl.h */ |
230 | enum SYSTEM_INFORMATION_CLASS | 231 | enum SYSTEM_INFORMATION_CLASS |
231 | { | 232 | { |
232 | SystemBasicInformation = 0, | 233 | SystemBasicInformation = 0, |
233 | Unknown1, | 234 | Unknown1, |
234 | SystemPerformanceInformation = 2, | 235 | SystemPerformanceInformation = 2, |
235 | SystemTimeOfDayInformation = 3, /* was SystemTimeInformation */ | 236 | SystemTimeOfDayInformation = 3, /* was SystemTimeInformation */ |
236 | Unknown4, | 237 | Unknown4, |
237 | SystemProcessInformation = 5, | 238 | SystemProcessInformation = 5, |
238 | Unknown6, | 239 | Unknown6, |
239 | Unknown7, | 240 | Unknown7, |
240 | SystemProcessorPerformanceInformation = 8, | 241 | SystemProcessorPerformanceInformation = 8, |
241 | Unknown9, | 242 | Unknown9, |
242 | Unknown10, | 243 | Unknown10, |
243 | SystemDriverInformation, | 244 | SystemDriverInformation, |
244 | Unknown12, | 245 | Unknown12, |
245 | Unknown13, | 246 | Unknown13, |
246 | Unknown14, | 247 | Unknown14, |
247 | Unknown15, | 248 | Unknown15, |
248 | SystemHandleList, | 249 | SystemHandleList, |
249 | Unknown17, | 250 | Unknown17, |
250 | Unknown18, | 251 | Unknown18, |
251 | Unknown19, | 252 | Unknown19, |
252 | Unknown20, | 253 | Unknown20, |
253 | SystemCacheInformation, | 254 | SystemCacheInformation, |
254 | Unknown22, | 255 | Unknown22, |
255 | SystemInterruptInformation = 23, | 256 | SystemInterruptInformation = 23, |
256 | SystemExceptionInformation = 33, | 257 | SystemExceptionInformation = 33, |
257 | SystemRegistryQuotaInformation = 37, | 258 | SystemRegistryQuotaInformation = 37, |
258 | SystemLookasideInformation = 45 | 259 | SystemLookasideInformation = 45 |
259 | }; | 260 | }; |
260 | 261 | ||
261 | typedef struct | 262 | typedef struct |
262 | { | 263 | { |
263 | LARGE_INTEGER IdleTime; | 264 | LARGE_INTEGER IdleTime; |
264 | LARGE_INTEGER KernelTime; | 265 | LARGE_INTEGER KernelTime; |
265 | LARGE_INTEGER UserTime; | 266 | LARGE_INTEGER UserTime; |
266 | LARGE_INTEGER Reserved1[2]; | 267 | LARGE_INTEGER Reserved1[2]; |
267 | ULONG Reserved2; | 268 | ULONG Reserved2; |
268 | } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION; | 269 | } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION; |
269 | 270 | ||
270 | #define sleep(secs) (Sleep(secs * 1000)) | 271 | #define sleep(secs) (Sleep(secs * 1000)) |
271 | 272 | ||
@@ -282,11 +283,11 @@ typedef struct | |||
282 | #define SHUT_RDWR SD_BOTH | 283 | #define SHUT_RDWR SD_BOTH |
283 | 284 | ||
284 | /* Operations for flock() */ | 285 | /* Operations for flock() */ |
285 | #define LOCK_SH 1 /* shared lock */ | 286 | #define LOCK_SH 1 /* shared lock */ |
286 | #define LOCK_EX 2 /* exclusive lock */ | 287 | #define LOCK_EX 2 /* exclusive lock */ |
287 | #define LOCK_NB 4 /* or'd with one of the above to prevent | 288 | #define LOCK_NB 4 /* or'd with one of the above to prevent |
288 | blocking */ | 289 | blocking */ |
289 | #define LOCK_UN 8 /* remove lock */ | 290 | #define LOCK_UN 8 /* remove lock */ |
290 | 291 | ||
291 | /* Not supported under MinGW */ | 292 | /* Not supported under MinGW */ |
292 | #define S_IRGRP 0 | 293 | #define S_IRGRP 0 |
@@ -312,273 +313,274 @@ typedef struct | |||
312 | */ | 313 | */ |
313 | #define index(s, c) strchr(s, c) | 314 | #define index(s, c) strchr(s, c) |
314 | 315 | ||
315 | BOOL _plibc_CreateShortcut(const char *pszSrc, const char *pszDest); | 316 | BOOL _plibc_CreateShortcut (const char *pszSrc, const char *pszDest); |
316 | BOOL _plibc_DereferenceShortcut(char *pszShortcut); | 317 | BOOL _plibc_DereferenceShortcut (char *pszShortcut); |
317 | char *plibc_ChooseDir(char *pszTitle, unsigned long ulFlags); | 318 | char *plibc_ChooseDir (char *pszTitle, unsigned long ulFlags); |
318 | char *plibc_ChooseFile(char *pszTitle, unsigned long ulFlags); | 319 | char *plibc_ChooseFile (char *pszTitle, unsigned long ulFlags); |
319 | long QueryRegistry(HKEY hMainKey, char *pszKey, char *pszSubKey, | 320 | long QueryRegistry (HKEY hMainKey, char *pszKey, char *pszSubKey, |
320 | char *pszBuffer, long *pdLength); | 321 | char *pszBuffer, long *pdLength); |
321 | 322 | ||
322 | BOOL __win_IsHandleMarkedAsBlocking(SOCKET hHandle); | 323 | BOOL __win_IsHandleMarkedAsBlocking (SOCKET hHandle); |
323 | void __win_SetHandleBlockingMode(SOCKET s, BOOL bBlocking); | 324 | void __win_SetHandleBlockingMode (SOCKET s, BOOL bBlocking); |
324 | void __win_DiscardHandleBlockingMode(SOCKET s); | 325 | void __win_DiscardHandleBlockingMode (SOCKET s); |
325 | int _win_isSocketValid(int s); | 326 | int _win_isSocketValid (int s); |
326 | int plibc_conv_to_win_path(const char *pszUnix, char *pszWindows); | 327 | int plibc_conv_to_win_path (const char *pszUnix, char *pszWindows); |
327 | 328 | ||
328 | typedef void (*TPanicProc) (int, char *); | 329 | typedef void (*TPanicProc) (int, char *); |
329 | void plibc_set_panic_proc(TPanicProc proc); | 330 | void plibc_set_panic_proc (TPanicProc proc); |
330 | 331 | ||
331 | int flock(int fd, int operation); | 332 | int flock (int fd, int operation); |
332 | int fsync(int fildes); | 333 | int fsync (int fildes); |
333 | int inet_pton(int af, const char *src, void *dst); | 334 | int inet_pton (int af, const char *src, void *dst); |
334 | int inet_pton4(const char *src, u_char *dst, int pton); | 335 | int inet_pton4 (const char *src, u_char * dst, int pton); |
335 | #if USE_IPV6 | 336 | #if USE_IPV6 |
336 | int inet_pton6(const char *src, u_char *dst); | 337 | int inet_pton6 (const char *src, u_char * dst); |
337 | #endif | 338 | #endif |
338 | int truncate(const char *fname, int distance); | 339 | int truncate (const char *fname, int distance); |
339 | int statfs(const char *path, struct statfs *buf); | 340 | int statfs (const char *path, struct statfs *buf); |
340 | const char *hstrerror(int err); | 341 | const char *hstrerror (int err); |
341 | void gettimeofday(struct timeval *tp, void *tzp); | 342 | void gettimeofday (struct timeval *tp, void *tzp); |
342 | int mkstemp(char *tmplate); | 343 | int mkstemp (char *tmplate); |
343 | char *strptime (const char *buf, const char *format, struct tm *tm); | 344 | char *strptime (const char *buf, const char *format, struct tm *tm); |
344 | char *ctime(const time_t *clock); | 345 | char *ctime (const time_t * clock); |
345 | char *ctime_r(const time_t *clock, char *buf); | 346 | char *ctime_r (const time_t * clock, char *buf); |
346 | const char *inet_ntop(int af, const void *src, char *dst, size_t size); | 347 | const char *inet_ntop (int af, const void *src, char *dst, size_t size); |
347 | int plibc_init(char *pszOrg, char *pszApp); | 348 | int plibc_init (char *pszOrg, char *pszApp); |
348 | void plibc_shutdown(); | 349 | void plibc_shutdown (); |
349 | int plibc_initialized(); | 350 | int plibc_initialized (); |
350 | int plibc_conv_to_win_path_ex(const char *pszUnix, char *pszWindows, int derefLinks); | 351 | int plibc_conv_to_win_path_ex (const char *pszUnix, char *pszWindows, |
351 | void _SetErrnoFromWinError(long lWinError, char *pszCaller, int iLine); | 352 | int derefLinks); |
352 | void SetErrnoFromWinsockError(long lWinError); | 353 | void _SetErrnoFromWinError (long lWinError, char *pszCaller, int iLine); |
353 | void SetHErrnoFromWinError(long lWinError); | 354 | void SetErrnoFromWinsockError (long lWinError); |
354 | void SetErrnoFromHRESULT(HRESULT hRes); | 355 | void SetHErrnoFromWinError (long lWinError); |
355 | FILE *_win_fopen(const char *filename, const char *mode); | 356 | void SetErrnoFromHRESULT (HRESULT hRes); |
356 | DIR *_win_opendir(const char *dirname); | 357 | FILE *_win_fopen (const char *filename, const char *mode); |
357 | int _win_open(const char *filename, int oflag, ...); | 358 | DIR *_win_opendir (const char *dirname); |
359 | int _win_open (const char *filename, int oflag, ...); | ||
358 | #ifdef ENABLE_NLS | 360 | #ifdef ENABLE_NLS |
359 | char *_win_bindtextdomain(const char *domainname, const char *dirname); | 361 | char *_win_bindtextdomain (const char *domainname, const char *dirname); |
360 | #endif | 362 | #endif |
361 | int _win_chdir(const char *path); | 363 | int _win_chdir (const char *path); |
362 | int _win_close(int fd); | 364 | int _win_close (int fd); |
363 | int _win_creat(const char *path, mode_t mode); | 365 | int _win_creat (const char *path, mode_t mode); |
364 | int _win_fstat(int handle, struct stat *buffer); | 366 | int _win_fstat (int handle, struct stat *buffer); |
365 | int _win_pipe(int *phandles); | 367 | int _win_pipe (int *phandles); |
366 | int _win_rmdir(const char *path); | 368 | int _win_rmdir (const char *path); |
367 | int _win_access( const char *path, int mode ); | 369 | int _win_access (const char *path, int mode); |
368 | int _win_chmod(const char *filename, int pmode); | 370 | int _win_chmod (const char *filename, int pmode); |
369 | char *realpath(const char *file_name, char *resolved_name); | 371 | char *realpath (const char *file_name, char *resolved_name); |
370 | long _win_random(void); | 372 | long _win_random (void); |
371 | int _win_remove(const char *path); | 373 | int _win_remove (const char *path); |
372 | int _win_rename(const char *oldname, const char *newname); | 374 | int _win_rename (const char *oldname, const char *newname); |
373 | int _win_stat(const char *path, struct stat *buffer); | 375 | int _win_stat (const char *path, struct stat *buffer); |
374 | int _win_stat64(const char *path, struct stat64 *buffer); | 376 | int _win_stat64 (const char *path, struct stat64 *buffer); |
375 | int _win_unlink(const char *filename); | 377 | int _win_unlink (const char *filename); |
376 | int _win_write(int fildes, const void *buf, size_t nbyte); | 378 | int _win_write (int fildes, const void *buf, size_t nbyte); |
377 | int _win_read(int fildes, void *buf, size_t nbyte); | 379 | int _win_read (int fildes, void *buf, size_t nbyte); |
378 | size_t _win_fwrite(const void *buffer, size_t size, size_t count, FILE *stream); | 380 | size_t _win_fwrite (const void *buffer, size_t size, size_t count, |
379 | size_t _win_fread( void *buffer, size_t size, size_t count, FILE *stream ); | 381 | FILE * stream); |
380 | int _win_symlink(const char *path1, const char *path2); | 382 | size_t _win_fread (void *buffer, size_t size, size_t count, FILE * stream); |
381 | void *_win_mmap(void *start, size_t len, int access, int flags, int fd, | 383 | int _win_symlink (const char *path1, const char *path2); |
382 | unsigned long long offset); | 384 | void *_win_mmap (void *start, size_t len, int access, int flags, int fd, |
383 | int _win_munmap(void *start, size_t length); | 385 | unsigned long long offset); |
384 | int _win_lstat(const char *path, struct stat *buf); | 386 | int _win_munmap (void *start, size_t length); |
385 | int _win_lstat64(const char *path, struct stat64 *buf); | 387 | int _win_lstat (const char *path, struct stat *buf); |
386 | int _win_readlink(const char *path, char *buf, size_t bufsize); | 388 | int _win_lstat64 (const char *path, struct stat64 *buf); |
387 | int _win_accept(SOCKET s, struct sockaddr *addr, int *addrlen); | 389 | int _win_readlink (const char *path, char *buf, size_t bufsize); |
388 | int _win_printf(const char *format,...); | 390 | int _win_accept (SOCKET s, struct sockaddr *addr, int *addrlen); |
389 | int _win_fprintf(FILE *f,const char *format,...); | 391 | int _win_printf (const char *format, ...); |
390 | int _win_vprintf(const char *format, va_list ap); | 392 | int _win_fprintf (FILE * f, const char *format, ...); |
391 | int _win_vfprintf(FILE *stream, const char *format, va_list arg_ptr); | 393 | int _win_vprintf (const char *format, va_list ap); |
392 | int _win_vsprintf(char *dest,const char *format, va_list arg_ptr); | 394 | int _win_vfprintf (FILE * stream, const char *format, va_list arg_ptr); |
393 | int _win_vsnprintf(char* str, size_t size, const char *format, va_list arg_ptr); | 395 | int _win_vsprintf (char *dest, const char *format, va_list arg_ptr); |
394 | int _win_snprintf(char *str,size_t size,const char *format,...); | 396 | int _win_vsnprintf (char *str, size_t size, const char *format, |
395 | int _win_sprintf(char *dest,const char *format,...); | 397 | va_list arg_ptr); |
396 | int _win_vsscanf(const char* str, const char* format, va_list arg_ptr); | 398 | int _win_snprintf (char *str, size_t size, const char *format, ...); |
397 | int _win_sscanf(const char *str, const char *format, ...); | 399 | int _win_sprintf (char *dest, const char *format, ...); |
398 | int _win_vfscanf(FILE *stream, const char *format, va_list arg_ptr); | 400 | int _win_vsscanf (const char *str, const char *format, va_list arg_ptr); |
399 | int _win_vscanf(const char *format, va_list arg_ptr); | 401 | int _win_sscanf (const char *str, const char *format, ...); |
400 | int _win_scanf(const char *format, ...); | 402 | int _win_vfscanf (FILE * stream, const char *format, va_list arg_ptr); |
401 | int _win_fscanf(FILE *stream, const char *format, ...); | 403 | int _win_vscanf (const char *format, va_list arg_ptr); |
402 | pid_t _win_waitpid(pid_t pid, int *stat_loc, int options); | 404 | int _win_scanf (const char *format, ...); |
403 | int _win_bind(SOCKET s, const struct sockaddr *name, int namelen); | 405 | int _win_fscanf (FILE * stream, const char *format, ...); |
404 | int _win_connect(SOCKET s,const struct sockaddr *name, int namelen); | 406 | pid_t _win_waitpid (pid_t pid, int *stat_loc, int options); |
405 | int _win_getpeername(SOCKET s, struct sockaddr *name, | 407 | int _win_bind (SOCKET s, const struct sockaddr *name, int namelen); |
406 | int *namelen); | 408 | int _win_connect (SOCKET s, const struct sockaddr *name, int namelen); |
407 | int _win_getsockname(SOCKET s, struct sockaddr *name, | 409 | int _win_getpeername (SOCKET s, struct sockaddr *name, int *namelen); |
408 | int *namelen); | 410 | int _win_getsockname (SOCKET s, struct sockaddr *name, int *namelen); |
409 | int _win_getsockopt(SOCKET s, int level, int optname, char *optval, | 411 | int _win_getsockopt (SOCKET s, int level, int optname, char *optval, |
410 | int *optlen); | 412 | int *optlen); |
411 | int _win_listen(SOCKET s, int backlog); | 413 | int _win_listen (SOCKET s, int backlog); |
412 | int _win_recv(SOCKET s, char *buf, int len, int flags); | 414 | int _win_recv (SOCKET s, char *buf, int len, int flags); |
413 | int _win_recvfrom(SOCKET s, void *buf, int len, int flags, | 415 | int _win_recvfrom (SOCKET s, void *buf, int len, int flags, |
414 | struct sockaddr *from, int *fromlen); | 416 | struct sockaddr *from, int *fromlen); |
415 | int _win_select(int max_fd, fd_set * rfds, fd_set * wfds, fd_set * efds, | 417 | int _win_select (int max_fd, fd_set * rfds, fd_set * wfds, fd_set * efds, |
416 | const struct timeval *tv); | 418 | const struct timeval *tv); |
417 | int _win_send(SOCKET s, const char *buf, int len, int flags); | 419 | int _win_send (SOCKET s, const char *buf, int len, int flags); |
418 | int _win_sendto(SOCKET s, const char *buf, int len, int flags, | 420 | int _win_sendto (SOCKET s, const char *buf, int len, int flags, |
419 | const struct sockaddr *to, int tolen); | 421 | const struct sockaddr *to, int tolen); |
420 | int _win_setsockopt(SOCKET s, int level, int optname, const void *optval, | 422 | int _win_setsockopt (SOCKET s, int level, int optname, const void *optval, |
421 | int optlen); | 423 | int optlen); |
422 | int _win_shutdown(SOCKET s, int how); | 424 | int _win_shutdown (SOCKET s, int how); |
423 | SOCKET _win_socket(int af, int type, int protocol); | 425 | SOCKET _win_socket (int af, int type, int protocol); |
424 | struct hostent *_win_gethostbyaddr(const char *addr, int len, int type); | 426 | struct hostent *_win_gethostbyaddr (const char *addr, int len, int type); |
425 | struct hostent *_win_gethostbyname(const char *name); | 427 | struct hostent *_win_gethostbyname (const char *name); |
426 | char *_win_strerror(int errnum); | 428 | char *_win_strerror (int errnum); |
427 | int IsWinNT(); | 429 | int IsWinNT (); |
428 | 430 | ||
429 | #if !HAVE_STRNDUP | 431 | #if !HAVE_STRNDUP |
430 | char *strndup (const char *s, size_t n); | 432 | char *strndup (const char *s, size_t n); |
431 | #endif | 433 | #endif |
432 | #if !HAVE_STRNLEN | 434 | #if !HAVE_STRNLEN |
433 | size_t strnlen (const char *str, size_t maxlen); | 435 | size_t strnlen (const char *str, size_t maxlen); |
434 | #endif | 436 | #endif |
435 | 437 | ||
436 | #define strcasecmp(a, b) stricmp(a, b) | 438 | #define strcasecmp(a, b) stricmp(a, b) |
437 | #define strncasecmp(a, b, c) strnicmp(a, b, c) | 439 | #define strncasecmp(a, b, c) strnicmp(a, b, c) |
438 | 440 | ||
439 | #endif /* WINDOWS */ | 441 | #endif /* WINDOWS */ |
440 | 442 | ||
441 | #ifndef WINDOWS | 443 | #ifndef WINDOWS |
442 | #define DIR_SEPARATOR '/' | 444 | #define DIR_SEPARATOR '/' |
443 | #define DIR_SEPARATOR_STR "/" | 445 | #define DIR_SEPARATOR_STR "/" |
444 | #define PATH_SEPARATOR ';' | 446 | #define PATH_SEPARATOR ';' |
445 | #define PATH_SEPARATOR_STR ";" | 447 | #define PATH_SEPARATOR_STR ";" |
446 | #define NEWLINE "\n" | 448 | #define NEWLINE "\n" |
447 | 449 | ||
448 | #ifdef ENABLE_NLS | 450 | #ifdef ENABLE_NLS |
449 | #define BINDTEXTDOMAIN(d, n) bindtextdomain(d, n) | 451 | #define BINDTEXTDOMAIN(d, n) bindtextdomain(d, n) |
450 | #endif | 452 | #endif |
451 | #define CREAT(p, m) creat(p, m) | 453 | #define CREAT(p, m) creat(p, m) |
452 | #undef FOPEN | 454 | #undef FOPEN |
453 | #define FOPEN(f, m) fopen(f, m) | 455 | #define FOPEN(f, m) fopen(f, m) |
454 | #define OPENDIR(d) opendir(d) | 456 | #define OPENDIR(d) opendir(d) |
455 | #define OPEN(f) open(f) | 457 | #define OPEN(f) open(f) |
456 | #define CHDIR(d) chdir(d) | 458 | #define CHDIR(d) chdir(d) |
457 | #define CLOSE(f) close(f) | 459 | #define CLOSE(f) close(f) |
458 | #define RMDIR(f) rmdir(f) | 460 | #define RMDIR(f) rmdir(f) |
459 | #define ACCESS(p, m) access(p, m) | 461 | #define ACCESS(p, m) access(p, m) |
460 | #define CHMOD(f, p) chmod(f, p) | 462 | #define CHMOD(f, p) chmod(f, p) |
461 | #define FSTAT(h, b) fstat(h, b) | 463 | #define FSTAT(h, b) fstat(h, b) |
462 | #define PIPE(h) pipe(h) | 464 | #define PIPE(h) pipe(h) |
463 | #define REMOVE(p) remove(p) | 465 | #define REMOVE(p) remove(p) |
464 | #define RENAME(o, n) rename(o, n) | 466 | #define RENAME(o, n) rename(o, n) |
465 | #define STAT(p, b) stat(p, b) | 467 | #define STAT(p, b) stat(p, b) |
466 | #define STAT64(p, b) stat64(p, b) | 468 | #define STAT64(p, b) stat64(p, b) |
467 | #define UNLINK(f) unlink(f) | 469 | #define UNLINK(f) unlink(f) |
468 | #define WRITE(f, b, n) write(f, b, n) | 470 | #define WRITE(f, b, n) write(f, b, n) |
469 | #define READ(f, b, n) read(f, b, n) | 471 | #define READ(f, b, n) read(f, b, n) |
470 | #define GN_FREAD(b, s, c, f) fread(b, s, c, f) | 472 | #define GN_FREAD(b, s, c, f) fread(b, s, c, f) |
471 | #define GN_FWRITE(b, s, c, f) fwrite(b, s, c, f) | 473 | #define GN_FWRITE(b, s, c, f) fwrite(b, s, c, f) |
472 | #define SYMLINK(a, b) symlink(a, b) | 474 | #define SYMLINK(a, b) symlink(a, b) |
473 | #define MMAP(s, l, p, f, d, o) mmap(s, l, p, f, d, o) | 475 | #define MMAP(s, l, p, f, d, o) mmap(s, l, p, f, d, o) |
474 | #define MUNMAP(s, l) munmap(s, l) | 476 | #define MUNMAP(s, l) munmap(s, l) |
475 | #define STRERROR(i) strerror(i) | 477 | #define STRERROR(i) strerror(i) |
476 | #define RANDOM() random() | 478 | #define RANDOM() random() |
477 | #define READLINK(p, b, s) readlink(p, b, s) | 479 | #define READLINK(p, b, s) readlink(p, b, s) |
478 | #define LSTAT(p, b) lstat(p, b) | 480 | #define LSTAT(p, b) lstat(p, b) |
479 | #define LSTAT64(p, b) lstat64(p, b) | 481 | #define LSTAT64(p, b) lstat64(p, b) |
480 | #define PRINTF printf | 482 | #define PRINTF printf |
481 | #define FPRINTF fprintf | 483 | #define FPRINTF fprintf |
482 | #define VPRINTF(f, a) vprintf(f, a) | 484 | #define VPRINTF(f, a) vprintf(f, a) |
483 | #define VFPRINTF(s, f, a) vfprintf(s, f, a) | 485 | #define VFPRINTF(s, f, a) vfprintf(s, f, a) |
484 | #define VSPRINTF(d, f, a) vsprintf(d, f, a) | 486 | #define VSPRINTF(d, f, a) vsprintf(d, f, a) |
485 | #define VSNPRINTF(str, size, fmt, a) vsnprintf(str, size, fmt, a) | 487 | #define VSNPRINTF(str, size, fmt, a) vsnprintf(str, size, fmt, a) |
486 | #define _REAL_SNPRINTF snprintf | 488 | #define _REAL_SNPRINTF snprintf |
487 | #define SPRINTF sprintf | 489 | #define SPRINTF sprintf |
488 | #define VSSCANF(s, f, a) vsscanf(s, f, a) | 490 | #define VSSCANF(s, f, a) vsscanf(s, f, a) |
489 | #define SSCANF sscanf | 491 | #define SSCANF sscanf |
490 | #define VFSCANF(s, f, a) vfscanf(s, f, a) | 492 | #define VFSCANF(s, f, a) vfscanf(s, f, a) |
491 | #define VSCANF(f, a) vscanf(f, a) | 493 | #define VSCANF(f, a) vscanf(f, a) |
492 | #define SCANF scanf | 494 | #define SCANF scanf |
493 | #define FSCANF fscanf | 495 | #define FSCANF fscanf |
494 | #define WAITPID(p, s, o) waitpid(p, s, o) | 496 | #define WAITPID(p, s, o) waitpid(p, s, o) |
495 | #define ACCEPT(s, a, l) accept(s, a, l) | 497 | #define ACCEPT(s, a, l) accept(s, a, l) |
496 | #define BIND(s, n, l) bind(s, n, l) | 498 | #define BIND(s, n, l) bind(s, n, l) |
497 | #define CONNECT(s, n, l) connect(s, n, l) | 499 | #define CONNECT(s, n, l) connect(s, n, l) |
498 | #define GETPEERNAME(s, n, l) getpeername(s, n, l) | 500 | #define GETPEERNAME(s, n, l) getpeername(s, n, l) |
499 | #define GETSOCKNAME(s, n, l) getsockname(s, n, l) | 501 | #define GETSOCKNAME(s, n, l) getsockname(s, n, l) |
500 | #define GETSOCKOPT(s, l, o, v, p) getsockopt(s, l, o, v, p) | 502 | #define GETSOCKOPT(s, l, o, v, p) getsockopt(s, l, o, v, p) |
501 | #define LISTEN(s, b) listen(s, b) | 503 | #define LISTEN(s, b) listen(s, b) |
502 | #define RECV(s, b, l, f) recv(s, b, l, f) | 504 | #define RECV(s, b, l, f) recv(s, b, l, f) |
503 | #define RECVFROM(s, b, l, f, r, o) recvfrom(s, b, l, f, r, o) | 505 | #define RECVFROM(s, b, l, f, r, o) recvfrom(s, b, l, f, r, o) |
504 | #define SELECT(n, r, w, e, t) select(n, r, w, e, t) | 506 | #define SELECT(n, r, w, e, t) select(n, r, w, e, t) |
505 | #define SEND(s, b, l, f) send(s, b, l, f) | 507 | #define SEND(s, b, l, f) send(s, b, l, f) |
506 | #define SENDTO(s, b, l, f, o, n) sendto(s, b, l, f, o, n) | 508 | #define SENDTO(s, b, l, f, o, n) sendto(s, b, l, f, o, n) |
507 | #define SETSOCKOPT(s, l, o, v, n) setsockopt(s, l, o, v, n) | 509 | #define SETSOCKOPT(s, l, o, v, n) setsockopt(s, l, o, v, n) |
508 | #define SHUTDOWN(s, h) shutdown(s, h) | 510 | #define SHUTDOWN(s, h) shutdown(s, h) |
509 | #define SOCKET(a, t, p) socket(a, t, p) | 511 | #define SOCKET(a, t, p) socket(a, t, p) |
510 | #define GETHOSTBYADDR(a, l, t) gethostbyname(a, l, t) | 512 | #define GETHOSTBYADDR(a, l, t) gethostbyname(a, l, t) |
511 | #define GETHOSTBYNAME(n) gethostbyname(n) | 513 | #define GETHOSTBYNAME(n) gethostbyname(n) |
512 | #else | 514 | #else |
513 | #define DIR_SEPARATOR '\\' | 515 | #define DIR_SEPARATOR '\\' |
514 | #define DIR_SEPARATOR_STR "\\" | 516 | #define DIR_SEPARATOR_STR "\\" |
515 | #define PATH_SEPARATOR ':' | 517 | #define PATH_SEPARATOR ':' |
516 | #define PATH_SEPARATOR_STR ":" | 518 | #define PATH_SEPARATOR_STR ":" |
517 | #define NEWLINE "\r\n" | 519 | #define NEWLINE "\r\n" |
518 | 520 | ||
519 | #ifdef ENABLE_NLS | 521 | #ifdef ENABLE_NLS |
520 | #define BINDTEXTDOMAIN(d, n) _win_bindtextdomain(d, n) | 522 | #define BINDTEXTDOMAIN(d, n) _win_bindtextdomain(d, n) |
521 | #endif | 523 | #endif |
522 | #define CREAT(p, m) _win_creat(p, m) | 524 | #define CREAT(p, m) _win_creat(p, m) |
523 | #define FOPEN(f, m) _win_fopen(f, m) | 525 | #define FOPEN(f, m) _win_fopen(f, m) |
524 | #define OPENDIR(d) _win_opendir(d) | 526 | #define OPENDIR(d) _win_opendir(d) |
525 | #define OPEN(f) _win_open(f) | 527 | #define OPEN(f) _win_open(f) |
526 | #define CHDIR(d) _win_chdir(d) | 528 | #define CHDIR(d) _win_chdir(d) |
527 | #define CLOSE(f) _win_close(f) | 529 | #define CLOSE(f) _win_close(f) |
528 | #define FSTAT(h, b) _win_fstat(h, b) | 530 | #define FSTAT(h, b) _win_fstat(h, b) |
529 | #define RMDIR(f) _win_rmdir(f) | 531 | #define RMDIR(f) _win_rmdir(f) |
530 | #define ACCESS(p, m) _win_access(p, m) | 532 | #define ACCESS(p, m) _win_access(p, m) |
531 | #define CHMOD(f, p) _win_chmod(f, p) | 533 | #define CHMOD(f, p) _win_chmod(f, p) |
532 | #define PIPE(h) _win_pipe(h) | 534 | #define PIPE(h) _win_pipe(h) |
533 | #define RANDOM() _win_random() | 535 | #define RANDOM() _win_random() |
534 | #define REMOVE(p) _win_remove(p) | 536 | #define REMOVE(p) _win_remove(p) |
535 | #define RENAME(o, n) _win_rename(o, n) | 537 | #define RENAME(o, n) _win_rename(o, n) |
536 | #define STAT(p, b) _win_stat(p, b) | 538 | #define STAT(p, b) _win_stat(p, b) |
537 | #define STAT64(p, b) _win_stat64(p, b) | 539 | #define STAT64(p, b) _win_stat64(p, b) |
538 | #define UNLINK(f) _win_unlink(f) | 540 | #define UNLINK(f) _win_unlink(f) |
539 | #define WRITE(f, b, n) _win_write(f, b, n) | 541 | #define WRITE(f, b, n) _win_write(f, b, n) |
540 | #define READ(f, b, n) _win_read(f, b, n) | 542 | #define READ(f, b, n) _win_read(f, b, n) |
541 | #define GN_FREAD(b, s, c, f) _win_fread(b, s, c, f) | 543 | #define GN_FREAD(b, s, c, f) _win_fread(b, s, c, f) |
542 | #define GN_FWRITE(b, s, c, f) _win_fwrite(b, s, c, f) | 544 | #define GN_FWRITE(b, s, c, f) _win_fwrite(b, s, c, f) |
543 | #define SYMLINK(a, b) _win_symlink(a, b) | 545 | #define SYMLINK(a, b) _win_symlink(a, b) |
544 | #define MMAP(s, l, p, f, d, o) _win_mmap(s, l, p, f, d, o) | 546 | #define MMAP(s, l, p, f, d, o) _win_mmap(s, l, p, f, d, o) |
545 | #define MUNMAP(s, l) _win_munmap(s, l) | 547 | #define MUNMAP(s, l) _win_munmap(s, l) |
546 | #define STRERROR(i) _win_strerror(i) | 548 | #define STRERROR(i) _win_strerror(i) |
547 | #define READLINK(p, b, s) _win_readlink(p, b, s) | 549 | #define READLINK(p, b, s) _win_readlink(p, b, s) |
548 | #define LSTAT(p, b) _win_lstat(p, b) | 550 | #define LSTAT(p, b) _win_lstat(p, b) |
549 | #define LSTAT64(p, b) _win_lstat64(p, b) | 551 | #define LSTAT64(p, b) _win_lstat64(p, b) |
550 | #define PRINTF(f, ...) _win_printf(f , __VA_ARGS__) | 552 | #define PRINTF(f, ...) _win_printf(f , __VA_ARGS__) |
551 | #define FPRINTF(fil, fmt, ...) _win_fprintf(fil, fmt, __VA_ARGS__) | 553 | #define FPRINTF(fil, fmt, ...) _win_fprintf(fil, fmt, __VA_ARGS__) |
552 | #define VPRINTF(f, a) _win_vprintf(f, a) | 554 | #define VPRINTF(f, a) _win_vprintf(f, a) |
553 | #define VFPRINTF(s, f, a) _win_vfprintf(s, f, a) | 555 | #define VFPRINTF(s, f, a) _win_vfprintf(s, f, a) |
554 | #define VSPRINTF(d, f, a) _win_vsprintf(d, f, a) | 556 | #define VSPRINTF(d, f, a) _win_vsprintf(d, f, a) |
555 | #define VSNPRINTF(str, size, fmt, a) _win_vsnprintf(str, size, fmt, a) | 557 | #define VSNPRINTF(str, size, fmt, a) _win_vsnprintf(str, size, fmt, a) |
556 | #define _REAL_SNPRINTF(str, size, fmt, ...) _win_snprintf(str, size, fmt, __VA_ARGS__) | 558 | #define _REAL_SNPRINTF(str, size, fmt, ...) _win_snprintf(str, size, fmt, __VA_ARGS__) |
557 | #define SPRINTF(d, f, ...) _win_sprintf(d, f, __VA_ARGS__) | 559 | #define SPRINTF(d, f, ...) _win_sprintf(d, f, __VA_ARGS__) |
558 | #define VSSCANF(s, f, a) _win_vsscanf(s, f, a) | 560 | #define VSSCANF(s, f, a) _win_vsscanf(s, f, a) |
559 | #define SSCANF(s, f, ...) _win_sscanf(s, f, __VA_ARGS__) | 561 | #define SSCANF(s, f, ...) _win_sscanf(s, f, __VA_ARGS__) |
560 | #define VFSCANF(s, f, a) _win_vfscanf(s, f, a) | 562 | #define VFSCANF(s, f, a) _win_vfscanf(s, f, a) |
561 | #define VSCANF(f, a) _win_vscanf(f, a) | 563 | #define VSCANF(f, a) _win_vscanf(f, a) |
562 | #define SCANF(f, ...) _win_scanf(f, __VA_ARGS__) | 564 | #define SCANF(f, ...) _win_scanf(f, __VA_ARGS__) |
563 | #define FSCANF(s, f, ...) _win_fscanf(s, f, __VA_ARGS__) | 565 | #define FSCANF(s, f, ...) _win_fscanf(s, f, __VA_ARGS__) |
564 | #define WAITPID(p, s, o) _win_waitpid(p, s, o) | 566 | #define WAITPID(p, s, o) _win_waitpid(p, s, o) |
565 | #define ACCEPT(s, a, l) _win_accept(s, a, l) | 567 | #define ACCEPT(s, a, l) _win_accept(s, a, l) |
566 | #define BIND(s, n, l) _win_bind(s, n, l) | 568 | #define BIND(s, n, l) _win_bind(s, n, l) |
567 | #define CONNECT(s, n, l) _win_connect(s, n, l) | 569 | #define CONNECT(s, n, l) _win_connect(s, n, l) |
568 | #define GETPEERNAME(s, n, l) _win_getpeername(s, n, l) | 570 | #define GETPEERNAME(s, n, l) _win_getpeername(s, n, l) |
569 | #define GETSOCKNAME(s, n, l) _win_getsockname(s, n, l) | 571 | #define GETSOCKNAME(s, n, l) _win_getsockname(s, n, l) |
570 | #define GETSOCKOPT(s, l, o, v, p) _win_getsockopt(s, l, o, v, p) | 572 | #define GETSOCKOPT(s, l, o, v, p) _win_getsockopt(s, l, o, v, p) |
571 | #define LISTEN(s, b) _win_listen(s, b) | 573 | #define LISTEN(s, b) _win_listen(s, b) |
572 | #define RECV(s, b, l, f) _win_recv(s, b, l, f) | 574 | #define RECV(s, b, l, f) _win_recv(s, b, l, f) |
573 | #define RECVFROM(s, b, l, f, r, o) _win_recvfrom(s, b, l, f, r, o) | 575 | #define RECVFROM(s, b, l, f, r, o) _win_recvfrom(s, b, l, f, r, o) |
574 | #define SELECT(n, r, w, e, t) _win_select(n, r, w, e, t) | 576 | #define SELECT(n, r, w, e, t) _win_select(n, r, w, e, t) |
575 | #define SEND(s, b, l, f) _win_send(s, b, l, f) | 577 | #define SEND(s, b, l, f) _win_send(s, b, l, f) |
576 | #define SENDTO(s, b, l, f, o, n) _win_sendto(s, b, l, f, o, n) | 578 | #define SENDTO(s, b, l, f, o, n) _win_sendto(s, b, l, f, o, n) |
577 | #define SETSOCKOPT(s, l, o, v, n) _win_setsockopt(s, l, o, v, n) | 579 | #define SETSOCKOPT(s, l, o, v, n) _win_setsockopt(s, l, o, v, n) |
578 | #define SHUTDOWN(s, h) _win_shutdown(s, h) | 580 | #define SHUTDOWN(s, h) _win_shutdown(s, h) |
579 | #define SOCKET(a, t, p) _win_socket(a, t, p) | 581 | #define SOCKET(a, t, p) _win_socket(a, t, p) |
580 | #define GETHOSTBYADDR(a, l, t) _win_gethostbyname(a, l, t) | 582 | #define GETHOSTBYADDR(a, l, t) _win_gethostbyname(a, l, t) |
581 | #define GETHOSTBYNAME(n) _win_gethostbyname(n) | 583 | #define GETHOSTBYNAME(n) _win_gethostbyname(n) |
582 | #endif | 584 | #endif |
583 | 585 | ||
584 | 586 | ||
@@ -587,6 +589,6 @@ size_t strnlen (const char *str, size_t maxlen); | |||
587 | #endif | 589 | #endif |
588 | 590 | ||
589 | 591 | ||
590 | #endif //_PLIBC_H_ | 592 | #endif //_PLIBC_H_ |
591 | 593 | ||
592 | /* end of plibc.h */ | 594 | /* end of plibc.h */ |