xref: /openbsd-src/gnu/lib/libiberty/src/index.c (revision 20fce977aadac3358da45d5027d7d19cdc03b0fe)
100bf4279Sespie /* Stub implementation of (obsolete) index(). */
200bf4279Sespie 
39588ddcfSespie /*
49588ddcfSespie 
59588ddcfSespie @deftypefn Supplemental char* index (char *@var{s}, int @var{c})
69588ddcfSespie 
79588ddcfSespie Returns a pointer to the first occurrence of the character @var{c} in
89588ddcfSespie the string @var{s}, or @code{NULL} if not found.  The use of @code{index} is
99588ddcfSespie deprecated in new programs in favor of @code{strchr}.
109588ddcfSespie 
119588ddcfSespie @end deftypefn
129588ddcfSespie 
139588ddcfSespie */
149588ddcfSespie 
15*20fce977Smiod extern char * strchr(const char *, int);
1600bf4279Sespie 
1700bf4279Sespie char *
index(const char * s,int c)18*20fce977Smiod index (const char *s, int c)
1900bf4279Sespie {
2000bf4279Sespie   return strchr (s, c);
2100bf4279Sespie }
22