-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwchar.h
More file actions
25 lines (20 loc) · 798 Bytes
/
wchar.h
File metadata and controls
25 lines (20 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef WCHAR_H
#define WCHAR_H
/*
* Standalone wide character/multibyte definitions to avoid using system
* library routines. The intent is to allow use on macOS, Linux and ELKS
* without intefering with system library header files.
*/
#include <stdlib.h>
typedef int wchar_t; /* fairly compatible with macOS/Linux systems */
typedef uint32_t Mbstate_t; /* incompatible with mbstate_t on some systems */
#undef MB_LEN_MAX
#define MB_LEN_MAX 4
#undef MB_CUR_MAX
#define MB_CUR_MAX 4
/* mbrtowc -> xmbrtowc as uses Mbstate_t rather than mbstate_t */
size_t xmbrtowc(wchar_t *restrict wc, const char *restrict src, size_t n,
Mbstate_t *restrict st);
size_t xwcrtomb(char *restrict s, wchar_t wc, Mbstate_t *restrict st);
int xwctomb(char *s, wchar_t wc);
#endif