xref: /haiku/src/system/libroot/posix/wchar/mbrlen.c (revision 820dca4df6c7bf955c46e8f6521b9408f50b2900)
1 /*
2 ** Copyright 2011, Oliver Tappe, zooey@hirschkaefer.de. All rights reserved.
3 ** Distributed under the terms of the Haiku License.
4 */
5 
6 #include <wchar_private.h>
7 
8 
9  size_t
10 __mbrlen(const char* s, size_t n, mbstate_t* ps)
11  {
12 	if (ps == NULL) {
13 		static mbstate_t internalMbState;
14 		ps = &internalMbState;
15 	}
16 
17 	return __mbrtowc(NULL, s, n, ps);
18  }
19 
20 
21 B_DEFINE_WEAK_ALIAS(__mbrlen, mbrlen);
22