Guardian Native C Library Calls Reference Manual (G06.28+, H06.05+)

memccpy(3) Guardian Native C Library Calls Reference Manual
NAME
memccpy - Copies characters sequentially in memory
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
H-series OSS processes: /G/system/zdllnnn/zcrtldll
SYNOPSIS
#include <string.h>
void *memccpy(
void *s1,
void *s2,
int c,
size_t n);
PARAMETERS
s1 Points to the location of a destination string.
s2 Points to the location of a source string.
c Species a byte for which to search.
n Species the number of bytes to copy.
DESCRIPTION
The memccpy() function operates on strings in memory areas. A memory area is a group of con-
tiguous bytes bound by a count and not terminated by a null character. This memory function
does not check for overow of the receiving memory area.
The memccpy() function sequentially copies bytes from the location pointed to by the s1 param-
eter into the location pointed to by the s2 parameter until one of the following occurs:
The byte specied by the c parameter, which is converted to an unsigned char,is
encountered.
The number of bytes specied by the n parameter have been copied to the string at loca-
tion s1.
A pointer to byte c in the string pointed to by s1 is returned. When byte c is not encountered after
n bytes have been copied to the string at location s1, a null pointer is returned.
RETURN VALUES
The memccpy() function returns the byte specied by the c parameter in the string pointed to by
the s1 parameter. When byte c is not found after the number of bytes specied by the n parame-
ter are scanned, a null pointer is returned.
RELATED INFORMATION
Functions: memchr(3), memcmp(3), memcpy(3), memset(3), memmove(3), strcat(3).
448 Hewlett-Packard Company 527192-007