| 1 | /*
|
|---|
| 2 | * Header file for the stripped down version of MSVCRT that only
|
|---|
| 3 | * contains functions specific to the MS VC Runtime.
|
|---|
| 4 | *
|
|---|
| 5 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 6 | *
|
|---|
| 7 | */
|
|---|
| 8 |
|
|---|
| 9 | #ifndef _minivcrt_h_
|
|---|
| 10 | #define _minivcrt_h_
|
|---|
| 11 |
|
|---|
| 12 | #include <winnt.h>
|
|---|
| 13 |
|
|---|
| 14 | #include <time.h>
|
|---|
| 15 | #include <stdarg.h>
|
|---|
| 16 | #include <stdio.h>
|
|---|
| 17 |
|
|---|
| 18 | #ifdef __cplusplus
|
|---|
| 19 | extern "C" {
|
|---|
| 20 | #endif
|
|---|
| 21 |
|
|---|
| 22 | #define MSVCRT(x) x
|
|---|
| 23 |
|
|---|
| 24 | #define FILENAME_MAX 260
|
|---|
| 25 |
|
|---|
| 26 | #ifndef max
|
|---|
| 27 | #define max(a,b) ( (a>b) ? a : b )
|
|---|
| 28 | #endif
|
|---|
| 29 | #ifndef min
|
|---|
| 30 | #define min(a,b) ( (a<b) ? a : b )
|
|---|
| 31 | #endif
|
|---|
| 32 |
|
|---|
| 33 | typedef unsigned long _fsize_t;
|
|---|
| 34 |
|
|---|
| 35 | struct _wfinddata_t {
|
|---|
| 36 | unsigned attrib;
|
|---|
| 37 | MSVCRT(time_t) time_create;
|
|---|
| 38 | MSVCRT(time_t) time_access;
|
|---|
| 39 | MSVCRT(time_t) time_write;
|
|---|
| 40 | _fsize_t size;
|
|---|
| 41 | WCHAR name[MSVCRT(FILENAME_MAX)];
|
|---|
| 42 | };
|
|---|
| 43 |
|
|---|
| 44 | int _wchdir(const WCHAR*);
|
|---|
| 45 | WCHAR* _wgetcwd(WCHAR*,int);
|
|---|
| 46 | WCHAR* _wgetdcwd(int,WCHAR*,int);
|
|---|
| 47 | int _wmkdir(const WCHAR*);
|
|---|
| 48 | int _wrmdir(const WCHAR*);
|
|---|
| 49 |
|
|---|
| 50 | WCHAR* _itow(int,WCHAR*,int); /* NTDLL */
|
|---|
| 51 | WCHAR* _i64tow(__int64,WCHAR*,int); /* NTDLL */
|
|---|
| 52 | WCHAR* _ltow(long,WCHAR*,int); /* NTDLL */
|
|---|
| 53 | WCHAR* _ui64tow(unsigned __int64,WCHAR*,int); /* NTDLL */
|
|---|
| 54 | WCHAR* _ultow(unsigned long,WCHAR*,int); /* NTDLL */
|
|---|
| 55 |
|
|---|
| 56 | WCHAR* _wfullpath(WCHAR*,const WCHAR*,MSVCRT(size_t));
|
|---|
| 57 | WCHAR* _wgetenv(const WCHAR*);
|
|---|
| 58 | void _wmakepath(WCHAR*,const WCHAR*,const WCHAR*,const WCHAR*,const WCHAR*);
|
|---|
| 59 | void _wperror(const WCHAR*); /* NTDLL */
|
|---|
| 60 | int _wputenv(const WCHAR*);
|
|---|
| 61 | void _wsearchenv(const WCHAR*,const WCHAR*,WCHAR*); /* NTDLL */
|
|---|
| 62 | void _wsplitpath(const WCHAR*,WCHAR*,WCHAR*,WCHAR*,WCHAR*);
|
|---|
| 63 |
|
|---|
| 64 | int _wsystem(const WCHAR*);
|
|---|
| 65 | int _wtoi(const WCHAR*); /* NTDLL */
|
|---|
| 66 | __int64 _wtoi64(const WCHAR*); /* NTDLL */
|
|---|
| 67 | long _wtol(const WCHAR*); /* NTDLL */
|
|---|
| 68 |
|
|---|
| 69 | #define _wcsicmp NTDLL__wcsicmp
|
|---|
| 70 | #define _wcslwr NTDLL__wcslwr
|
|---|
| 71 | #define _wcsnicmp NTDLL__wcsnicmp
|
|---|
| 72 | #define _wcsupr NTDLL__wcsupr
|
|---|
| 73 |
|
|---|
| 74 | WCHAR* _wcsdup(const WCHAR*);
|
|---|
| 75 | int _wcsicmp(const WCHAR*,const WCHAR*);
|
|---|
| 76 | int _wcsicoll(const WCHAR*,const WCHAR*);
|
|---|
| 77 | WCHAR* _wcslwr(WCHAR*);
|
|---|
| 78 | int _wcsnicmp(const WCHAR*,const WCHAR*,MSVCRT(size_t));
|
|---|
| 79 | WCHAR* _wcsnset(WCHAR*,WCHAR,MSVCRT(size_t));
|
|---|
| 80 | WCHAR* _wcsrev(WCHAR*);
|
|---|
| 81 | WCHAR* _wcsset(WCHAR*,WCHAR);
|
|---|
| 82 | WCHAR* _wcsupr(WCHAR*);
|
|---|
| 83 |
|
|---|
| 84 | int _waccess(const WCHAR*,int);
|
|---|
| 85 | int _wchmod(const WCHAR*,int);
|
|---|
| 86 | int _wcreat(const WCHAR*,int);
|
|---|
| 87 | long _wfindfirst(const WCHAR*,struct _wfinddata_t*);
|
|---|
| 88 | int _wfindnext(long,struct _wfinddata_t*);
|
|---|
| 89 | WCHAR* _wmktemp(WCHAR*);
|
|---|
| 90 | int _wrename(const WCHAR*,const WCHAR*);
|
|---|
| 91 | int _wunlink(const WCHAR*);
|
|---|
| 92 |
|
|---|
| 93 | #define wcstok NTDLL_wcstok
|
|---|
| 94 |
|
|---|
| 95 | WCHAR* wcstok(WCHAR*,WCHAR*);
|
|---|
| 96 |
|
|---|
| 97 | #define _stat stat
|
|---|
| 98 | struct _stat;
|
|---|
| 99 | int _wstat(const WCHAR*,struct _stat*);
|
|---|
| 100 |
|
|---|
| 101 | int _wremove(const WCHAR*);
|
|---|
| 102 | WCHAR* _wtempnam(const WCHAR*,const WCHAR*);
|
|---|
| 103 |
|
|---|
| 104 | #ifdef __EMX__
|
|---|
| 105 |
|
|---|
| 106 | char *MSVCRT__fullpath(char * absPath, const char* relPath, unsigned int size);
|
|---|
| 107 | #undef _fullpath
|
|---|
| 108 | #define _fullpath MSVCRT__fullpath
|
|---|
| 109 |
|
|---|
| 110 | char *MSVCRT__tempnam(const char *dir, const char *prefix);
|
|---|
| 111 | #undef _tempnam
|
|---|
| 112 | #define _tempnam MSVCRT__tempnam
|
|---|
| 113 |
|
|---|
| 114 | #endif /* __EMX__ */
|
|---|
| 115 |
|
|---|
| 116 | #define swprintf NTDLL_swprintf
|
|---|
| 117 | #define snwprintf NTDLL_snwprintf
|
|---|
| 118 | #define swscanf NTDLL_swscanf
|
|---|
| 119 |
|
|---|
| 120 | int swprintf(WCHAR*,const WCHAR*,...);
|
|---|
| 121 | int snwprintf(WCHAR*,unsigned int,const WCHAR*,...);
|
|---|
| 122 | int swscanf(const WCHAR*,const WCHAR*,...);
|
|---|
| 123 |
|
|---|
| 124 | int _vsnwprintf(WCHAR*,unsigned int,const WCHAR *,va_list);
|
|---|
| 125 | int vswprintf(WCHAR*,const WCHAR*,va_list);
|
|---|
| 126 | int vfwprintf(FILE*, const WCHAR*,va_list);
|
|---|
| 127 | int vwprintf(const WCHAR*,va_list);
|
|---|
| 128 | int fwprintf(FILE*, const WCHAR*, ...);
|
|---|
| 129 |
|
|---|
| 130 | #define wcsdup _wcsdup
|
|---|
| 131 | #define wcsicmp _wcsicmp
|
|---|
| 132 | #define wcsnicmp _wcsnicmp
|
|---|
| 133 | #define wcsnset _wcsnset
|
|---|
| 134 | #define wcsrev _wcsrev
|
|---|
| 135 | #define wcsset _wcsset
|
|---|
| 136 | #define wcslwr _wcslwr
|
|---|
| 137 | #define wcsupr _wcsupr
|
|---|
| 138 | #define wcsicoll _wcsicoll
|
|---|
| 139 |
|
|---|
| 140 | #ifdef __cplusplus
|
|---|
| 141 | }
|
|---|
| 142 | #endif
|
|---|
| 143 |
|
|---|
| 144 | #endif /* _minivcrt_h_ */
|
|---|