]> pd.if.org Git - pdclib/blobdiff - functions/wchar/wcslen.c
* Test cleanups: surround the code for all functions by #ifndef REGTEST
[pdclib] / functions / wchar / wcslen.c
diff --git a/functions/wchar/wcslen.c b/functions/wchar/wcslen.c
new file mode 100644 (file)
index 0000000..d5d878d
--- /dev/null
@@ -0,0 +1,29 @@
+/* wcslen( const wchar_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 <wchar.h>\r
+\r
+#ifndef REGTEST\r
+\r
+size_t wcslen( const wchar_t * str )\r
+{\r
+    size_t n = 0;\r
+    while(*(str++)) n++;\r
+    return n;\r
+}\r
+\r
+\r
+#endif\r
+\r
+#ifdef TEST\r
+#include <_PDCLIB_test.h>\r
+\r
+int main( void )\r
+{\r
+    return TEST_RESULTS;\r
+}\r
+\r
+#endif\r