ReactOS  0.4.15-dev-499-g1f31905
text.c File Reference
#include <user32.h>
Include dependency graph for text.c:

Go to the source code of this file.

Functions

static WORD GetC1Type (WCHAR Ch)
 
LPSTR WINAPI CharLowerA (LPSTR str)
 
DWORD WINAPI CharLowerBuffA (LPSTR str, DWORD len)
 
DWORD WINAPI CharLowerBuffW (LPWSTR str, DWORD len)
 
LPWSTR WINAPI CharLowerW (LPWSTR x)
 
LPWSTR WINAPI CharPrevW (LPCWSTR start, LPCWSTR x)
 
LPSTR WINAPI CharNextA (LPCSTR ptr)
 
LPSTR WINAPI CharNextExA (WORD codepage, LPCSTR ptr, DWORD flags)
 
LPWSTR WINAPI CharNextW (LPCWSTR x)
 
LPSTR WINAPI CharPrevA (LPCSTR start, LPCSTR ptr)
 
LPSTR WINAPI CharPrevExA (WORD codepage, LPCSTR start, LPCSTR ptr, DWORD flags)
 
BOOL WINAPI CharToOemA (LPCSTR s, LPSTR d)
 
BOOL WINAPI CharToOemBuffA (LPCSTR s, LPSTR d, DWORD len)
 
BOOL WINAPI CharToOemBuffW (LPCWSTR s, LPSTR d, DWORD len)
 
BOOL WINAPI CharToOemW (LPCWSTR s, LPSTR d)
 
LPSTR WINAPI CharUpperA (LPSTR str)
 
DWORD WINAPI CharUpperBuffA (LPSTR str, DWORD len)
 
DWORD WINAPI CharUpperBuffW (LPWSTR str, DWORD len)
 
LPWSTR WINAPI CharUpperW (LPWSTR x)
 
BOOL WINAPI IsCharAlphaA (CHAR Ch)
 
BOOL WINAPI IsCharAlphaNumericA (CHAR Ch)
 
BOOL WINAPI IsCharAlphaNumericW (WCHAR Ch)
 
BOOL WINAPI IsCharAlphaW (WCHAR Ch)
 
BOOL WINAPI IsCharLowerA (CHAR Ch)
 
BOOL WINAPI IsCharLowerW (WCHAR Ch)
 
BOOL WINAPI IsCharUpperA (CHAR Ch)
 
BOOL WINAPI IsCharUpperW (WCHAR Ch)
 
BOOL WINAPI OemToCharA (LPCSTR s, LPSTR d)
 
BOOL WINAPI OemToCharBuffA (LPCSTR s, LPSTR d, DWORD len)
 
BOOL WINAPI OemToCharBuffW (LPCSTR s, LPWSTR d, DWORD len)
 
BOOL WINAPI OemToCharW (LPCSTR s, LPWSTR d)
 

Function Documentation

◆ CharLowerA()

LPSTR WINAPI CharLowerA ( LPSTR  str)

Definition at line 48 of file text.c.

