summaryrefslogtreecommitdiff
path: root/src/stdlib/wctomb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdlib/wctomb.c')
-rw-r--r--src/stdlib/wctomb.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/stdlib/wctomb.c b/src/stdlib/wctomb.c
new file mode 100644
index 00000000..a2928a8b
--- /dev/null
+++ b/src/stdlib/wctomb.c
@@ -0,0 +1,33 @@
+#include <stdlib.h>
+
+/** convert wide character to multibyte character **/
+
+int wctomb(char * s, wchar_t wchar)
+{
+ /* FIXME: forward dependency on AMD1 */
+ #if 0
+ static mbstate_t ps = 0;
+ return wcrtomb(s, wchar, &ps);
+ #else
+ (void)s; (void)wchar;
+ return 0;
+ #endif
+}
+
+/***
+converts the wide character ARGUMENT(wchar) to a multibyte character, which is
+stored at the address ARGUMENT(s). At most CONSTANT(MB_CUR_MAX) bytes are
+stored.
+
+If ARGUMENT(s) is CONSTANT(NULL), fn(wctomb) tests whether multibyte encodings
+carry state dependency.
+***/
+
+/*
+LC_CTYPE
+RETURN(0, `If ARGUMENT(s) is CONSTANT(NULL), multibyte encodings do not have state dependencies')
+RETURN(NONZERO, `If ARGUMENT(s) is CONSTANT(NULL), multibyte encodings do have state dependencies')
+RETURN(-1, The value of ARGUMENT(wchar) does not correspond to a valid multibyte character)
+RETURN(TYPE(int), The number of bytes contained in the multibyte character corresponding to ARGUMENT(wchar))
+STDC(1)
+*/