]> pd.if.org Git - pdclib/blobdiff - opt/basecodecs/_PDCLIB_ascii.c
PDCLIB-25 #resolve #comment Made ctype, wctype and codec data const.(This may be...
[pdclib] / opt / basecodecs / _PDCLIB_ascii.c
index 86001aff538f2423b58b6c3bb4e9dd90629f55eb..7c73d1baf613dc9d8a15511831ff613e014a2c6c 100644 (file)
@@ -9,6 +9,9 @@
 #include <uchar.h>
 #include <_PDCLIB_encoding.h>
 
+static bool ascii_mbsinit( const mbstate_t *ps )
+{ return 1; }
+
 static bool asciitoc32(
     char32_t       *restrict *restrict   p_outbuf,
     size_t                   *restrict   p_outsz,
@@ -59,9 +62,11 @@ static bool c32toascii(
     return true;
 }
 
-struct _PDCLIB_charcodec _PDCLIB_ascii_codec = {
+const struct _PDCLIB_charcodec _PDCLIB_ascii_codec = {
+    .__mbsinit   = ascii_mbsinit,
     .__mbstoc32s = asciitoc32,
     .__c32stombs = c32toascii,
+    .__mb_max    = 1,
 };
 
 #endif