Determines if the prefix pointed to by src is at the beginning of string pointed to by dest.
The prefix must be a complete match in dest. Useful for command or user input parsing. The scanning stops at the first null in dest or src, or after dmax characters.
- Parameters
-
dest | pointer to string to compare against |
dmax | restricted maximum length of dest |
src | pointer to the prefix |
- 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_STR.
- Return values
-
EOK | when successful operation, substring found. |
ESNULLP | when dest/src/substring is NULL pointer |
ESZEROL | when dmax/slen = 0 |
ESLEMAX | when dmax/slen > RSIZE_MAX_STR |
ESNOTFND | when prefix not found in dest |
- See also
- strspn_s(), strcspn_s(), strpbrk_s(), strstr_s()