]> pd.if.org Git - pdclib.old/commitdiff
PDCLIB-2 PDCLIB-9 wcrtomb
authorOwen Shepherd <owen.shepherd@e43.eu>
Tue, 1 Jan 2013 21:09:49 +0000 (21:09 +0000)
committerOwen Shepherd <owen.shepherd@e43.eu>
Tue, 1 Jan 2013 21:09:49 +0000 (21:09 +0000)
functions/wchar/wcrtomb.c [new file with mode: 0644]

diff --git a/functions/wchar/wcrtomb.c b/functions/wchar/wcrtomb.c
new file mode 100644 (file)
index 0000000..e692923
--- /dev/null
@@ -0,0 +1,48 @@
+/* wcrtomb(
+    char        *restrict   s, 
+    wchar_t                 wc,
+    mbstate_t   *restrict   ps);
+
+   This file is part of the Public Domain C Library (PDCLib).
+   Permission is granted to use, modify, and / or redistribute at will.
+*/
+
+#ifndef REGTEST
+#include <wchar.h>
+#include <errno.h>
+#include <stdint.h>
+#include <assert.h>
+#include <stdlib.h>
+#include <_PDCLIB_encoding.h>
+#include <_PDCLIB_locale.h>
+
+size_t wcrtomb_l(
+    char        *restrict   s, 
+    wchar_t                 wc,
+    mbstate_t   *restrict   ps,
+    locale_t     restrict   l
+)
+{
+    return _PDCLIB_cwcrtomb_l(s, wc, ps, l);
+}
+
+size_t wcrtomb(
+    char        *restrict   s, 
+    wchar_t                 wc,
+    mbstate_t   *restrict   ps
+)
+{
+    return _PDCLIB_cwcrtomb(s, wc, ps);
+}
+
+#endif
+
+#ifdef TEST
+#include <_PDCLIB_test.h>
+
+int main( void )
+{
+    TESTCASE( NO_TESTDRIVER );
+    return TEST_RESULTS;
+}
+#endif