--- /dev/null
+/* towlower( wint_t )\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 <wctype.h>\r
+#ifndef REGTEST\r
+#include <_PDCLIB_locale.h>\r
+\r
+wint_t towlower( wint_t wc )\r
+{\r
+ wint_t uwc = _PDCLIB_unpackwint( wc );\r
+ _PDCLIB_wcinfo_t *info = _PDCLIB_wcgetinfo( uwc );\r
+ if( info && info->lower != uwc ) \r
+ {\r
+ wc = info->lower;\r
+ }\r
+ return wc;\r
+}\r
+\r
+#endif\r
+\r
+#ifdef TEST\r
+#include <_PDCLIB_test.h>\r
+\r
+int main( void )\r
+{\r
+ TESTCASE(towlower(0) == 0);\r
+ TESTCASE(towlower(L'a') == L'a');\r
+ TESTCASE(towlower(L'B') == L'b');\r
+ TESTCASE(towlower(L'0') == L'0');\r
+\r
+ return TEST_RESULTS;\r
+}\r
+#endif\r
--- /dev/null
+/* towupper( wint_t )\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 <wctype.h>\r
+#ifndef REGTEST\r
+#include <_PDCLIB_locale.h>\r
+\r
+wint_t towupper( wint_t wc )\r
+{\r
+ wint_t uwc = _PDCLIB_unpackwint( wc );\r
+ _PDCLIB_wcinfo_t *info = _PDCLIB_wcgetinfo( uwc );\r
+ if( info && info->upper != uwc ) \r
+ {\r
+ wc = info->upper;\r
+ }\r
+ return wc;\r
+}\r
+\r
+#endif\r
+\r
+#ifdef TEST\r
+#include <_PDCLIB_test.h>\r
+\r
+int main( void )\r
+{\r
+ TESTCASE(towupper(0) == 0);\r
+ TESTCASE(towupper(L'a') == L'A');\r
+ TESTCASE(towupper(L'B') == L'B');\r
+ TESTCASE(towupper(L'0') == L'0');\r
+\r
+ return TEST_RESULTS;\r
+}\r
+#endif\r