Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)
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 native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
H-series OSS processes: /G/system/sysnn/zcredll
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.
3−58 Hewlett-Packard Company 527192-005