guard the private header
[reactos.git] / reactos / lib / crtdll / old cruft / mbstring / mbsrchr.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/crtdll/mbstring/mbsrchr.c
5 * PURPOSE: Searches for a character in reverse
6 * PROGRAMER: Boudewijn Dekker
7 * UPDATE HISTORY:
8 * 12/04/99: Created
9 */
10
11 #include <msvcrt/mbstring.h>
12
13 size_t _mbclen2(const unsigned int s);
14
15 /*
16 * @implemented
17 */
18 unsigned char * _mbsrchr(const unsigned char *src, unsigned int val)
19 {
20 char *s = (char *)src;
21 short cc = val;
22 const char *sp=(char *)0;
23
24 while (*s)
25 {
26 if (*(short *)s == cc)
27 sp = s;
28 s+= _mbclen2(*s);
29 }
30 if (cc == 0)
31 sp = s;
32 return (char *)sp;
33 }