Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)
Guardian Native C Library Calls (s) strspn(3)
NAME
strspn - 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 native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
H-series OSS processes: /G/system/zdllnnn/zcredll
SYNOPSIS
#include <string.h>
size_t strspn(
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 strspn( ) function computes the length of the maximum initial segment of the string pointed
to by the s1 parameter, which consists entirely of bytes from the string pointed to by the s2
parameter.
The strspn( ) 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 strspn( ) function returns the length of the string segment. Oth-
erwise, a value of -1 cast to size_t is returned.
ERRORS
None. This function does not set errno.
RELATED INFORMATION
Functions: strcat(3), strcspn(3).
527192-005 Hewlett-Packard Company 6−77