ReactOS
0.4.16-dev-1946-g52006dd
memccpy.c
Go to the documentation of this file.
1
/***
2
*memccpy.c - copy bytes until a character is found
3
*
4
* Copyright (c) Microsoft Corporation. All rights reserved.
5
*
6
*Purpose:
7
* defines _memccpy() - copies bytes until a specifed character
8
* is found, or a maximum number of characters have been copied.
9
*
10
*******************************************************************************/
11
12
#include <string.h>
13
14
/***
15
*char *_memccpy(dest, src, c, count) - copy bytes until character found
16
*
17
*Purpose:
18
* Copies bytes from src to dest until count bytes have been
19
* copied, or up to and including the character c, whichever
20
* comes first.
21
*
22
*Entry:
23
* void *dest - pointer to memory to receive copy
24
* void *src - source of bytes
25
* int c - character to stop copy at
26
* size_t count - max number of bytes to copy
27
*
28
*Exit:
29
* returns pointer to byte immediately after c in dest
30
* returns NULL if c was never found
31
*
32
*Exceptions:
33
*
34
*******************************************************************************/
35
36
void
*
__cdecl
_memccpy
(
37
void
*
dest
,
38
const
void
*
src
,
39
int
c
,
40
size_t
count
41
)
42
{
43
while
(
count
&& (*((
char
*)(
dest
= (
char
*)
dest
+ 1) - 1) =
44
*((
char
*)(
src
= (
char
*)
src
+ 1) - 1)) != (
char
)
c
)
45
count
--;
46
47
return
(
count
?
dest
:
NULL
);
48
}
__cdecl
#define __cdecl
Definition:
accygwin.h:79
_memccpy
void *__cdecl _memccpy(void *to, const void *from, int c, size_t count)
Definition:
memccpy.c:7
NULL
#define NULL
Definition:
types.h:112
count
GLuint GLuint GLsizei count
Definition:
gl.h:1545
src
GLenum src
Definition:
glext.h:6340
c
const GLubyte * c
Definition:
glext.h:8905
dest
static char * dest
Definition:
rtl.c:135
sdk
lib
ucrt
string
memccpy.c
Generated on Thu Dec 4 2025 06:16:22 for ReactOS by
1.9.6