summaryrefslogtreecommitdiffstats
path: root/src/include/wchar.h
blob: 427bfff7a0d4b5a1eb2eff6ee68548b355793b76 (plain) (blame)
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
26
27
28
29
30
31
#ifndef WCHAR_H
#define WCHAR_H

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
FILE_SECBOOT ( PERMITTED );

#include <stddef.h>

typedef void mbstate_t;

/**
 * Convert wide character to multibyte sequence
 *
 * @v buf		Buffer
 * @v wc		Wide character
 * @v ps		Shift state
 * @ret len		Number of characters written
 *
 * This is a stub implementation, sufficient to handle basic ASCII
 * characters.
 */
static inline __attribute__ (( always_inline ))
size_t wcrtomb ( char *buf, wchar_t wc, mbstate_t *ps __unused ) {
	*buf = wc;
	return 1;
}

extern size_t wcsnlen ( const wchar_t *string, size_t max );
extern size_t wcslen ( const wchar_t *string );

#endif /* WCHAR_H */