blob: 76958ae9043c3dbcf57241ae7c2d5ab568ba7b30 (
plain)
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
32
33
34
35
36
|
#include <stdlib.h>
#include "_stdlib.h"
#ifdef __STDC_VERSION__
#include <wchar.h>
#else
static size_t wcslen(const wchar_t *);
#include "wchar/wcslen.c"
#endif
/** convert wide character string to multibyte string **/
size_t wcstombs(char * restrict s, const wchar_t * restrict pwcs, size_t n)
{
SIGNAL_SAFE(0);
ASSERT_NOOVERLAP(s, n, pwcs, wcslen(pwcs));
(void)s; (void)pwcs; (void)n;
/* TODO */
return 0;
}
/***
converts the wide character string ARGUMENT(pwcs) to a multibyte string, which
is stored at ARGUMENT(s), beginning in the initial shift state. No more than
ARGUMENT(n) bytes are written to ARGUMENT(s). Conversion stops after reaching
a null wide character, which is converted and stored.
***/
/*
UNDEFINED(The memory regions of ARGUMENT(s) and ARGUMENT(pwcs) overlap)
LC_CTYPE
RETURN_FAILURE(-1)
RETURN_SUCCESS(the number of bytes modified, not counting any terminating null)
STDC(1)
*/
|