xref: /netbsd-src/external/gpl3/binutils.old/dist/libiberty/index.c (revision 16dce51364ebe8aeafbae46bc5aa167b8115bc45)
1*16dce513Schristos /* Stub implementation of (obsolete) index(). */
2*16dce513Schristos 
3*16dce513Schristos /*
4*16dce513Schristos 
5*16dce513Schristos @deftypefn Supplemental char* index (char *@var{s}, int @var{c})
6*16dce513Schristos 
7*16dce513Schristos Returns a pointer to the first occurrence of the character @var{c} in
8*16dce513Schristos the string @var{s}, or @code{NULL} if not found.  The use of @code{index} is
9*16dce513Schristos deprecated in new programs in favor of @code{strchr}.
10*16dce513Schristos 
11*16dce513Schristos @end deftypefn
12*16dce513Schristos 
13*16dce513Schristos */
14*16dce513Schristos 
15*16dce513Schristos extern char * strchr(const char *, int);
16*16dce513Schristos 
17*16dce513Schristos char *
index(const char * s,int c)18*16dce513Schristos index (const char *s, int c)
19*16dce513Schristos {
20*16dce513Schristos   return strchr (s, c);
21*16dce513Schristos }
22