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

Functions

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

Function Documentation

◆ strcasestr_s()

EXPORT errno_t strcasestr_s ( char *  dest,
rsize_t  dmax,
const char *  src,
rsize_t  slen,
char **  substring 
)

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

The comparison is case insensitive.

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]destpointer to string to be searched for the substring
[in]dmaxrestricted maximum length of dest string
[in]srcpointer to the sub string
[in]slenmaximum length of src string
[out]substringreturned pointer to the substring
Precondition
Neither dest nor src shall be a null pointer.
Neither dmax nor slen shall equal zero.
Neither dmax nor slen shall be greater than RSIZE_MAX_STR.
Return values
EOKwhen successful operation, substring found.
ESNULLPwhen dst/src/substring is NULL pointer
ESZEROLwhen dmax/slen = 0
ESLEMAXwhen dmax/slen > RSIZE_MAX_STR
ESNOTFNDwhen substring not found
See also
strstr_s(), strprefix_s()