source: branches/gcc-kmk/include/win/minivcrt.h@ 21908

Last change on this file since 21908 was 21879, checked in by dmik, 14 years ago

Add snwprintf to minivcrt.h.

This is mainly to be used instead of POSIX snprintf which is
missing from the current kLIBC runtime.

File size: 3.8 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
104char *MSVCRT__fullpath(char * absPath, const char* relPath, unsigned int size);
105#undef _fullpath
106#define _fullpath MSVCRT__fullpath
107
108#define swprintf NTDLL_swprintf
109#define snwprintf NTDLL_snwprintf
110#define swscanf NTDLL_swscanf
111
112int swprintf(WCHAR*,const WCHAR*,...);
113int snwprintf(WCHAR*,unsigned int,const WCHAR*,...);
114int swscanf(const WCHAR*,const WCHAR*,...);
115
116int _vsnwprintf(WCHAR*,unsigned int,const WCHAR *,va_list);
117int vswprintf(WCHAR*,const WCHAR*,va_list);
118int vfwprintf(FILE*, const WCHAR*,va_list);
119int vwprintf(const WCHAR*,va_list);
120int fwprintf(FILE*, const WCHAR*, ...);
121
122#define wcsdup _wcsdup
123#define wcsicmp _wcsicmp
124#define wcsnicmp _wcsnicmp
125#define wcsnset _wcsnset
126#define wcsrev _wcsrev
127#define wcsset _wcsset
128#define wcslwr _wcslwr
129#define wcsupr _wcsupr
130#define wcsicoll _wcsicoll
131
132#ifdef __cplusplus
133}
134#endif
135
136#endif /* _minivcrt_h_ */
Note: See TracBrowser for help on using the repository browser.