index.c 448 B

123456789101112131415161718192021
  1. /* Stub implementation of (obsolete) index(). */
  2. /*
  3. @deftypefn Supplemental char* index (char *@var{s}, int @var{c})
  4. Returns a pointer to the first occurrence of the character @var{c} in
  5. the string @var{s}, or @code{NULL} if not found. The use of @code{index} is
  6. deprecated in new programs in favor of @code{strchr}.
  7. @end deftypefn
  8. */
  9. extern char * strchr(const char *, int);
  10. char *
  11. index (const char *s, int c)
  12. {
  13. return strchr (s, c);
  14. }