X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fwchar%2Fwcschr.c;fp=functions%2Fwchar%2Fwcschr.c;h=51d20a43f859e75d29f8c19fd6f687a8685cf427;hb=10f020f1a39804bbef8cd1cf35ef7c9a8e75c7d6;hp=0000000000000000000000000000000000000000;hpb=f7a440b9c7bb0c686dc2368c4ff53b20bf6371f8;p=pdclib.old diff --git a/functions/wchar/wcschr.c b/functions/wchar/wcschr.c new file mode 100644 index 0000000..51d20a4 --- /dev/null +++ b/functions/wchar/wcschr.c @@ -0,0 +1,32 @@ +/* wcschr( const wchar_t *, wchar_t ); + + This file is part of the Public Domain C Library (PDCLib). + Permission is granted to use, modify, and / or redistribute at will. +*/ + +#include +#include + +#ifndef REGTEST + +wchar_t *wcschr(const wchar_t * haystack, wchar_t needle) +{ + while(*haystack) { + if(*haystack == needle) return (wchar_t*) haystack; + haystack++; + } + return NULL; +} + + +#endif + +#ifdef TEST +#include <_PDCLIB_test.h> + +int main( void ) +{ + return TEST_RESULTS; +} + +#endif