home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************
- *
- * $Source: /unixb/home/unixlib/source/unixlib37/src/c/RCS/strichr,v $
- * $Date: 1996/04/19 21:26:42 $
- * $Revision: 1.1 $
- * $State: Rel $
- * $Author: simon $
- *
- * $Log: strichr,v $
- * Revision 1.1 1996/04/19 21:26:42 simon
- * Initial revision
- *
- ***************************************************************************/
-
- static const char rcs_id[] = "$Id: strichr,v 1.1 1996/04/19 21:26:42 simon Rel $";
-
- #include <string.h>
- #include <ctype.h>
-
- char *
- strichr (register const char *s, register int c)
-
- {
- register int i;
-
- c = isupper (c) ? _tolower (c) : c;
-
- do
- {
- i = *s;
- i = isupper (i) ? _tolower (i) : i;
- if (i == c)
- return ((char *) s);
- }
- while (*s++);
-
- return (0);
- }
-
- char *
- strrichr (register const char *s, register int c)
-
- {
- register int i;
- register const char *_s;
-
- c = isupper (c) ? _tolower (c) : c;
-
- _s = 0;
- do
- {
- i = *s;
- i = isupper (i) ? _tolower (i) : i;
- if (i == c)
- _s = s;
- }
- while (s++, i);
-
- return ((char *) _s);
- }
-