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

Functions

EXPORT errno_t strspn_s (const char *dest, rsize_t dmax, const char *src, rsize_t slen, rsize_t *count)
 This function computes the prefix length of the string pointed to by dest which consists entirely of characters that are included from the string pointed to by src. More...
 

Function Documentation

◆ strspn_s()

EXPORT errno_t strspn_s ( const char *  dest,
rsize_t  dmax,
const char *  src,
rsize_t  slen,
rsize_t count 
)

This function computes the prefix length of the string pointed to by dest which consists entirely of characters that are included from the string pointed to by src.

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 determine the prefix
[in]dmaxrestricted maximum length of string dest
[in]srcpointer to exclusion string
[in]slenrestricted maximum length of string src
[out]countpointer to a count variable that will be updated with the dest substring length
Precondition
Neither dest nor src shall be a null pointer.
count shall not be a null pointer.
Neither dmax nor slen shall not be 0.
Neither dmax nor slen shall not be greater than RSIZE_MAX_STR.
Return values
EOKwhen successful operation, substring found.
ESNULLPwhen dest/src/substring is NULL pointer
ESZEROLwhen dmax/slen = 0
ESLEMAXwhen dmax/slen > RSIZE_MAX_STR
See also
strcspn_s(), strpbrk_s(), strstr_s(), strprefix_s()