plibc.h

Go to the documentation of this file.
00001 /*
00002      This file is part of PlibC.
00003      (C) 2005, 2006, 2007 Nils Durner (and other contributing authors)
00004 
00005            This library is free software; you can redistribute it and/or
00006            modify it under the terms of the GNU Lesser General Public
00007            License as published by the Free Software Foundation; either
00008            version 2.1 of the License, or (at your option) any later version.
00009         
00010            This library is distributed in the hope that it will be useful,
00011            but WITHOUT ANY WARRANTY; without even the implied warranty of
00012            MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013            Lesser General Public License for more details.
00014         
00015            You should have received a copy of the GNU Lesser General Public
00016            License along with this library; if not, write to the Free Software
00017            Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 
00028 #ifndef _PLIBC_H_
00029 #define _PLIBC_H_
00030 
00031 #ifndef SIGALRM
00032 #define SIGALRM 14
00033 #endif
00034 
00035 #ifdef __cplusplus
00036 extern "C"
00037 {
00038 #endif
00039 
00040 #ifdef Q_OS_WIN32
00041 #define WINDOWS 1
00042 #endif
00043 
00044 #ifdef WINDOWS
00045 
00046 #if ENABLE_NLS
00047 #include "langinfo.h"
00048 #endif
00049 
00050 #include <windows.h>
00051 #include <Ws2tcpip.h>
00052 #include <time.h>
00053 #include <stdio.h>
00054 #include <sys/types.h>
00055 #include <sys/stat.h>
00056 #include <dirent.h>
00057 #include <errno.h>
00058 #include <stdarg.h>
00059 
00060 #define __BYTE_ORDER BYTE_ORDER
00061 #define __BIG_ENDIAN BIG_ENDIAN
00062 
00063 /* Conflicts with our definitions */
00064 #define __G_WIN32_H__
00065 
00066 /* Convert LARGE_INTEGER to double */
00067 #define Li2Double(x) ((double)((x).HighPart) * 4.294967296E9 + \
00068   (double)((x).LowPart))
00069 
00070 #define socklen_t int
00071 #define ssize_t int
00072 #ifndef HAVE_FTRUNCATE
00073 #define ftruncate chsize
00074 #endif
00075 #define off_t int
00076 #define int64_t long long
00077 #define int32_t long
00078 
00079   struct stat64
00080   {
00081     _dev_t st_dev;
00082     _ino_t st_ino;
00083     _mode_t st_mode;
00084     short st_nlink;
00085     short st_uid;
00086     short st_gid;
00087     _dev_t st_rdev;
00088     __int64 st_size;
00089     __time64_t st_atime;
00090     __time64_t st_mtime;
00091     __time64_t st_ctime;
00092   };
00093 
00094 #ifndef pid_t
00095 #define pid_t int
00096 #endif
00097 
00098 #ifndef WEXITSTATUS
00099 #define WEXITSTATUS(status) (((status) & 0xff00) >> 8)
00100 #endif
00101 
00102 /* Thanks to the Cygwin project */
00103 #define ENOCSI 43               /* No CSI structure available */
00104 #define EL2HLT 44               /* Level 2 halted */
00105 #ifndef  EDEADLK
00106 #define EDEADLK 45              /* Deadlock condition */
00107 #endif
00108 #ifndef  ENOLCK
00109 #define ENOLCK 46               /* No record locks available */
00110 #endif
00111 #define EBADE 50                /* Invalid exchange */
00112 #define EBADR 51                /* Invalid request descriptor */
00113 #define EXFULL 52               /* Exchange full */
00114 #define ENOANO 53               /* No anode */
00115 #define EBADRQC 54              /* Invalid request code */
00116 #define EBADSLT 55              /* Invalid slot */
00117 #ifndef  EDEADLOCK
00118 #define EDEADLOCK EDEADLK       /* File locking deadlock error */
00119 #endif
00120 #define EBFONT 57               /* Bad font file fmt */
00121 #define ENOSTR 60               /* Device not a stream */
00122 #define ENODATA 61              /* No data (for no delay io) */
00123 #define ETIME 62                /* Timer expired */
00124 #define ENOSR 63                /* Out of streams resources */
00125 #define ENONET 64               /* Machine is not on the network */
00126 #define ENOPKG 65               /* Package not installed */
00127 #define EREMOTE 66              /* The object is remote */
00128 #define ENOLINK 67              /* The link has been severed */
00129 #define EADV 68                 /* Advertise error */
00130 #define ESRMNT 69               /* Srmount error */
00131 #define ECOMM 70                /* Communication error on send */
00132 #define EPROTO 71               /* Protocol error */
00133 #define EMULTIHOP 74            /* Multihop attempted */
00134 #define ELBIN 75                /* Inode is remote (not really error) */
00135 #define EDOTDOT 76              /* Cross mount point (not really error) */
00136 #define EBADMSG 77              /* Trying to read unreadable message */
00137 #define ENOTUNIQ 80             /* Given log. name not unique */
00138 #define EBADFD 81               /* f.d. invalid for this operation */
00139 #define EREMCHG 82              /* Remote address changed */
00140 #define ELIBACC 83              /* Can't access a needed shared lib */
00141 #define ELIBBAD 84              /* Accessing a corrupted shared lib */
00142 #define ELIBSCN 85              /* .lib section in a.out corrupted */
00143 #define ELIBMAX 86              /* Attempting to link in too many libs */
00144 #define ELIBEXEC 87             /* Attempting to exec a shared library */
00145 #ifndef  ENOSYS
00146 #define ENOSYS 88               /* Function not implemented */
00147 #endif
00148 #define ENMFILE 89              /* No more files */
00149 #ifndef  ENOTEMPTY
00150 #define ENOTEMPTY 90            /* Directory not empty */
00151 #endif
00152 #ifndef  ENAMETOOLONG
00153 #define ENAMETOOLONG 91         /* File or path name too long */
00154 #endif
00155 #define ELOOP 92                /* Too many symbolic links */
00156 #define EOPNOTSUPP 95           /* Operation not supported on transport endpoint */
00157 #define EPFNOSUPPORT 96         /* Protocol family not supported */
00158 #define ECONNRESET 104          /* Connection reset by peer */
00159 #define ENOBUFS 105             /* No buffer space available */
00160 #define EAFNOSUPPORT 106        /* Address family not supported by protocol family */
00161 #define EPROTOTYPE 107          /* Protocol wrong type for socket */
00162 #define ENOTSOCK 108            /* Socket operation on non-socket */
00163 #define ENOPROTOOPT 109         /* Protocol not available */
00164 #define ESHUTDOWN 110           /* Can't send after socket shutdown */
00165 #define ECONNREFUSED 111        /* Connection refused */
00166 #define EADDRINUSE 112          /* Address already in use */
00167 #define ECONNABORTED 113        /* Connection aborted */
00168 #define ENETUNREACH 114         /* Network is unreachable */
00169 #define ENETDOWN 115            /* Network interface is not configured */
00170 #ifndef  ETIMEDOUT
00171 #define ETIMEDOUT 116           /* Connection timed out */
00172 #endif
00173 #define EHOSTDOWN 117           /* Host is down */
00174 #define EHOSTUNREACH 118        /* Host is unreachable */
00175 #define EINPROGRESS 119         /* Connection already in progress */
00176 #define EALREADY 120            /* Socket already connected */
00177 #define EDESTADDRREQ 121        /* Destination address required */
00178 #define EMSGSIZE 122            /* Message too long */
00179 #define EPROTONOSUPPORT 123     /* Unknown protocol */
00180 #define ESOCKTNOSUPPORT 124     /* Socket type not supported */
00181 #define EADDRNOTAVAIL 125       /* Address not available */
00182 #define ENETRESET 126           /* Connection aborted by network */
00183 #define EISCONN 127             /* Socket is already connected */
00184 #define ENOTCONN 128            /* Socket is not connected */
00185 #define ETOOMANYREFS 129        /* Too many references: cannot splice */
00186 #define EPROCLIM 130            /* Too many processes */
00187 #define EUSERS 131              /* Too many users */
00188 #define EDQUOT 132              /* Disk quota exceeded */
00189 #define ESTALE 133              /* Unknown error */
00190 #ifndef  ENOTSUP
00191 #define ENOTSUP 134             /* Not supported */
00192 #endif
00193 #define ENOMEDIUM 135           /* No medium (in tape drive) */
00194 #define ENOSHARE 136            /* No such host or network path */
00195 #define ECASECLASH 137          /* Filename exists with different case */
00196 #define EWOULDBLOCK EAGAIN      /* Operation would block */
00197 #define EOVERFLOW 139           /* Value too large for defined data type */
00198 
00199 #undef HOST_NOT_FOUND
00200 #define HOST_NOT_FOUND 1
00201 #undef TRY_AGAIN
00202 #define TRY_AGAIN 2
00203 #undef NO_RECOVERY
00204 #define NO_RECOVERY 3
00205 #undef NO_ADDRESS
00206 #define NO_ADDRESS 4
00207 
00208 #define PROT_READ   0x1
00209 #define PROT_WRITE  0x2
00210 #define MAP_SHARED  0x1
00211 #define MAP_PRIVATE 0x2         /* unsupported */
00212 #define MAP_FIXED   0x10
00213 #define MAP_FAILED  ((void *)-1)
00214 
00215   struct statfs
00216   {
00217     long f_type;                /* type of filesystem (see below) */
00218     long f_bsize;               /* optimal transfer block size */
00219     long f_blocks;              /* total data blocks in file system */
00220     long f_bfree;               /* free blocks in fs */
00221     long f_bavail;              /* free blocks avail to non-superuser */
00222     long f_files;               /* total file nodes in file system */
00223     long f_ffree;               /* free file nodes in fs */
00224     long f_fsid;                /* file system id */
00225     long f_namelen;             /* maximum length of filenames */
00226     long f_spare[6];            /* spare for later */
00227   };
00228 
00229 /* Taken from the Wine project <http://www.winehq.org>
00230     /wine/include/winternl.h */
00231   enum SYSTEM_INFORMATION_CLASS
00232   {
00233     SystemBasicInformation = 0,
00234     Unknown1,
00235     SystemPerformanceInformation = 2,
00236     SystemTimeOfDayInformation = 3,     /* was SystemTimeInformation */
00237     Unknown4,
00238     SystemProcessInformation = 5,
00239     Unknown6,
00240     Unknown7,
00241     SystemProcessorPerformanceInformation = 8,
00242     Unknown9,
00243     Unknown10,
00244     SystemDriverInformation,
00245     Unknown12,
00246     Unknown13,
00247     Unknown14,
00248     Unknown15,
00249     SystemHandleList,
00250     Unknown17,
00251     Unknown18,
00252     Unknown19,
00253     Unknown20,
00254     SystemCacheInformation,
00255     Unknown22,
00256     SystemInterruptInformation = 23,
00257     SystemExceptionInformation = 33,
00258     SystemRegistryQuotaInformation = 37,
00259     SystemLookasideInformation = 45
00260   };
00261 
00262   typedef struct
00263   {
00264     LARGE_INTEGER IdleTime;
00265     LARGE_INTEGER KernelTime;
00266     LARGE_INTEGER UserTime;
00267     LARGE_INTEGER Reserved1[2];
00268     ULONG Reserved2;
00269   } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
00270 
00271 #define sleep(secs) (Sleep(secs * 1000))
00272 
00273 /*********************** statfs *****************************/
00274 /* fake block size */
00275 #define FAKED_BLOCK_SIZE 512
00276 
00277 /* linux-compatible values for fs type */
00278 #define MSDOS_SUPER_MAGIC     0x4d44
00279 #define NTFS_SUPER_MAGIC      0x5346544E
00280 
00281 /*********************** End of statfs ***********************/
00282 
00283 #define SHUT_RDWR SD_BOTH
00284 
00285 /* Operations for flock() */
00286 #define LOCK_SH  1              /* shared lock */
00287 #define LOCK_EX  2              /* exclusive lock */
00288 #define LOCK_NB  4              /* or'd with one of the above to prevent
00289                                    blocking */
00290 #define LOCK_UN  8              /* remove lock */
00291 
00292 /* Not supported under MinGW */
00293 #define S_IRGRP 0
00294 #define S_IWGRP 0
00295 #define S_IROTH 0
00296 #define S_IXGRP 0
00297 #define S_IWOTH 0
00298 #define S_IXOTH 0
00299 #define S_ISUID 0
00300 #define S_ISGID 0
00301 #define S_ISVTX 0
00302 #define S_IRWXG 0
00303 #define S_IRWXO 0
00304 
00305 #define SHUT_WR SD_SEND
00306 #define SHUT_RD SD_RECEIVE
00307 #define SHUT_RDWR SD_BOTH
00308 
00309 #define SetErrnoFromWinError(e) _SetErrnoFromWinError(e, __FILE__, __LINE__)
00310 
00314 #define index(s, c) strchr(s, c)
00315 
00316   BOOL _plibc_CreateShortcut (const char *pszSrc, const char *pszDest);
00317   BOOL _plibc_DereferenceShortcut (char *pszShortcut);
00318   char *plibc_ChooseDir (char *pszTitle, unsigned long ulFlags);
00319   char *plibc_ChooseFile (char *pszTitle, unsigned long ulFlags);
00320   long QueryRegistry (HKEY hMainKey, char *pszKey, char *pszSubKey,
00321                       char *pszBuffer, long *pdLength);
00322 
00323   BOOL __win_IsHandleMarkedAsBlocking (SOCKET hHandle);
00324   void __win_SetHandleBlockingMode (SOCKET s, BOOL bBlocking);
00325   void __win_DiscardHandleBlockingMode (SOCKET s);
00326   int _win_isSocketValid (int s);
00327   int plibc_conv_to_win_path (const char *pszUnix, char *pszWindows);
00328 
00329   typedef void (*TPanicProc) (int, char *);
00330   void plibc_set_panic_proc (TPanicProc proc);
00331 
00332   int flock (int fd, int operation);
00333   int fsync (int fildes);
00334   int inet_pton (int af, const char *src, void *dst);
00335   int inet_pton4 (const char *src, u_char * dst, int pton);
00336 #if USE_IPV6
00337   int inet_pton6 (const char *src, u_char * dst);
00338 #endif
00339   int truncate (const char *fname, int distance);
00340   int statfs (const char *path, struct statfs *buf);
00341   const char *hstrerror (int err);
00342   void gettimeofday (struct timeval *tp, void *tzp);
00343   int mkstemp (char *tmplate);
00344   char *strptime (const char *buf, const char *format, struct tm *tm);
00345   char *ctime (const time_t * clock);
00346   char *ctime_r (const time_t * clock, char *buf);
00347   const char *inet_ntop (int af, const void *src, char *dst, size_t size);
00348   int plibc_init (char *pszOrg, char *pszApp);
00349   void plibc_shutdown ();
00350   int plibc_initialized ();
00351   int plibc_conv_to_win_path_ex (const char *pszUnix, char *pszWindows,
00352                                  int derefLinks);
00353   void _SetErrnoFromWinError (long lWinError, char *pszCaller, int iLine);
00354   void SetErrnoFromWinsockError (long lWinError);
00355   void SetHErrnoFromWinError (long lWinError);
00356   void SetErrnoFromHRESULT (HRESULT hRes);
00357   FILE *_win_fopen (const char *filename, const char *mode);
00358   DIR *_win_opendir (const char *dirname);
00359   int _win_open (const char *filename, int oflag, ...);
00360 #ifdef ENABLE_NLS
00361   char *_win_bindtextdomain (const char *domainname, const char *dirname);
00362 #endif
00363   int _win_chdir (const char *path);
00364   int _win_close (int fd);
00365   int _win_creat (const char *path, mode_t mode);
00366   int _win_fstat (int handle, struct stat *buffer);
00367   int _win_pipe (int *phandles);
00368   int _win_rmdir (const char *path);
00369   int _win_access (const char *path, int mode);
00370   int _win_chmod (const char *filename, int pmode);
00371   char *realpath (const char *file_name, char *resolved_name);
00372   long _win_random (void);
00373   int _win_remove (const char *path);
00374   int _win_rename (const char *oldname, const char *newname);
00375   int _win_stat (const char *path, struct stat *buffer);
00376   int _win_stat64 (const char *path, struct stat64 *buffer);
00377   int _win_unlink (const char *filename);
00378   int _win_write (int fildes, const void *buf, size_t nbyte);
00379   int _win_read (int fildes, void *buf, size_t nbyte);
00380   size_t _win_fwrite (const void *buffer, size_t size, size_t count,
00381                       FILE * stream);
00382   size_t _win_fread (void *buffer, size_t size, size_t count, FILE * stream);
00383   int _win_symlink (const char *path1, const char *path2);
00384   void *_win_mmap (void *start, size_t len, int access, int flags, int fd,
00385                    unsigned long long offset);
00386   int _win_munmap (void *start, size_t length);
00387   int _win_lstat (const char *path, struct stat *buf);
00388   int _win_lstat64 (const char *path, struct stat64 *buf);
00389   int _win_readlink (const char *path, char *buf, size_t bufsize);
00390   int _win_accept (SOCKET s, struct sockaddr *addr, int *addrlen);
00391   int _win_printf (const char *format, ...);
00392   int _win_fprintf (FILE * f, const char *format, ...);
00393   int _win_vprintf (const char *format, va_list ap);
00394   int _win_vfprintf (FILE * stream, const char *format, va_list arg_ptr);
00395   int _win_vsprintf (char *dest, const char *format, va_list arg_ptr);
00396   int _win_vsnprintf (char *str, size_t size, const char *format,
00397                       va_list arg_ptr);
00398   int _win_snprintf (char *str, size_t size, const char *format, ...);
00399   int _win_sprintf (char *dest, const char *format, ...);
00400   int _win_vsscanf (const char *str, const char *format, va_list arg_ptr);
00401   int _win_sscanf (const char *str, const char *format, ...);
00402   int _win_vfscanf (FILE * stream, const char *format, va_list arg_ptr);
00403   int _win_vscanf (const char *format, va_list arg_ptr);
00404   int _win_scanf (const char *format, ...);
00405   int _win_fscanf (FILE * stream, const char *format, ...);
00406   pid_t _win_waitpid (pid_t pid, int *stat_loc, int options);
00407   int _win_bind (SOCKET s, const struct sockaddr *name, int namelen);
00408   int _win_connect (SOCKET s, const struct sockaddr *name, int namelen);
00409   int _win_getpeername (SOCKET s, struct sockaddr *name, int *namelen);
00410   int _win_getsockname (SOCKET s, struct sockaddr *name, int *namelen);
00411   int _win_getsockopt (SOCKET s, int level, int optname, char *optval,
00412                        int *optlen);
00413   int _win_listen (SOCKET s, int backlog);
00414   int _win_recv (SOCKET s, char *buf, int len, int flags);
00415   int _win_recvfrom (SOCKET s, void *buf, int len, int flags,
00416                      struct sockaddr *from, int *fromlen);
00417   int _win_select (int max_fd, fd_set * rfds, fd_set * wfds, fd_set * efds,
00418                    const struct timeval *tv);
00419   int _win_send (SOCKET s, const char *buf, int len, int flags);
00420   int _win_sendto (SOCKET s, const char *buf, int len, int flags,
00421                    const struct sockaddr *to, int tolen);
00422   int _win_setsockopt (SOCKET s, int level, int optname, const void *optval,
00423                        int optlen);
00424   int _win_shutdown (SOCKET s, int how);
00425   SOCKET _win_socket (int af, int type, int protocol);
00426   struct hostent *_win_gethostbyaddr (const char *addr, int len, int type);
00427   struct hostent *_win_gethostbyname (const char *name);
00428   char *_win_strerror (int errnum);
00429   int IsWinNT ();
00430 
00431 #if !HAVE_STRNDUP
00432   char *strndup (const char *s, size_t n);
00433 #endif
00434 #if !HAVE_STRNLEN
00435   size_t strnlen (const char *str, size_t maxlen);
00436 #endif
00437 
00438 #define strcasecmp(a, b) stricmp(a, b)
00439 #define strncasecmp(a, b, c) strnicmp(a, b, c)
00440 
00441 #endif
00442 /* WINDOWS */
00443 
00444 #ifndef WINDOWS
00445 #define DIR_SEPARATOR '/'
00446 #define DIR_SEPARATOR_STR "/"
00447 #define PATH_SEPARATOR ';'
00448 #define PATH_SEPARATOR_STR ";"
00449 #define NEWLINE "\n"
00450 
00451 #ifdef ENABLE_NLS
00452 #define BINDTEXTDOMAIN(d, n) bindtextdomain(d, n)
00453 #endif
00454 #define CREAT(p, m) creat(p, m)
00455 #undef FOPEN
00456 #define FOPEN(f, m) fopen(f, m)
00457 #define OPENDIR(d) opendir(d)
00458 #define OPEN(f) open(f)
00459 #define CHDIR(d) chdir(d)
00460 #define CLOSE(f) close(f)
00461 #define RMDIR(f) rmdir(f)
00462 #define ACCESS(p, m) access(p, m)
00463 #define CHMOD(f, p) chmod(f, p)
00464 #define FSTAT(h, b) fstat(h, b)
00465 #define PIPE(h) pipe(h)
00466 #define REMOVE(p) remove(p)
00467 #define RENAME(o, n) rename(o, n)
00468 #define STAT(p, b) stat(p, b)
00469 #define STAT64(p, b) stat64(p, b)
00470 #define UNLINK(f) unlink(f)
00471 #define WRITE(f, b, n) write(f, b, n)
00472 #define READ(f, b, n) read(f, b, n)
00473 #define GN_FREAD(b, s, c, f) fread(b, s, c, f)
00474 #define GN_FWRITE(b, s, c, f) fwrite(b, s, c, f)
00475 #define SYMLINK(a, b) symlink(a, b)
00476 #define MMAP(s, l, p, f, d, o) mmap(s, l, p, f, d, o)
00477 #define MUNMAP(s, l) munmap(s, l)
00478 #define STRERROR(i) strerror(i)
00479 #define RANDOM() random()
00480 #define READLINK(p, b, s) readlink(p, b, s)
00481 #define LSTAT(p, b) lstat(p, b)
00482 #define LSTAT64(p, b) lstat64(p, b)
00483 #define PRINTF printf
00484 #define FPRINTF fprintf
00485 #define VPRINTF(f, a) vprintf(f, a)
00486 #define VFPRINTF(s, f, a) vfprintf(s, f, a)
00487 #define VSPRINTF(d, f, a) vsprintf(d, f, a)
00488 #define VSNPRINTF(str, size, fmt, a) vsnprintf(str, size, fmt, a)
00489 #define _REAL_SNPRINTF snprintf
00490 #define SPRINTF sprintf
00491 #define VSSCANF(s, f, a) vsscanf(s, f, a)
00492 #define SSCANF sscanf
00493 #define VFSCANF(s, f, a) vfscanf(s, f, a)
00494 #define VSCANF(f, a) vscanf(f, a)
00495 #define SCANF scanf
00496 #define FSCANF fscanf
00497 #define WAITPID(p, s, o) waitpid(p, s, o)
00498 #define ACCEPT(s, a, l) accept(s, a, l)
00499 #define BIND(s, n, l) bind(s, n, l)
00500 #define CONNECT(s, n, l) connect(s, n, l)
00501 #define GETPEERNAME(s, n, l) getpeername(s, n, l)
00502 #define GETSOCKNAME(s, n, l) getsockname(s, n, l)
00503 #define GETSOCKOPT(s, l, o, v, p) getsockopt(s, l, o, v, p)
00504 #define LISTEN(s, b) listen(s, b)
00505 #define RECV(s, b, l, f) recv(s, b, l, f)
00506 #define RECVFROM(s, b, l, f, r, o) recvfrom(s, b, l, f, r, o)
00507 #define SELECT(n, r, w, e, t) select(n, r, w, e, t)
00508 #define SEND(s, b, l, f) send(s, b, l, f)
00509 #define SENDTO(s, b, l, f, o, n) sendto(s, b, l, f, o, n)
00510 #define SETSOCKOPT(s, l, o, v, n) setsockopt(s, l, o, v, n)
00511 #define SHUTDOWN(s, h) shutdown(s, h)
00512 #define SOCKET(a, t, p) socket(a, t, p)
00513 #define GETHOSTBYADDR(a, l, t) gethostbyname(a, l, t)
00514 #define GETHOSTBYNAME(n) gethostbyname(n)
00515 #else
00516 #define DIR_SEPARATOR '\\'
00517 #define DIR_SEPARATOR_STR "\\"
00518 #define PATH_SEPARATOR ':'
00519 #define PATH_SEPARATOR_STR ":"
00520 #define NEWLINE "\r\n"
00521 
00522 #ifdef ENABLE_NLS
00523 #define BINDTEXTDOMAIN(d, n) _win_bindtextdomain(d, n)
00524 #endif
00525 #define CREAT(p, m) _win_creat(p, m)
00526 #define FOPEN(f, m) _win_fopen(f, m)
00527 #define OPENDIR(d) _win_opendir(d)
00528 #define OPEN(f) _win_open(f)
00529 #define CHDIR(d) _win_chdir(d)
00530 #define CLOSE(f) _win_close(f)
00531 #define FSTAT(h, b) _win_fstat(h, b)
00532 #define RMDIR(f) _win_rmdir(f)
00533 #define ACCESS(p, m) _win_access(p, m)
00534 #define CHMOD(f, p) _win_chmod(f, p)
00535 #define PIPE(h) _win_pipe(h)
00536 #define RANDOM() _win_random()
00537 #define REMOVE(p) _win_remove(p)
00538 #define RENAME(o, n) _win_rename(o, n)
00539 #define STAT(p, b) _win_stat(p, b)
00540 #define STAT64(p, b) _win_stat64(p, b)
00541 #define UNLINK(f) _win_unlink(f)
00542 #define WRITE(f, b, n) _win_write(f, b, n)
00543 #define READ(f, b, n) _win_read(f, b, n)
00544 #define GN_FREAD(b, s, c, f) _win_fread(b, s, c, f)
00545 #define GN_FWRITE(b, s, c, f) _win_fwrite(b, s, c, f)
00546 #define SYMLINK(a, b) _win_symlink(a, b)
00547 #define MMAP(s, l, p, f, d, o) _win_mmap(s, l, p, f, d, o)
00548 #define MUNMAP(s, l) _win_munmap(s, l)
00549 #define STRERROR(i) _win_strerror(i)
00550 #define READLINK(p, b, s) _win_readlink(p, b, s)
00551 #define LSTAT(p, b) _win_lstat(p, b)
00552 #define LSTAT64(p, b) _win_lstat64(p, b)
00553 #define PRINTF(f, ...) _win_printf(f , __VA_ARGS__)
00554 #define FPRINTF(fil, fmt, ...) _win_fprintf(fil, fmt, __VA_ARGS__)
00555 #define VPRINTF(f, a) _win_vprintf(f, a)
00556 #define VFPRINTF(s, f, a) _win_vfprintf(s, f, a)
00557 #define VSPRINTF(d, f, a) _win_vsprintf(d, f, a)
00558 #define VSNPRINTF(str, size, fmt, a) _win_vsnprintf(str, size, fmt, a)
00559 #define _REAL_SNPRINTF(str, size, fmt, ...) _win_snprintf(str, size, fmt, __VA_ARGS__)
00560 #define SPRINTF(d, f, ...) _win_sprintf(d, f, __VA_ARGS__)
00561 #define VSSCANF(s, f, a) _win_vsscanf(s, f, a)
00562 #define SSCANF(s, f, ...) _win_sscanf(s, f, __VA_ARGS__)
00563 #define VFSCANF(s, f, a) _win_vfscanf(s, f, a)
00564 #define VSCANF(f, a) _win_vscanf(f, a)
00565 #define SCANF(f, ...) _win_scanf(f, __VA_ARGS__)
00566 #define FSCANF(s, f, ...) _win_fscanf(s, f, __VA_ARGS__)
00567 #define WAITPID(p, s, o) _win_waitpid(p, s, o)
00568 #define ACCEPT(s, a, l) _win_accept(s, a, l)
00569 #define BIND(s, n, l) _win_bind(s, n, l)
00570 #define CONNECT(s, n, l) _win_connect(s, n, l)
00571 #define GETPEERNAME(s, n, l) _win_getpeername(s, n, l)
00572 #define GETSOCKNAME(s, n, l) _win_getsockname(s, n, l)
00573 #define GETSOCKOPT(s, l, o, v, p) _win_getsockopt(s, l, o, v, p)
00574 #define LISTEN(s, b) _win_listen(s, b)
00575 #define RECV(s, b, l, f) _win_recv(s, b, l, f)
00576 #define RECVFROM(s, b, l, f, r, o) _win_recvfrom(s, b, l, f, r, o)
00577 #define SELECT(n, r, w, e, t) _win_select(n, r, w, e, t)
00578 #define SEND(s, b, l, f) _win_send(s, b, l, f)
00579 #define SENDTO(s, b, l, f, o, n) _win_sendto(s, b, l, f, o, n)
00580 #define SETSOCKOPT(s, l, o, v, n) _win_setsockopt(s, l, o, v, n)
00581 #define SHUTDOWN(s, h) _win_shutdown(s, h)
00582 #define SOCKET(a, t, p) _win_socket(a, t, p)
00583 #define GETHOSTBYADDR(a, l, t) _win_gethostbyname(a, l, t)
00584 #define GETHOSTBYNAME(n) _win_gethostbyname(n)
00585 #endif
00586 
00587 
00588 #ifdef __cplusplus
00589 }
00590 #endif
00591 
00592 
00593 #endif
00594 /* _PLIBC_H_ */
00595 
00596 /* end of plibc.h */

Generated on Fri Feb 27 18:18:40 2009 for GNU libmicrohttpd by  doxygen 1.5.8