]> pd.if.org Git - pdclib/blob - functions/string/strrchr.c
Merged PDPCLIB and Therx code.
[pdclib] / functions / string / strrchr.c
1 // ----------------------------------------------------------------------------
2 // $Id$
3 // ----------------------------------------------------------------------------
4 // Public Domain C Library - http://pdclib.sourceforge.net
5 // This code is Public Domain. Use, modify, and redistribute at will.
6 // ----------------------------------------------------------------------------
7
8 // ----------------------------------------------------------------------------
9 // C++
10
11 const char * strrchr( const char * s, int c ) { /* TODO */ };
12 char * strrchr( char * s, int c ) { /* TODO */ };
13
14 // ----------------------------------------------------------------------------
15 // Standard C
16
17 char * strrchr( const char * s, int c ) { /* TODO */ };
18
19 /* PDPC code - unreviewed
20 {
21     const char *p;
22     
23     p = s + strlen(s);
24     while (p >= s)
25     {
26         if (*p == (char)c) return ((char *)p);
27         p--;
28     }
29     return (NULL);
30 }
31 */