xref: /openbsd/include/uchar.h (revision ee970480)
1 /*	$OpenBSD: uchar.h,v 1.2 2023/09/05 23:16:01 schwarze Exp $	*/
2 /*
3  * Written by Ingo Schwarze <schwarze@openbsd.org>
4  * and placed in the public domain on March 19, 2022.
5  */
6 
7 #ifndef _UCHAR_H_
8 #define _UCHAR_H_
9 
10 #include <sys/cdefs.h>
11 #include <sys/_types.h>
12 
13 #ifndef _MBSTATE_T_DEFINED_
14 #define _MBSTATE_T_DEFINED_
15 typedef __mbstate_t	mbstate_t;
16 #endif
17 
18 #ifndef _SIZE_T_DEFINED_
19 #define _SIZE_T_DEFINED_
20 typedef __size_t	size_t;
21 #endif
22 
23 #define __STDC_UTF_16__	1
24 #define __STDC_UTF_32__	1
25 
26 #if !defined(__cplusplus) || __cplusplus < 201103L
27 typedef __uint16_t	char16_t;
28 typedef __uint32_t	char32_t;
29 #endif
30 
31 __BEGIN_DECLS
32 size_t	mbrtoc16(char16_t * __restrict, const char * __restrict, size_t,
33 	    mbstate_t * __restrict);
34 size_t	c16rtomb(char * __restrict, char16_t, mbstate_t * __restrict);
35 size_t	mbrtoc32(char32_t * __restrict, const char * __restrict, size_t,
36 	    mbstate_t * __restrict);
37 size_t	c32rtomb(char * __restrict, char32_t, mbstate_t * __restrict);
38 __END_DECLS
39 
40 #endif /* !_UCHAR_H_ */
41