-/* mbsinit( mbstate_t * ps )\r
-\r
- This file is part of the Public Domain C Library (PDCLib).\r
- Permission is granted to use, modify, and / or redistribute at will.\r
-*/\r
-\r
-#include <wchar.h>\r
-#ifndef REGTEST\r
-#include "_PDCLIB_encoding.h"\r
-#include "_PDCLIB_locale.h"\r
-\r
-static int _PDCLIB_mbsinit_l( const mbstate_t *ps, locale_t l )\r
-{\r
- if( ps ) {\r
- return ps->_Surrogate == 0\r
- && ps->_PendState == 0\r
- && l->_Codec->__mbsinit(ps);\r
- } else return 1;\r
-}\r
-\r
-int mbsinit( const mbstate_t * ps )\r
-{\r
- return _PDCLIB_mbsinit_l(ps, _PDCLIB_threadlocale());\r
-}\r
-\r
-#endif\r
-\r
-#ifdef TEST\r
-#include "_PDCLIB_test.h"\r
-\r
-int main( void )\r
-{\r
- mbstate_t mbs;\r
- memset(&mbs, 0, sizeof mbs);\r
-\r
- TESTCASE(mbsinit(NULL) != 0);\r
- TESTCASE(mbsinit(&mbs) != 0);\r
-\r
-#ifndef REGTEST\r
- // Surrogate pending\r
- mbs._Surrogate = 0xFEED;\r
- TESTCASE(mbsinit(&mbs) == 0);\r
-\r
- mbs._Surrogate = 0;\r
- mbs._PendState = 1;\r
- TESTCASE(mbsinit(&mbs) == 0);\r
-#endif\r
- return TEST_RESULTS;\r
-}\r
-#endif\r
-\r
-\r
-\r
+/* mbsinit( mbstate_t * ps )
+
+ This file is part of the Public Domain C Library (PDCLib).
+ Permission is granted to use, modify, and / or redistribute at will.
+*/
+
+#include <wchar.h>
+#ifndef REGTEST
+#include "_PDCLIB_encoding.h"
+#include "_PDCLIB_locale.h"
+
+static int _PDCLIB_mbsinit_l( const mbstate_t *ps, locale_t l )
+{
+ if( ps ) {
+ return ps->_Surrogate == 0
+ && ps->_PendState == 0
+ && l->_Codec->__mbsinit(ps);
+ } else return 1;
+}
+
+int mbsinit( const mbstate_t * ps )
+{
+ return _PDCLIB_mbsinit_l(ps, _PDCLIB_threadlocale());
+}
+
+#endif
+
+#ifdef TEST
+#include "_PDCLIB_test.h"
+
+int main( void )
+{
+ mbstate_t mbs;
+ memset(&mbs, 0, sizeof mbs);
+
+ TESTCASE(mbsinit(NULL) != 0);
+ TESTCASE(mbsinit(&mbs) != 0);
+
+#ifndef REGTEST
+ // Surrogate pending
+ mbs._Surrogate = 0xFEED;
+ TESTCASE(mbsinit(&mbs) == 0);
+
+ mbs._Surrogate = 0;
+ mbs._PendState = 1;
+ TESTCASE(mbsinit(&mbs) == 0);
+#endif
+ return TEST_RESULTS;
+}
+#endif
+
+
+