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