Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
Guardian Native C Library Calls (s) strcspn(3)
NAME
strcspn - Returns length of initial segment of string
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRESRL
G-series native OSS processes: /G/system/sysnn/zcresrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcredll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycredll
SYNOPSIS
#include <string.h>
size_t strcspn(
const char *s1,
const char *s2);
PARAMETERS
s1 Points to a character string being checked for an initial segment.
s2 Points to a string containing a set of bytes that define the initial segment.
DESCRIPTION
The strcspn() function computes the byte length of the maximum initial segment of the string
pointed to by the s1 parameter, which consists entirely of bytes that are not from the string
pointed to by the s2 parameter.
The strcspn() function treats the s2 parameter as a series of bytes; this function does not treat a
multibyte character as a single unit but rather as a series of separate bytes.
NOTES
There is no equivalent function for multibyte character strings.
RETURN VALUES
Upon successful completion, the strcspn() function returns the length of the string segment.
Otherwise, a value of -1 cast to size_t is returned.
ERRORS
None. This function does not set errno.
RELATED INFORMATION
Functions: strcat(3), strspn(3).
527192-018 Hewlett-Packard Company 6−89