00001 /* Portable version of strchr() 00002 This function is in the public domain. */ 00003 00004 /* 00005 00006 @deftypefn Supplemental char* strchr (const char *@var{s}, int @var{c}) 00007 00008 Returns a pointer to the first occurrence of the character @var{c} in 00009 the string @var{s}, or @code{NULL} if not found. If @var{c} is itself the 00010 null character, the results are undefined. 00011 00012 @end deftypefn 00013 00014 */ 00015 00016 #include <ansidecl.h> 00017 00018 char * 00019 strchr (s, c) 00020 register const char *s; 00021 int c; 00022 { 00023 do { 00024 if (*s == c) 00025 { 00026 return (char*)s; 00027 } 00028 } while (*s++); 00029 return (0); 00030 }
1.5.6