source: trunk/include/win/minivcrt.h@ 21504

Last change on this file since 21504 was 21501, checked in by dmik, 15 years ago

minivcrt: Added MSVC-like wcstok() because the POSIX one has a different number of arguments. Note that this definition implies that minivcrt.h is included after any headers that may drag POSIX' wchar.h in.

File size: 3.4 KB
Line 
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
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20#define MSVCRT(x) x
21
22#define FILENAME_MAX 260
23
24#ifndef max
25#define max(a,b) ( (a>b) ? a : b )
26#endif
27#ifndef min
28#define min(a,b) ( (a<b) ? a : b )
29#endif
30
31typedef unsigned long _fsize_t;
32
33struct _wfinddata_t {
34 unsigned attrib;
35 MSVCRT(time_t) time_create;
36 MSVCRT(time_t) time_access;
37 MSVCRT(time_t) time_write;
38 _fsize_t size;
39 WCHAR name[MSVCRT(FILENAME_MAX)];
40};
41
42int _wchdir(const WCHAR*);
43WCHAR* _wgetcwd(WCHAR*,int);
44WCHAR* _wgetdcwd(int,WCHAR*,int);
45int _wmkdir(const WCHAR*);
46int _wrmdir(const WCHAR*);
47
48WCHAR* _itow(int,WCHAR*,int); /* NTDLL */
49WCHAR* _i64tow(__int64,WCHAR*,int); /* NTDLL */
50WCHAR* _ltow(long,WCHAR*,int); /* NTDLL */
51WCHAR* _ui64tow(unsigned __int64,WCHAR*,int); /* NTDLL */
52WCHAR* _ultow(unsigned long,WCHAR*,int); /* NTDLL */
53
54WCHAR* _wfullpath(WCHAR*,const WCHAR*,MSVCRT(size_t));
55WCHAR* _wgetenv(const WCHAR*);
56void _wmakepath(WCHAR*,const WCHAR*,const WCHAR*,const WCHAR*,const WCHAR*);
57void _wperror(const WCHAR*); /* NTDLL */
58int _wputenv(const WCHAR*);
59void _wsearchenv(const WCHAR*,const WCHAR*,WCHAR*); /* NTDLL */
60void _wsplitpath(const WCHAR*,WCHAR*,WCHAR*,WCHAR*,WCHAR*);
61
62int _wsystem(const WCHAR*);
63int _wtoi(const WCHAR*); /* NTDLL */
64__int64 _wtoi64(const WCHAR*); /* NTDLL */
65long _wtol(const WCHAR*); /* NTDLL */
66
67#define _wcsicmp NTDLL__wcsicmp
68#define _wcslwr NTDLL__wcslwr
69#define _wcsnicmp NTDLL__wcsnicmp
70#define _wcsupr NTDLL__wcsupr
71
72WCHAR* _wcsdup(const WCHAR*);
73int _wcsicmp(const WCHAR*,const WCHAR*);
74int _wcsicoll(const WCHAR*,const WCHAR*);
75WCHAR* _wcslwr(WCHAR*);
76int _wcsnicmp(const WCHAR*,const WCHAR*,MSVCRT(size_t));
77WCHAR* _wcsnset(WCHAR*,WCHAR,MSVCRT(size_t));
78WCHAR* _wcsrev(WCHAR*);
79WCHAR* _wcsset(WCHAR*,WCHAR);
80WCHAR* _wcsupr(WCHAR*);
81
82int _waccess(const WCHAR*,int);
83int _wchmod(const WCHAR*,int);
84int _wcreat(const WCHAR*,int);
85long _wfindfirst(const WCHAR*,struct _wfinddata_t*);
86int _wfindnext(long,struct _wfinddata_t*);
87WCHAR* _wmktemp(WCHAR*);
88int _wrename(const WCHAR*,const WCHAR*);
89int _wunlink(const WCHAR*);
90
91#define wcstok NTDLL_wcstok
92
93WCHAR* wcstok(WCHAR*,WCHAR*);
94
95#define _stat stat
96struct _stat;
97int _wstat(const WCHAR*,struct _stat*);
98
99int _wremove(const WCHAR*);
100WCHAR* _wtempnam(const WCHAR*,const WCHAR*);
101
102char *MSVCRT__fullpath(char * absPath, const char* relPath, unsigned int size);
103#undef _fullpath
104#define _fullpath MSVCRT__fullpath
105
106#define swprintf NTDLL_swprintf
107#define swscanf NTDLL_swscanf
108
109int swprintf(WCHAR*,const WCHAR*,...);
110int swscanf(const WCHAR*,const WCHAR*,...);
111
112#define wcsdup _wcsdup
113#define wcsicmp _wcsicmp
114#define wcsnicmp _wcsnicmp
115#define wcsnset _wcsnset
116#define wcsrev _wcsrev
117#define wcsset _wcsset
118#define wcslwr _wcslwr
119#define wcsupr _wcsupr
120#define wcsicoll _wcsicoll
121
122#ifdef __cplusplus
123}
124#endif
125
126#endif /* _minivcrt_h_ */
Note: See TracBrowser for help on using the repository browser.