source: trunk/libs/newlib/src/newlib/libc/string/index.c @ 577

Last change on this file since 577 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 675 bytes
Line 
1/*
2FUNCTION
3        <<index>>---search for character in string
4
5INDEX
6        index
7
8SYNOPSIS
9        #include <strings.h>
10        char * index(const char *<[string]>, int <[c]>);
11
12DESCRIPTION
13        This function finds the first occurence of <[c]> (converted to
14        a char) in the string pointed to by <[string]> (including the
15        terminating null character).
16
17        This function is identical to <<strchr>>.
18
19RETURNS
20        Returns a pointer to the located character, or a null pointer
21        if <[c]> does not occur in <[string]>.
22
23PORTABILITY
24<<index>> requires no supporting OS subroutines.
25
26QUICKREF
27        index - pure
28*/
29
30#include <string.h>
31#include <strings.h>
32
33char *
34index (const char *s,
35        int c)
36{
37  return strchr (s, c);
38}
Note: See TracBrowser for help on using the repository browser.