]> pd.if.org Git - pdclib/blob - functions/wchar/wcrtomb.c
Disabled unused function.
[pdclib] / functions / wchar / wcrtomb.c
1 /* wcrtomb(
2     char        *restrict   s, 
3     wchar_t                 wc,
4     mbstate_t   *restrict   ps);
5
6    This file is part of the Public Domain C Library (PDCLib).
7    Permission is granted to use, modify, and / or redistribute at will.
8 */
9
10 #ifndef REGTEST
11 #include <wchar.h>
12 #include <errno.h>
13 #include <stdint.h>
14 #include <assert.h>
15 #include <stdlib.h>
16 #include <_PDCLIB_encoding.h>
17 #include <_PDCLIB_locale.h>
18
19 #if 0
20 /*
21    TODO: Other conversion functions call static ..._l helpers, but this one
22    does not, making this function "defined but not used".
23 */
24 static size_t wcrtomb_l(
25     char        *restrict   s, 
26     wchar_t                 wc,
27     mbstate_t   *restrict   ps,
28     locale_t     restrict   l
29 )
30 {
31     return _PDCLIB_cwcrtomb_l(s, wc, ps, l);
32 }
33 #endif
34
35 size_t wcrtomb(
36     char        *restrict   s, 
37     wchar_t                 wc,
38     mbstate_t   *restrict   ps
39 )
40 {
41     static mbstate_t st;
42     return _PDCLIB_cwcrtomb(s, wc, ps ? ps : &st);
43 }
44
45 #endif
46
47 #ifdef TEST
48 #include <_PDCLIB_test.h>
49
50 int main( void )
51 {
52     TESTCASE( NO_TESTDRIVER );
53     return TEST_RESULTS;
54 }
55 #endif