dea64cd477aecacfc09a9f833a43d61ce8e16a5f
1 #ifndef _WINE_UNICODE_H
2 #define _WINE_UNICODE_H
10 #define memicmpW(s1,s2,n) _wcsnicmp((const wchar_t *)(s1),(const wchar_t *)(s2),(n))
11 #define strlenW(s) wcslen((const wchar_t *)(s))
12 #define strcpyW(d,s) wcscpy((wchar_t *)(d),(const wchar_t *)(s))
13 #define strcatW(d,s) wcscat((wchar_t *)(d),(const wchar_t *)(s))
14 #define strcspnW(d,s) wcscspn((wchar_t *)(d),(const wchar_t *)(s))
15 #define strstrW(d,s) wcsstr((const wchar_t *)(d),(const wchar_t *)(s))
16 #define strtolW(s,e,b) wcstol((const wchar_t *)(s),(wchar_t **)(e),(b))
17 #define strchrW(s,c) wcschr((const wchar_t *)(s),(wchar_t)(c))
18 #define strrchrW(s,c) wcsrchr((const wchar_t *)(s),(wchar_t)(c))
19 #define strncmpW(s1,s2,n) wcsncmp((const wchar_t *)(s1),(const wchar_t *)(s2),(n))
20 #define strncpyW(s1,s2,n) wcsncpy((wchar_t *)(s1),(const wchar_t *)(s2),(n))
21 #define strcmpW(s1,s2) wcscmp((const wchar_t *)(s1),(const wchar_t *)(s2))
22 #define strcmpiW(s1,s2) _wcsicmp((const wchar_t *)(s1),(const wchar_t *)(s2))
23 #define strncmpiW(s1,s2,n) _wcsnicmp((const wchar_t *)(s1),(const wchar_t *)(s2),(n))
24 #define strtoulW(s1,s2,b) wcstoul((const wchar_t *)(s1),(wchar_t **)(s2),(b))
25 #define strspnW(str, accept) wcsspn((const wchar_t *)(str), (const wchar_t *)(accept))
26 #define tolowerW(n) towlower((n))
27 #define toupperW(n) towupper((n))
28 #define islowerW(n) iswlower((n))
29 #define isupperW(n) iswupper((n))
30 #define isalphaW(n) iswalpha((n))
31 #define isalnumW(n) iswalnum((n))
32 #define isdigitW(n) iswdigit((n))
33 #define isxdigitW(n) iswxdigit((n))
34 #define isspaceW(n) iswspace((n))
35 #define atoiW(s) _wtoi((const wchar_t *)(s))
36 #define atolW(s) _wtol((const wchar_t *)(s))
37 #define strlwrW(s) _wcslwr((wchar_t *)(s))
38 #define struprW(s) _wcsupr((wchar_t *)(s))
39 #define sprintfW swprintf
40 #define vsprintfW vswprintf
41 #define snprintfW _snwprintf
42 #define vsnprintfW _vsnwprintf
44 #ifndef WINE_UNICODE_API
45 #define WINE_UNICODE_API __attribute__((dllimport))
50 #define __VALIST __gnuc_va_list
52 #define __VALIST char*
54 #endif /* defined __VALIST */
56 int __cdecl
_wtoi (const wchar_t *);
57 long __cdecl
_wtol (const wchar_t *);
58 int __cdecl
swprintf (wchar_t*, const wchar_t*, ...);
59 int __cdecl
_snwprintf (wchar_t*, size_t, const wchar_t*, ...);
60 int __cdecl
_vsnwprintf (wchar_t*, size_t, const wchar_t*, __VALIST
);
62 static __inline WCHAR
*strpbrkW( const WCHAR
*str
, const WCHAR
*accept
)
64 for ( ; *str
; str
++) if (strchrW( accept
, *str
)) return (WCHAR
*)str
;
68 static __inline WCHAR
*memchrW( const WCHAR
*ptr
, WCHAR ch
, size_t n
)
71 for (end
= ptr
+ n
; ptr
< end
; ptr
++) if (*ptr
== ch
) return (WCHAR
*)ptr
;
75 static __inline WCHAR
*memrchrW( const WCHAR
*ptr
, WCHAR ch
, size_t n
)
77 const WCHAR
*end
, *ret
= NULL
;
78 for (end
= ptr
+ n
; ptr
< end
; ptr
++) if (*ptr
== ch
) ret
= ptr
;