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

Last change on this file since 22018 was 21947, checked in by dmik, 14 years ago

Add MSVCRTtempnam() to minivcrt.lib.

This is mainly to replace _tempnam() broken in kLIBC (see #63)
that may be needed somewhere in the future. This commit also
fixes the MSVCRTtempnam() and _wtempnam() implementations
(the first argument to GetTempPath() cannot be NULL).

File size: 3.9 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#include <stdarg.h>
16#include <stdio.h>
17
18#ifdef __cplusplus
19extern "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
33typedef unsigned long _fsize_t;
34
35struct _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
44int _wchdir(const WCHAR*);
45WCHAR* _wgetcwd(WCHAR*,int);
46WCHAR* _wgetdcwd(int,WCHAR*,int);
47int _wmkdir(const WCHAR*);
48int _wrmdir(const WCHAR*);
49
50WCHAR* _itow(int,WCHAR*,int); /* NTDLL */
51WCHAR* _i64tow(__int64,WCHAR*,int); /* NTDLL */
52WCHAR* _ltow(long,WCHAR*,int); /* NTDLL */
53WCHAR* _ui64tow(unsigned __int64,WCHAR*,int); /* NTDLL */
54WCHAR* _ultow(unsigned long,WCHAR*,int); /* NTDLL */
55
56WCHAR* _wfullpath(WCHAR*,const WCHAR*,MSVCRT(size_t));
57WCHAR* _wgetenv(const WCHAR*);
58void _wmakepath(WCHAR*,const WCHAR*,const WCHAR*,const WCHAR*,const WCHAR*);
59void _wperror(const WCHAR*); /* NTDLL */
60int _wputenv(const WCHAR*);
61void _wsearchenv(const WCHAR*,const WCHAR*,WCHAR*); /* NTDLL */
62void _wsplitpath(const WCHAR*,WCHAR*,WCHAR*,WCHAR*,WCHAR*);
63
64int _wsystem(const WCHAR*);
65int _wtoi(const WCHAR*); /* NTDLL */
66__int64 _wtoi64(const WCHAR*); /* NTDLL */
67long _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
74WCHAR* _wcsdup(const WCHAR*);
75int _wcsicmp(const WCHAR*,const WCHAR*);
76int _wcsicoll(const WCHAR*,const WCHAR*);
77WCHAR* _wcslwr(WCHAR*);
78int _wcsnicmp(const WCHAR*,const WCHAR*,MSVCRT(size_t));
79WCHAR* _wcsnset(WCHAR*,WCHAR,MSVCRT(size_t));
80WCHAR* _wcsrev(WCHAR*);
81WCHAR* _wcsset(WCHAR*,WCHAR);
82WCHAR* _wcsupr(WCHAR*);
83
84int _waccess(const WCHAR*,int);
85int _wchmod(const WCHAR*,int);
86int _wcreat(const WCHAR*,int);
87long _wfindfirst(const WCHAR*,struct _wfinddata_t*);
88int _wfindnext(long,struct _wfinddata_t*);
89WCHAR* _wmktemp(WCHAR*);
90int _wrename(const WCHAR*,const WCHAR*);
91int _wunlink(const WCHAR*);
92
93#define wcstok NTDLL_wcstok
94
95WCHAR* wcstok(WCHAR*,WCHAR*);
96
97#define _stat stat
98struct _stat;
99int _wstat(const WCHAR*,struct _stat*);
100
101int _wremove(const WCHAR*);
102WCHAR* _wtempnam(const WCHAR*,const WCHAR*);
103
104#ifdef __EMX__
105
106char *MSVCRT__fullpath(char * absPath, const char* relPath, unsigned int size);
107#undef _fullpath
108#define _fullpath MSVCRT__fullpath
109
110char *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
120int swprintf(WCHAR*,const WCHAR*,...);
121int snwprintf(WCHAR*,unsigned int,const WCHAR*,...);
122int swscanf(const WCHAR*,const WCHAR*,...);
123
124int _vsnwprintf(WCHAR*,unsigned int,const WCHAR *,va_list);
125int vswprintf(WCHAR*,const WCHAR*,va_list);
126int vfwprintf(FILE*, const WCHAR*,va_list);
127int vwprintf(const WCHAR*,va_list);
128int 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_ */
Note: See TracBrowser for help on using the repository browser.