Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)
Guardian Native C Library Calls (j - m) memchr(3)
NAME
memchr - Finds a character byte in memory
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRESRL
G-series native OSS processes: /G/system/sysnn/zcresrl
H-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
H-series OSS processes: /G/system/zdllnnn/zcredll
SYNOPSIS
#include <string.h>
void *memchr(
const void *s,
int c,
size_t n);
PARAMETERS
s Points to the location of a string.
c Specifies a byte for which to search.
n Specifies the number of bytes to search.
DESCRIPTION
The memchr() 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.
The memchr() function sequentially searches the string at the location pointed to by the s
parameter until one of the following occurs:
• The byte specified by the c parameter, which is converted to an unsigned char,is
encountered.
• The number of bytes specified by the n parameter have been copied to the string at loca-
tion s.
RETURN VALUES
The memchr() function returns a pointer to byte c in the string pointed to by s. When byte c is
not encountered after n bytes have been copied to the string at location s, a null pointer is
returned.
RELATED INFORMATION
Functions: memccpy(3), memcmp(3), memcpy(3), memmove(3), memset(3), strcat(3).
527192-005 Hewlett-Packard Company 4−49