9330 stack overflow when creating a deeply nested dataset
[unleashed.git] / usr / src / man / man3c / index.3c
blob1b3ea8c77a396b71aa9b4701883ae678c7ef3695
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
30 .\"
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
35 .\"
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 .\"
42 .\"
43 .\" Portions Copyright (c) 1992, X/Open Company Limited  All Rights Reserved
44 .\" Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved.
45 .\"
46 .TH INDEX 3C "Jul 24, 2002"
47 .SH NAME
48 index, rindex \- string operations
49 .SH SYNOPSIS
50 .LP
51 .nf
52 #include <strings.h>
54 \fBchar *\fR\fBindex\fR(\fBconst char *\fR\fIs\fR, \fBint\fR \fIc\fR);
55 .fi
57 .LP
58 .nf
59 \fBchar *\fR\fBrindex\fR(\fBconst char *\fR\fIs\fR, \fBint\fR \fIc\fR);
60 .fi
62 .SH DESCRIPTION
63 .sp
64 .LP
65 The \fBindex()\fR and \fBrindex()\fR functions operate on null-terminated
66 strings.
67 .sp
68 .LP
69 The \fBindex()\fR function returns a pointer to the first occurrence of
70 character \fIc\fR in string \fIs\fR.
71 .sp
72 .LP
73 The \fBrindex()\fR function returns a pointer to the last occurrence of
74 character \fIc\fR in string \fIs\fR.
75 .sp
76 .LP
77 Both \fBindex()\fR and  \fBrindex()\fR return a null pointer if \fIc\fR does
78 not occur in the string. The null character terminating a string is considered
79 to be part of the string.
80 .SH USAGE
81 .sp
82 .LP
83 On most modern computer systems, you can \fInot\fR use a null pointer to
84 indicate a null string.  A null pointer is an error and results in an abort of
85 the program.  If you wish to indicate a null string, you must use a pointer
86 that points to an explicit null string.  On some machines and with some
87 implementations of the C programming language, a null pointer, if dereferenced,
88 would yield a null string.  Though often used, this practice is not always
89 portable. Programmers using a null pointer to represent an empty string should
90 be aware of this portability issue.  Even on machines where dereferencing a
91 null pointer does not cause an abort of the program, it does not necessarily
92 yield a null string.
93 .SH ATTRIBUTES
94 .sp
95 .LP
96 See \fBattributes\fR(5) for descriptions of the following attributes:
97 .sp
99 .sp
101 box;
102 c | c
103 l | l .
104 ATTRIBUTE TYPE  ATTRIBUTE VALUE
106 Interface Stability     Standard
109 .SH SEE ALSO
112 \fBbstring\fR(3C), \fBmalloc\fR(3C), \fBstring\fR(3C), \fBattributes\fR(5),
113 \fBstandards\fR(5)