--- /dev/null
+/* _PDCLIB_mb_cur_max( void )
+
+ This file is part of the Public Domain C Library (PDCLib).
+ Permission is granted to use, modify, and / or redistribute at will.
+*/
+
+#include <locale.h>
+#ifndef REGTEST
+#include <_PDCLIB_locale.h>
+#include <_PDCLIB_encoding.h>
+
+size_t _PDCLIB_mb_cur_max( void )
+{
+ return _PDCLIB_threadlocale()->_Codec->__mb_max;
+}
+
+#endif
+
+#ifdef TEST
+#include <_PDCLIB_test.h>
+
+int main( void )
+{
+ TESTCASE( NO_TESTDRIVER );
+ return TEST_RESULTS;
+}
+#endif
#define NULL _PDCLIB_NULL
#endif
+#ifndef _PDCLIB_MB_CUR_MAX_DEFINED
+#define _PDCLIB_MB_CUR_MAX_DEFINED
+#define MB_CUR_MAX (_PDCLIB_mb_cur_max())
+#endif
+
/* Numeric conversion functions */
/* TODO: atof(), strtof(), strtod(), strtold() */
_PDCLIB_size_t *_PDCLIB_restrict _P_insz,
_PDCLIB_mbstate_t *_PDCLIB_restrict _P_ps
);
+
+ size_t __mb_max;
};
#endif
typedef struct _PDCLIB_locale *_PDCLIB_locale_t;
typedef struct lconv _PDCLIB_lconv_t;
+_PDCLIB_size_t _PDCLIB_mb_cur_max( void );
+
/* -------------------------------------------------------------------------- */
/* stdio */
/* -------------------------------------------------------------------------- */
struct _PDCLIB_charcodec _PDCLIB_ascii_codec = {
.__mbstoc32s = asciitoc32,
.__c32stombs = c32toascii,
+ .__mb_max = 1,
};
#endif
struct _PDCLIB_charcodec _PDCLIB_latin1_codec = {
.__mbstoc32s = latin1toc32,
.__c32stombs = c32tolatin1,
+ .__mb_max = 1,
};
#endif
struct _PDCLIB_charcodec _PDCLIB_utf8_codec = {
.__mbstoc32s = utf8toc32,
.__c32stombs = c32toutf8,
+ .__mb_max = 4,
};
#endif