xref: /openbsd/lib/libc/locale/mbrtoc32.c (revision 3bef86f7)
1 /*	$OpenBSD: mbrtoc32.c,v 1.1 2023/08/20 15:02:51 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 #include <uchar.h>
8 #include <wchar.h>
9 
10 size_t
11 mbrtoc32(char32_t *pc32, const char *s, size_t n, mbstate_t *ps)
12 {
13 	static mbstate_t mbs;
14 
15 	if (ps == NULL)
16 		ps = &mbs;
17 	return mbrtowc(pc32, s, n, ps);
18 }
19