Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

index(3) Guardian Native C Library Calls Reference Manual
NAME
index - Scans string for a first occurrence of a character
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZSTFNSRL
G-series native OSS processes: /G/system/sysnn/zstfnsrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
32-bit H-series and J-series OSS processes: /G/system/sysnn/zcredll
64-bit H-series and J-series OSS processes: /G/system/sysnn/ycredll
SYNOPSIS
#include <strings.h>
char *index (
const char *s,
int c);
PARAMETERS
s Is a pointer to the string to be scanned.
c Is the character being scanned for.
DESCRIPTION
The index( ) function converts the value of the c parameter from an int to an unsigned char.It
then searches the string pointed to by the s parameter for the first occurrence of c|*O. The
index( ) function considers the null terminator to be part of the string.
NOTES
The index( ) function can be called by native processes only.
RETURN VALUES
On successful completion, the index( ) function returns a pointer to the byte which is the first
occurrence of c or a null pointer if the character c does not occur in the string.
ERRORS
None. This function does not set errno.
RELATED INFORMATION
Functions: rindex(3), strchr(3), strrchr(3).
STANDARDS CONFORMANCE
The index( ) function is defined in the XPG4 Version 2 specification.
396 Hewlett-Packard Company 527192-018