]> pd.if.org Git - pdclib/blob - functions/wchar/wcsrchr.c
dos2unix
[pdclib] / functions / wchar / wcsrchr.c
1 /* wcsrchr( const wchar_t *, wchar_t );
2
3    This file is part of the Public Domain C Library (PDCLib).
4    Permission is granted to use, modify, and / or redistribute at will.
5 */
6
7 #include <wchar.h>
8 #include <stddef.h>
9
10 #ifndef REGTEST
11
12 wchar_t *wcsrchr(const wchar_t * haystack, wchar_t needle)
13 {
14     wchar_t *found = NULL;
15     while(*haystack) {
16         if(*haystack == needle) found = (wchar_t*) haystack;
17         haystack++;
18     }
19     return found;
20 }
21
22
23 #endif
24
25 #ifdef TEST
26 #include "_PDCLIB_test.h"
27
28 int main( void )
29 {
30     return TEST_RESULTS;
31 }
32
33 #endif