safec  3.0
Safe C Library - ISO TR24731 Bounds Checking Interface
wcsstr_s.c File Reference
#include "safe_str_lib.h"
+ Include dependency graph for wcsstr_s.c:

Functions

EXPORT errno_t wcsstr_s (wchar_t *restrict dest, rsize_t dmax, const wchar_t *restrict src, rsize_t slen, wchar_t **restrict substring)
 The wcsstr_s() function locates the first occurrence of the wide substring pointed to by src which would be located in the wide string pointed to by dest. More...
 

Function Documentation

◆ wcsstr_s()

EXPORT errno_t wcsstr_s ( wchar_t *restrict  dest,
rsize_t  dmax,
const wchar_t *restrict  src,
rsize_t  slen,
wchar_t **restrict  substring 
)

The wcsstr_s() function locates the first occurrence of the wide substring pointed to by src which would be located in the wide string pointed to by dest.

Remarks
EXTENSION TO
  • ISO/IEC TR 24731, Programming languages, environments and system software interfaces, Extensions to the C Library, Part I: Bounds-checking interfaces
Parameters
[in]destwide string to be searched for the substring
[in]dmaxrestricted maximum length of dest
[in]srcpointer to the wide sub string
[in]slenthe maximum number of wide characters to use from src
[out]substringthe returned substring pointer
Precondition
Neither dest nor src shall be a null pointer.
Neither dmax nor slen shall not be 0.
Neither dmax nor slen shall not be greater than RSIZE_MAX_WSTR.
Return values
EOKwhen successful operation, substring found.
ESNULLPwhen dest/src/substring is NULL pointer
ESZEROLwhen dmax/slen = 0
ESLEMAXwhen dmax/slen > RSIZE_MAX_STR
ESNOTFNDwhen substring not found
See also
wcsstr(), strstr_s(), memcmp32_s()