Don't try to setup and use X11 shared memory if
[tangerine.git] / compiler / clib / strchr.c
blob55cf8d807e1e550fd679d9a0f77d1965429d0891
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 ANSI C function strchr().
6 */
8 #include <aros/macros.h>
9 #include <stdio.h>
11 /*****************************************************************************
13 NAME */
14 #include <string.h>
16 char * strchr (
18 /* SYNOPSIS */
19 const char * str,
20 int c)
22 /* FUNCTION
23 Searches for a character in a string.
25 INPUTS
26 str - Search this string
27 c - Look for this character
29 RESULT
30 A pointer to the first occurence of c in str or NULL if c is not
31 found in str.
33 NOTES
35 EXAMPLE
36 char buffer[64];
38 strcpy (buffer, "Hello ");
40 // This returns a pointer to the first l in buffer.
41 strchr (buffer, 'l');
43 // This returns NULL
44 strchr (buffer, 'x');
46 BUGS
48 SEE ALSO
49 strrchr()
51 INTERNALS
53 ******************************************************************************/
57 /* those casts are needed to compare chars > 127 */
58 if ((unsigned char)*str == (unsigned char)c)
59 return ((char *)str);
60 } while (*(str++));
62 return NULL;
63 } /* strchr */
65 AROS_MAKE_ALIAS(strchr, index);