49 {
50  if (!HIWORD(str))
51  {
52  char ch = LOWORD(str);
53  CharLowerBuffA( &ch, 1 );
54  return (LPSTR)(UINT_PTR)(BYTE)ch;
55  }
56 
57  _SEH2_TRY
58  {
60  }
62  {
64  _SEH2_YIELD(return NULL);
65  }
66  _SEH2_END;
67 
68  return str;
69 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
unsigned __int3264 UINT_PTR
Definition: activex.cpp:275
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * LPSTR
Definition: xmlstorage.h:182
_SEH2_TRY
Definition: create.c:4226
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
#define SetLastError(x)
Definition: compat.h:418
unsigned char BYTE
Definition: xxhash.c:193
_SEH2_END
Definition: create.c:4400
#define HIWORD(l)
Definition: typedefs.h:246
DWORD WINAPI CharLowerBuffA(LPSTR str, DWORD len)
Definition: text.c:76
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define LOWORD(l)
Definition: pedump.c:82

◆ CharLowerBuffA()

DWORD WINAPI CharLowerBuffA ( LPSTR  str,
DWORD  len 
)

Definition at line 76 of file text.c.

77 {
78  DWORD lenW;
79  WCHAR *strW;
80  if (!str) return 0; /* YES */
81 
82  lenW = MultiByteToWideChar(CP_ACP, 0, str, len, NULL, 0);
83  strW = HeapAlloc(GetProcessHeap(), 0, lenW * sizeof(WCHAR));
84  if (strW) {
85  MultiByteToWideChar(CP_ACP, 0, str, len, strW, lenW);
86  CharLowerBuffW(strW, lenW);
87  len = WideCharToMultiByte(CP_ACP, 0, strW, lenW, str, len, NULL, NULL);
89  return len;
90  }
91  return 0;
92 }
DWORD WINAPI CharLowerBuffW(LPWSTR str, DWORD len)
Definition: text.c:99
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
WCHAR strW[12]
Definition: clipboard.c:2029
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
#define MultiByteToWideChar
Definition: compat.h:100
#define HeapFree(x, y, z)
Definition: compat.h:403

Referenced by CharLowerA().

◆ CharLowerBuffW()

DWORD WINAPI CharLowerBuffW ( LPWSTR  str,
DWORD  len 
)

Definition at line 99 of file text.c.

100 {
101  DWORD ret = len;
102  if (!str) return 0; /* YES */
103  for (; len; len--, str++) *str = towlower(*str);
104  return ret;
105 }
const WCHAR * str
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define towlower(c)
Definition: wctype.h:97

Referenced by CharLowerBuffA().

◆ CharLowerW()

LPWSTR WINAPI CharLowerW ( LPWSTR  x)

Definition at line 112 of file text.c.

113 {
114  if (HIWORD(x)) return strlwrW(x);
115  else return (LPWSTR)((UINT_PTR)tolowerW(LOWORD(x)));
116 }
unsigned __int3264 UINT_PTR
Definition: activex.cpp:275
WINE_UNICODE_INLINE WCHAR * strlwrW(WCHAR *str)
Definition: unicode.h:281
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
WINE_UNICODE_INLINE WCHAR tolowerW(WCHAR ch)
Definition: unicode.h:135
#define HIWORD(l)
Definition: typedefs.h:246
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define LOWORD(l)
Definition: pedump.c:82

◆ CharNextA()

LPSTR WINAPI CharNextA ( LPCSTR  ptr)

Definition at line 134 of file text.c.

135 {
136  if (!*ptr) return (LPSTR)ptr;
137  if (IsDBCSLeadByte(ptr[0]) && ptr[1]) return (LPSTR)(ptr + 2);
138  return (LPSTR)(ptr + 1);
139 }
char * LPSTR
Definition: xmlstorage.h:182
static PVOID ptr
Definition: dispmode.c:27
BOOL WINAPI IsDBCSLeadByte(BYTE TestByte)
Definition: nls.c:2232

Referenced by CharPrevA().

◆ CharNextExA()

LPSTR WINAPI CharNextExA ( WORD  codepage,
LPCSTR  ptr,
DWORD  flags 
)

Definition at line 146 of file text.c.

147 {
148  if (!*ptr) return (LPSTR)ptr;
149  if (IsDBCSLeadByteEx(codepage, ptr[0]) && ptr[1]) return (LPSTR)(ptr + 2);
150  return (LPSTR)(ptr + 1);
151 }
char * LPSTR
Definition: xmlstorage.h:182
BOOL WINAPI IsDBCSLeadByteEx(UINT CodePage, BYTE TestByte)
Definition: nls.c:2210
static PVOID ptr
Definition: dispmode.c:27
int codepage
Definition: win_iconv.c:156

Referenced by CharPrevExA().

◆ CharNextW()

LPWSTR WINAPI CharNextW ( LPCWSTR  x)

Definition at line 158 of file text.c.

159 {
160  if (*x) x++;
161  return (LPWSTR)x;
162 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ CharPrevA()

LPSTR WINAPI CharPrevA ( LPCSTR  start,
LPCSTR  ptr 
)

Definition at line 169 of file text.c.

170 {
171  while (*start && (start < ptr)) {
173  if (next >= ptr) break;
174  start = next;
175  }
176  return (LPSTR)start;
177 }
LPSTR WINAPI CharNextA(LPCSTR ptr)
Definition: text.c:134
char * LPSTR
Definition: xmlstorage.h:182
static PVOID ptr
Definition: dispmode.c:27
const char * LPCSTR
Definition: xmlstorage.h:183
static unsigned __int64 next
Definition: rand_nt.c:6
GLuint start
Definition: gl.h:1545

◆ CharPrevExA()

LPSTR WINAPI CharPrevExA ( WORD  codepage,
LPCSTR  start,
LPCSTR  ptr,
DWORD  flags 
)

Definition at line 182 of file text.c.

183 {
184  while (*start && (start < ptr))
185  {
187  if (next > ptr) break;
188  start = next;
189  }
190  return (LPSTR)start;
191 }
char * LPSTR
Definition: xmlstorage.h:182
static PVOID ptr
Definition: dispmode.c:27
int codepage
Definition: win_iconv.c:156
const char * LPCSTR
Definition: xmlstorage.h:183
GLbitfield flags
Definition: glext.h:7161
LPSTR WINAPI CharNextExA(WORD codepage, LPCSTR ptr, DWORD flags)
Definition: text.c:146
static unsigned __int64 next
Definition: rand_nt.c:6
GLuint start
Definition: gl.h:1545

◆ CharPrevW()

LPWSTR WINAPI CharPrevW ( LPCWSTR  start,
LPCWSTR  x 
)

Definition at line 123 of file text.c.

124 {
125  if (x > start) return (LPWSTR)(x-1);
126  else return (LPWSTR)x;
127 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint start
Definition: gl.h:1545
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ CharToOemA()

BOOL WINAPI CharToOemA ( LPCSTR  s,
LPSTR  d 
)

Definition at line 198 of file text.c.

199 {
200  if (!s || !d) return FALSE;
201  return CharToOemBuffA(s, d, strlen(s) + 1);
202 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define d
Definition: ke_i.h:81
BOOL WINAPI CharToOemBuffA(LPCSTR s, LPSTR d, DWORD len)
Definition: text.c:209
GLdouble s
Definition: gl.h:2039

Referenced by test_CharToOem_OemToChar().

◆ CharToOemBuffA()

BOOL WINAPI CharToOemBuffA ( LPCSTR  s,
LPSTR  d,
DWORD  len 
)

Definition at line 209 of file text.c.

210 {
211  WCHAR* bufW;
212 
213  if ( !s || !d ) return FALSE;
214 
215  bufW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
216  if (bufW) {
217  MultiByteToWideChar(CP_ACP, 0, s, len, bufW, len);
218  WideCharToMultiByte(CP_OEMCP, 0, bufW, len, d, len, NULL, NULL);
219  HeapFree(GetProcessHeap(), 0, bufW);
220  }
221  return TRUE;
222 }
#define TRUE
Definition: types.h:120
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define d
Definition: ke_i.h:81
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLenum GLsizei len
Definition: glext.h:6722
GLdouble s
Definition: gl.h:2039
#define MultiByteToWideChar
Definition: compat.h:100
#define CP_OEMCP
Definition: winnls.h:228
#define HeapFree(x, y, z)
Definition: compat.h:403

Referenced by CharToOemA(), and test_CharToOem_OemToChar().

◆ CharToOemBuffW()

BOOL WINAPI CharToOemBuffW ( LPCWSTR  s,
LPSTR  d,
DWORD  len 
)

Definition at line 229 of file text.c.

230 {
231  if (!s || !d)
232  return FALSE;
234  return TRUE;
235 }
#define TRUE
Definition: types.h:120
#define WideCharToMultiByte
Definition: compat.h:101
smooth NULL
Definition: ftsmooth.c:416
#define d
Definition: ke_i.h:81
GLenum GLsizei len
Definition: glext.h:6722
GLdouble s
Definition: gl.h:2039
#define CP_OEMCP
Definition: winnls.h:228

Referenced by CharToOemW(), and test_CharToOem_OemToChar().

◆ CharToOemW()

BOOL WINAPI CharToOemW ( LPCWSTR  s,
LPSTR  d 
)

Definition at line 242 of file text.c.

243 {
244  if ( !s || !d ) return FALSE;
245  return CharToOemBuffW(s, d, wcslen(s) + 1);
246 }
BOOL WINAPI CharToOemBuffW(LPCWSTR s, LPSTR d, DWORD len)
Definition: text.c:229
#define d
Definition: ke_i.h:81
GLdouble s
Definition: gl.h:2039
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by test_CharToOem_OemToChar().

◆ CharUpperA()

LPSTR WINAPI CharUpperA ( LPSTR  str)

Definition at line 251 of file text.c.

252 {
253  if (!HIWORD(str))
254  {
255  char ch = LOWORD(str);
256  CharUpperBuffA( &ch, 1 );
257  return (LPSTR)(UINT_PTR)(BYTE)ch;
258  }
259 
260  _SEH2_TRY
261  {
263  }
265  {
267  _SEH2_YIELD(return NULL);
268  }
269  _SEH2_END;
270 
271  return str;
272 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
unsigned __int3264 UINT_PTR
Definition: activex.cpp:275
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * LPSTR
Definition: xmlstorage.h:182
_SEH2_TRY
Definition: create.c:4226
DWORD WINAPI CharUpperBuffA(LPSTR str, DWORD len)
Definition: text.c:279
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
#define SetLastError(x)
Definition: compat.h:418
unsigned char BYTE
Definition: xxhash.c:193
_SEH2_END
Definition: create.c:4400
#define HIWORD(l)
Definition: typedefs.h:246
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define LOWORD(l)
Definition: pedump.c:82

◆ CharUpperBuffA()

DWORD WINAPI CharUpperBuffA ( LPSTR  str,
DWORD  len 
)

Definition at line 279 of file text.c.

280 {
281  DWORD lenW;
282  WCHAR* strW;
283  if (!str) return 0; /* YES */
284 
285  lenW = MultiByteToWideChar(CP_ACP, 0, str, len, NULL, 0);
286  strW = HeapAlloc(GetProcessHeap(), 0, lenW * sizeof(WCHAR));
287  if (strW) {
288  MultiByteToWideChar(CP_ACP, 0, str, len, strW, lenW);
289  CharUpperBuffW(strW, lenW);
290  len = WideCharToMultiByte(CP_ACP, 0, strW, lenW, str, len, NULL, NULL);
292  return len;
293  }
294  return 0;
295 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
WCHAR strW[12]
Definition: clipboard.c:2029
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI CharUpperBuffW(LPWSTR str, DWORD len)
Definition: text.c:302
GLenum GLsizei len
Definition: glext.h:6722
#define MultiByteToWideChar
Definition: compat.h:100
#define HeapFree(x, y, z)
Definition: compat.h:403

Referenced by CharUpperA().

◆ CharUpperBuffW()

DWORD WINAPI CharUpperBuffW ( LPWSTR  str,
DWORD  len 
)

Definition at line 302 of file text.c.

303 {
304  DWORD ret = len;
305  if (!str) return 0; /* YES */
306  for (; len; len--, str++) *str = towupper(*str);
307  return ret;
308 }
const WCHAR * str
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define towupper(c)
Definition: wctype.h:99

Referenced by CharUpperBuffA().

◆ CharUpperW()

LPWSTR WINAPI CharUpperW ( LPWSTR  x)

Definition at line 315 of file text.c.

316 {
317  if (HIWORD(x)) return struprW(x);
318  else return (LPWSTR)((UINT_PTR)toupperW(LOWORD(x)));
319 }
unsigned __int3264 UINT_PTR
Definition: activex.cpp:275
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
WINE_UNICODE_INLINE WCHAR toupperW(WCHAR ch)
Definition: unicode.h:141
#define HIWORD(l)
Definition: typedefs.h:246
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define LOWORD(l)
Definition: pedump.c:82
WINE_UNICODE_INLINE WCHAR * struprW(WCHAR *str)
Definition: unicode.h:288

◆ GetC1Type()

static WORD GetC1Type ( WCHAR  Ch)
static

Definition at line 31 of file text.c.

32 {
33  WORD CharType;
34 
35  if (! GetStringTypeW(CT_CTYPE1, &Ch, 1, &CharType))
36  {
37  return 0;
38  }
39 
40  return CharType;
41 }
#define Ch(x, y, z)
Definition: sha2.c:141
BOOL WINAPI GetStringTypeW(DWORD type, LPCWSTR src, INT count, LPWORD chartype)
Definition: lang.c:1699
unsigned short WORD
Definition: ntddk_ex.h:93
#define CT_CTYPE1
Definition: winnls.h:234

Referenced by IsCharAlphaNumericW(), IsCharAlphaW(), IsCharLowerW(), and IsCharUpperW().

◆ IsCharAlphaA()

BOOL WINAPI IsCharAlphaA ( CHAR  Ch)

Definition at line 326 of file text.c.

327 {
328  WCHAR WCh;
329 
330  MultiByteToWideChar(CP_ACP, 0, &Ch, 1, &WCh, 1);
331  return IsCharAlphaW(WCh);
332 }
#define CP_ACP
Definition: compat.h:99
#define Ch(x, y, z)
Definition: sha2.c:141
__wchar_t WCHAR
Definition: xmlstorage.h:180
BOOL WINAPI IsCharAlphaW(WCHAR Ch)
Definition: text.c:362
#define MultiByteToWideChar
Definition: compat.h:100

◆ IsCharAlphaNumericA()

BOOL WINAPI IsCharAlphaNumericA ( CHAR  Ch)

Definition at line 339 of file text.c.

340 {
341  WCHAR WCh;
342 
343  MultiByteToWideChar(CP_ACP, 0, &Ch, 1, &WCh, 1);
344  return IsCharAlphaNumericW(WCh);
345 }
BOOL WINAPI IsCharAlphaNumericW(WCHAR Ch)
Definition: text.c:352
#define CP_ACP
Definition: compat.h:99
#define Ch(x, y, z)
Definition: sha2.c:141
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MultiByteToWideChar
Definition: compat.h:100

◆ IsCharAlphaNumericW()

BOOL WINAPI IsCharAlphaNumericW ( WCHAR  Ch)

Definition at line 352 of file text.c.

353 {
354  return (GetC1Type(Ch) & (C1_ALPHA|C1_DIGIT)) != 0;
355 }
#define Ch(x, y, z)
Definition: sha2.c:141
static WORD GetC1Type(WCHAR Ch)
Definition: text.c:31
#define C1_ALPHA
Definition: unicode.h:39
#define C1_DIGIT
Definition: unicode.h:33

Referenced by IsCharAlphaNumericA().

◆ IsCharAlphaW()

BOOL WINAPI IsCharAlphaW ( WCHAR  Ch)

Definition at line 362 of file text.c.

363 {
364  return (GetC1Type(Ch) & C1_ALPHA) != 0;
365 }
#define Ch(x, y, z)
Definition: sha2.c:141
static WORD GetC1Type(WCHAR Ch)
Definition: text.c:31
#define C1_ALPHA
Definition: unicode.h:39

Referenced by IsCharAlphaA().

◆ IsCharLowerA()

BOOL WINAPI IsCharLowerA ( CHAR  Ch)

Definition at line 372 of file text.c.

373 {
374  WCHAR WCh;
375 
376  MultiByteToWideChar(CP_ACP, 0, &Ch, 1, &WCh, 1);
377  return IsCharLowerW(WCh);
378 }
#define CP_ACP
Definition: compat.h:99
#define Ch(x, y, z)
Definition: sha2.c:141
BOOL WINAPI IsCharLowerW(WCHAR Ch)
Definition: text.c:385
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MultiByteToWideChar
Definition: compat.h:100

◆ IsCharLowerW()

BOOL WINAPI IsCharLowerW ( WCHAR  Ch)

Definition at line 385 of file text.c.

386 {
387  return (GetC1Type(Ch) & C1_LOWER) != 0;
388 }
#define Ch(x, y, z)
Definition: sha2.c:141
#define C1_LOWER
Definition: unicode.h:32
static WORD GetC1Type(WCHAR Ch)
Definition: text.c:31

Referenced by IsCharLowerA().

◆ IsCharUpperA()

BOOL WINAPI IsCharUpperA ( CHAR  Ch)

Definition at line 395 of file text.c.

396 {
397  WCHAR WCh;
398 
399  MultiByteToWideChar(CP_ACP, 0, &Ch, 1, &WCh, 1);
400  return IsCharUpperW(WCh);
401 }
#define CP_ACP
Definition: compat.h:99
#define Ch(x, y, z)
Definition: sha2.c:141
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MultiByteToWideChar
Definition: compat.h:100
BOOL WINAPI IsCharUpperW(WCHAR Ch)
Definition: text.c:408

◆ IsCharUpperW()

BOOL WINAPI IsCharUpperW ( WCHAR  Ch)

Definition at line 408 of file text.c.

409 {
410  return (GetC1Type(Ch) & C1_UPPER) != 0;
411 }
#define Ch(x, y, z)
Definition: sha2.c:141
static WORD GetC1Type(WCHAR Ch)
Definition: text.c:31
#define C1_UPPER
Definition: unicode.h:31

Referenced by IsCharUpperA().

◆ OemToCharA()

BOOL WINAPI OemToCharA ( LPCSTR  s,
LPSTR  d 
)

Definition at line 418 of file text.c.

419 {
420  if ( !s || !d ) return FALSE;
421  return OemToCharBuffA(s, d, strlen(s) + 1);
422 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define d
Definition: ke_i.h:81
GLdouble s
Definition: gl.h:2039
BOOL WINAPI OemToCharBuffA(LPCSTR s, LPSTR d, DWORD len)
Definition: text.c:427

Referenced by test_CharToOem_OemToChar().

◆ OemToCharBuffA()

BOOL WINAPI OemToCharBuffA ( LPCSTR  s,
LPSTR  d,
DWORD  len 
)

Definition at line 427 of file text.c.

428 {
429  WCHAR* bufW;
430 
431  if ( !s || !d ) return FALSE;
432 
433  bufW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
434  if (bufW) {
435  MultiByteToWideChar(CP_OEMCP, 0, s, len, bufW, len);
436  WideCharToMultiByte(CP_ACP, 0, bufW, len, d, len, NULL, NULL);
437  HeapFree(GetProcessHeap(), 0, bufW);
438  }
439  return TRUE;
440 }
#define TRUE
Definition: types.h:120
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define d
Definition: ke_i.h:81
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLenum GLsizei len
Definition: glext.h:6722
GLdouble s
Definition: gl.h:2039
#define MultiByteToWideChar
Definition: compat.h:100
#define CP_OEMCP
Definition: winnls.h:228
#define HeapFree(x, y, z)
Definition: compat.h:403

Referenced by OemToCharA(), and test_CharToOem_OemToChar().

◆ OemToCharBuffW()

BOOL WINAPI OemToCharBuffW ( LPCSTR  s,
LPWSTR  d,
DWORD  len 
)

Definition at line 447 of file text.c.

448 {
449  if ( !s || !d ) return FALSE;
451  return TRUE;
452 }
#define TRUE
Definition: types.h:120
#define d
Definition: ke_i.h:81
GLenum GLsizei len
Definition: glext.h:6722
GLdouble s
Definition: gl.h:2039
#define MultiByteToWideChar
Definition: compat.h:100
#define CP_OEMCP
Definition: winnls.h:228

Referenced by OemToCharW(), and test_CharToOem_OemToChar().

◆ OemToCharW()

BOOL WINAPI OemToCharW ( LPCSTR  s,
LPWSTR  d 
)

Definition at line 457 of file text.c.

458 {
459  if ( !s || !d ) return FALSE;
460  return OemToCharBuffW(s, d, strlen(s) + 1);
461 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define d
Definition: ke_i.h:81
GLdouble s
Definition: gl.h:2039
BOOL WINAPI OemToCharBuffW(LPCSTR s, LPWSTR d, DWORD len)
Definition: text.c:447

Referenced by test_CharToOem_OemToChar().