Igor Zlatkovic | 4320d87 | 2002-09-29 17:56:43 +0000 | [diff] [blame] | 1 | /* |
| 2 | * wincecompat.h : wince compatiblity header file |
| 3 | * |
| 4 | * See Copyright for the status of this software. |
| 5 | * |
| 6 | * javier@tiresiassoft.com |
| 7 | * |
| 8 | * 17 Sep 2002 created |
| 9 | */ |
| 10 | |
| 11 | #ifndef __WINCECOMPAT_H__ |
| 12 | #define __WINCECOMPAT_H__ |
| 13 | |
| 14 | #include <stdio.h> |
Daniel Veillard | 59d3ed8 | 2007-04-17 12:44:58 +0000 | [diff] [blame] | 15 | #include <winbase.h> |
Igor Zlatkovic | 4320d87 | 2002-09-29 17:56:43 +0000 | [diff] [blame] | 16 | |
| 17 | #define MAX_STRERROR 31 |
| 18 | |
| 19 | #define O_RDONLY 0x0000 /* open for reading only */ |
| 20 | #define O_WRONLY 0x0001 /* open for writing only */ |
| 21 | #define O_RDWR 0x0002 /* open for reading and writing */ |
| 22 | #define O_APPEND 0x0008 /* writes done at eof */ |
| 23 | |
| 24 | #define O_CREAT 0x0100 /* create and open file */ |
| 25 | #define O_TRUNC 0x0200 /* open and truncate */ |
| 26 | #define O_EXCL 0x0400 /* open only if file doesn't already exist */ |
| 27 | |
Daniel Veillard | 59d3ed8 | 2007-04-17 12:44:58 +0000 | [diff] [blame] | 28 | #define BUFSIZ 4096 |
| 29 | |
Igor Zlatkovic | 4320d87 | 2002-09-29 17:56:43 +0000 | [diff] [blame] | 30 | extern int errno; |
| 31 | /* |
| 32 | Prototypes |
| 33 | */ |
| 34 | int read(int handle, char *buffer, unsigned int len); |
| 35 | int write(int handle, const char *buffer, unsigned int len); |
| 36 | int open(const char *filename,int oflag, ...); |
| 37 | int close(int handle); |
| 38 | char *getenv( const char *varname ); |
Daniel Veillard | 59d3ed8 | 2007-04-17 12:44:58 +0000 | [diff] [blame] | 39 | char *getcwd( char *buffer, unsigned int size); |
Igor Zlatkovic | 4320d87 | 2002-09-29 17:56:43 +0000 | [diff] [blame] | 40 | char *strerror(int errnum); |
| 41 | |
Igor Zlatkovic | 4e2884e | 2002-11-22 17:54:30 +0000 | [diff] [blame] | 42 | /* |
| 43 | Macro'ed inexistant funtion names |
| 44 | |
| 45 | */ |
| 46 | #define snprintf _snprintf |
| 47 | #define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a) |
Igor Zlatkovic | 4320d87 | 2002-09-29 17:56:43 +0000 | [diff] [blame] | 48 | #define perror(_t) MessageBox(NULL, _T("_t"), _T("Error/Warning"), MB_OK) |
| 49 | |
| 50 | #endif |