1*48351Scael.\" Copyright (c) 1990, 1991 The Regents of the University of California. 241947Sbostic.\" All rights reserved. 341947Sbostic.\" 441947Sbostic.\" This code is derived from software contributed to Berkeley by 541947Sbostic.\" Chris Torek. 641947Sbostic.\" %sccs.include.redist.man% 741947Sbostic.\" 8*48351Scael.\" @(#)index.3 5.3 (Berkeley) 04/19/91 941947Sbostic.\" 10*48351Scael.Dd 11*48351Scael.Dt INDEX 3 12*48351Scael.Os 13*48351Scael.Sh NAME 14*48351Scael.Nm index 15*48351Scael.Nd locate character in string 16*48351Scael.Sh SYNOPSIS 17*48351Scael.Fd #include <string.h> 18*48351Scael.Ft char * 19*48351Scael.Fn index "const char *s" "int c" 20*48351Scael.Sh DESCRIPTION 21*48351ScaelThe 22*48351Scael.Fn index 23*48351Scaelfunction 24*48351Scaellocates the first character matching 25*48351Scael.Fa c 2641947Sbostic(converted to a 27*48351Scael.Em char ) 2841947Sbosticin the null-terminated string 29*48351Scael.Fa s . 30*48351Scael.Sh RETURN VALUES 31*48351ScaelThe character 32*48351Scael.Fa c 33*48351Scaelis returned if it is found; otherwise 34*48351Scael.Dv NULL 35*48351Scaelis returned. 3641947SbosticIf 37*48351Scael.Fa c 3841947Sbosticis '\e0', 39*48351Scael.Fn index 4041947Sbosticlocates the terminating '\e0'. 41*48351Scael.Sh SEE ALSO 42*48351Scael.Xr memchr 3 , 43*48351Scael.Xr rindex 3 , 44*48351Scael.Xr strchr 3 , 45*48351Scael.Xr strcspn 3 , 46*48351Scael.Xr strpbrk 3 , 47*48351Scael.Xr strrchr 3 , 48*48351Scael.Xr strsep 3 , 49*48351Scael.Xr strspn 3 , 50*48351Scael.Xr strstr 3 , 51*48351Scael.Xr strtok 3 52*48351Scael.Sh HISTORY 53*48351ScaelA 54*48351Scael.Fn index 55*48351Scaelfunction appeared in 56*48351Scael.At v6 . 57