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