Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
OSS Library Calls (w - z) wmemchr(3)
NAME
wmemchr - Finds a wide character 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 <wchar.h>
wchar_t *wmemchr(
const wchar_t *ws,
wchar_t wc,
size_t n);
PARAMETERS
ws Points to the location of a string.
wc Specifies a wide character for which to search.
n Specifies the number of wide characters to search.
DESCRIPTION
The wmemchr( ) function operates on wide-character strings in memory areas. A memory area
is a group of contiguous wide characters bound by a count and not terminated by a null character.
The behavior of this function is not affected by locale and all wchar_t characters are treated
identically; the null wide-character and wchar_t values not corresponding to valid characters are
not treated specially.
The wmemchr( ) function sequentially searches the string at the location pointed to by the ws
parameter until one of the following occurs:
• The first wide character specified by the wc parameter, which is a wchar_t, is encoun-
tered.
• The number of wide characters specified by the n parameter have been checked in the
string at location ws.
A pointer to wide character wc in the string pointed to by ws is returned. When wide character
wc is not encountered after n wide characters have been checked in the string at location ws,a
null pointer is returned.
NOTES
If n is 0 (zero), ws must be a valid pointer; in this instance, the function behaves as if no valid
occurrence of wc is found.
RETURN VALUES
The wmemchr( ) function returns a pointer to the located wide character, or a null pointer if the
wide character does not occur in the targetted area of memory.
RELATED INFORMATION
Functions: wmemcmp(3), wmemcpy(3), wmemmove(3), wmemset(3).
527187-017 Hewlett-Packard Company 8−63