ReactOS  0.4.13-dev-455-g28ed234
unicode.h
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS
3  * LICENSE: LGPL v2.1 or any later version
4  * PURPOSE: Map Wine's Unicode functions to native wcs* functions wherever possible
5  * AUTHORS: ?
6  */
7 
8 #ifndef __WINE_WINE_UNICODE_H
9 #define __WINE_WINE_UNICODE_H
10 
11 #include <stdarg.h>
12 #include <stdlib.h>
13 #include <wchar.h>
14 
15 #include <windef.h>
16 #include <winbase.h>
17 #include <winnls.h>
18 
19 #ifndef WINE_UNICODE_API
20 #define WINE_UNICODE_API
21 #endif
22 
23 #ifndef WINE_UNICODE_INLINE
24 #define WINE_UNICODE_INLINE static inline
25 #endif
26 
27 #define memicmpW(s1,s2,n) _wcsnicmp((s1),(s2),(n))
28 #define strlenW(s) wcslen((s))
29 #define strcpyW(d,s) wcscpy((d),(s))
30 #define strcatW(d,s) wcscat((d),(s))
31 #define strcspnW(d,s) wcscspn((d),(s))
32 #define strstrW(d,s) wcsstr((d),(s))
33 #define strtolW(s,e,b) wcstol((s),(e),(b))
34 #define strchrW(s,c) wcschr((s),(c))
35 #define strrchrW(s,c) wcsrchr((s),(c))
36 #define strncmpW(s1,s2,n) wcsncmp((s1),(s2),(n))
37 #define strncpyW(s1,s2,n) wcsncpy((s1),(s2),(n))
38 #define strcmpW(s1,s2) wcscmp((s1),(s2))
39 #define strcmpiW(s1,s2) _wcsicmp((s1),(s2))
40 #define strncmpiW(s1,s2,n) _wcsnicmp((s1),(s2),(n))
41 #define strtoulW(s1,s2,b) wcstoul((s1),(s2),(b))
42 #define strspnW(str, accept) wcsspn((str),(accept))
43 #define strpbrkW(str, accept) wcspbrk((str),(accept))
44 #define tolowerW(n) towlower((n))
45 #define toupperW(n) towupper((n))
46 #define islowerW(n) iswlower((n))
47 #define isupperW(n) iswupper((n))
48 #define isalphaW(n) iswalpha((n))
49 #define isalnumW(n) iswalnum((n))
50 #define isdigitW(n) iswdigit((n))
51 #define isxdigitW(n) iswxdigit((n))
52 #define isspaceW(n) iswspace((n))
53 #define iscntrlW(n) iswcntrl((n))
54 #define atoiW(s) _wtoi((s))
55 #define atolW(s) _wtol((s))
56 #define strlwrW(s) _wcslwr((s))
57 #define struprW(s) _wcsupr((s))
58 #define sprintfW swprintf
59 #define vsprintfW vswprintf
60 #define snprintfW _snwprintf
61 #define vsnprintfW _vsnwprintf
62 #define isprintW iswprint
63 
64 static __inline unsigned short get_char_typeW( WCHAR ch )
65 {
66  extern const unsigned short wine_wctype_table[];
67  return wine_wctype_table[wine_wctype_table[ch >> 8] + (ch & 0xff)];
68 }
69 
70 static __inline WCHAR *memchrW( const WCHAR *ptr, WCHAR ch, size_t n )
71 {
72  const WCHAR *end;
73  for (end = ptr + n; ptr < end; ptr++) if (*ptr == ch) return (WCHAR *)ptr;
74  return NULL;
75 }
76 
77 static __inline WCHAR *memrchrW( const WCHAR *ptr, WCHAR ch, size_t n )
78 {
79  const WCHAR *end, *ret = NULL;
80  for (end = ptr + n; ptr < end; ptr++) if (*ptr == ch) ret = ptr;
81  return (WCHAR *)ret;
82 }
83 
84 #endif
GLdouble n
Definition: glext.h:7729
GLuint GLuint end
Definition: gl.h:1545
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
const unsigned short wine_wctype_table[]
Definition: wctype.c:6
__wchar_t WCHAR
Definition: xmlstorage.h:180
WINE_UNICODE_INLINE unsigned short get_char_typeW(WCHAR ch)
Definition: unicode.h:149
int ret
WINE_UNICODE_INLINE WCHAR * memrchrW(const WCHAR *ptr, WCHAR ch, size_t n)
Definition: unicode.h:302
WINE_UNICODE_INLINE WCHAR * memchrW(const WCHAR *ptr, WCHAR ch, size_t n)
Definition: unicode.h:295