Debian Codegraph @

src/pt2_unicode.h

raw symbols SCIP
1 #pragma once
2
3 #include <stdint.h>
4 #include <wchar.h>
5
6 // unicode stuff for different platforms
7
8 #ifdef _WIN32
9 typedef wchar_t UNICHAR;
10 #define UNICHAR_STRCPY(a, b) wcscpy(a, b)
11 #define UNICHAR_STRNCPY(a, b, c) wcsncpy(a, b, c)
12 #define UNICHAR_STRCMP(a, b) wcscmp(a, b)
13 #define UNICHAR_STRICMP(a, b, c) _wcsicmp(a, L ## b)
14 #define UNICHAR_STRNCMP(a, b, c) wcsncmp(a, b, c)
15 #define UNICHAR_STRNICMP(a, b, c) _wcsnicmp(a, L ## b, c)
16 #define UNICHAR_STRCAT(a, b) wcscat(a, b)
17 #define UNICHAR_STRDUP(a) _wcsdup(a)
18 #define UNICHAR_FOPEN(a, b) _wfopen(a, L ## b)
19 #define UNICHAR_CHDIR(a) _wchdir(a)
20 #define UNICHAR_GETCWD(a, b) _wgetcwd(a, b)
21 #define UNICHAR_RENAME(a, b) _wrename(a, b)
22 #define UNICHAR_REMOVE(a) _wremove(a)
23 #define UNICHAR_STRLEN(a) wcslen(a)
24 #define UNICHAR_TO_ANSI(a, b, c) unicharToAnsi(a, b, c)
25 #else
26 typedef char UNICHAR;
27 #define UNICHAR_STRCPY(a, b) strcpy(a, b)
28 #define UNICHAR_STRNCPY(a, b, c) strncpy(a, b, c)
29 #define UNICHAR_STRCMP(a, b) strcmp(a, b)
30 #define UNICHAR_STRICMP(a, b, c) _stricmp(a, b)
31 #define UNICHAR_STRNCMP(a, b, c) strncmp(a, b, c)
32 #define UNICHAR_STRNICMP(a, b, c) _strnicmp(a, b, c)
33 #define UNICHAR_STRCAT(a, b) strcat(a, b)
34 #define UNICHAR_STRDUP(a) strdup(a)
35 #define UNICHAR_FOPEN(a, b) fopen(a, b)
36 #define UNICHAR_CHDIR(a) chdir(a)
37 #define UNICHAR_GETCWD(a, b) getcwd(a, b)
38 #define UNICHAR_RENAME(a, b) rename(a, b)
39 #define UNICHAR_REMOVE(a) remove(a)
40 #define UNICHAR_STRLEN(a) strlen(a)
41 #define UNICHAR_TO_ANSI(a, b, c) unicharToAnsi(a, b, c)
42 #endif
43
44 uint32_t unicharToAnsi(char *dstBuffer, const UNICHAR *inputString, uint32_t maxDstLen);