Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

memchr(3) OSS Library Calls Reference Manual
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 and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcredll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycredll
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).
4188 Hewlett-Packard Company 527187-017