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

Guardian Native C Library Calls (t - 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 native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
H-series OSS processes: /G/system/zdllnnn/zcredll
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 Species a wide character for which to search.
n Species 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 rst wide character specied by the wc parameter, which is a wchar_t, is encoun-
tered.
The number of wide characters specied 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).
527192-007 Hewlett-Packard Company 799