Use dos.library/CreateNewProc() instead of alib/CreateNewProcTags()
[tangerine.git] / compiler / clib / memchr.c
blobd2101ab6645a296dc3b36e5441c752bac7c9b80e
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 ANSI C function memchr().
6 */
8 #include <proto/exec.h>
10 /*****************************************************************************
12 NAME */
13 #include <string.h>
15 void * memchr (
17 /* SYNOPSIS */
18 const void * mem,
19 int c,
20 size_t n)
22 /* FUNCTION
23 Copy the contents of a part of memory to another. Both areas
24 must not overlap. If they do, use memmove().
26 INPUTS
27 dest - The first byte of the destination area in memory
28 src - The first byte of the source area in memory
29 count - How many bytes to copy
31 RESULT
32 dest.
34 NOTES
36 EXAMPLE
38 BUGS
40 SEE ALSO
42 INTERNALS
44 ******************************************************************************/
46 const char * ptr = (char *)mem;
48 while (n)
50 if (*ptr == c)
51 return ((void *)ptr);
53 n --;
54 ptr ++;
57 return NULL;
58 } /* memchr */