]>
Commit | Line | Data |
---|---|---|
224c7076 A |
1 | .\" Copyright (c) 1990, 1991, 1993 |
2 | .\" The Regents of the University of California. All rights reserved. | |
3 | .\" | |
4 | .\" This code is derived from software contributed to Berkeley by | |
5 | .\" Chris Torek. | |
6 | .\" Redistribution and use in source and binary forms, with or without | |
7 | .\" modification, are permitted provided that the following conditions | |
8 | .\" are met: | |
9 | .\" 1. Redistributions of source code must retain the above copyright | |
10 | .\" notice, this list of conditions and the following disclaimer. | |
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
12 | .\" notice, this list of conditions and the following disclaimer in the | |
13 | .\" documentation and/or other materials provided with the distribution. | |
14 | .\" 3. All advertising materials mentioning features or use of this software | |
15 | .\" must display the following acknowledgement: | |
16 | .\" This product includes software developed by the University of | |
17 | .\" California, Berkeley and its contributors. | |
18 | .\" 4. Neither the name of the University nor the names of its contributors | |
19 | .\" may be used to endorse or promote products derived from this software | |
20 | .\" without specific prior written permission. | |
21 | .\" | |
22 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
23 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
24 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
25 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
26 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
27 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
28 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
29 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
30 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
31 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
32 | .\" SUCH DAMAGE. | |
33 | .\" | |
34 | .\" @(#)string.3 8.2 (Berkeley) 12/11/93 | |
35 | .\" $FreeBSD: src/lib/libc/string/string.3,v 1.13 2002/10/19 13:41:22 tjr Exp $ | |
36 | .\" | |
37 | .Dd December 11, 1993 | |
38 | .Dt STRING 3 | |
39 | .Os | |
40 | .Sh NAME | |
41 | .Nm index , | |
42 | .Nm rindex , | |
43 | .Nm stpcpy , | |
44 | .Nm strcasecmp , | |
45 | .Nm strcat , | |
46 | .Nm strchr , | |
47 | .Nm strcmp , | |
48 | .Nm strcpy , | |
49 | .Nm strcspn , | |
50 | .Nm strerror , | |
51 | .Nm strlen , | |
52 | .Nm strncasecmp , | |
53 | .Nm strncat , | |
54 | .Nm strncmp , | |
55 | .Nm strncpy , | |
56 | .Nm strpbrk , | |
57 | .Nm strrchr , | |
58 | .Nm strsep , | |
59 | .Nm strspn , | |
60 | .Nm strstr , | |
61 | .Nm strtok | |
62 | .Nd string specific functions | |
63 | .Sh LIBRARY | |
64 | .Lb libc | |
65 | .Sh SYNOPSIS | |
66 | .In strings.h | |
67 | .Ft char * | |
68 | .Fo index | |
69 | .Fa "const char *s" | |
70 | .Fa "int c" | |
71 | .Fc | |
72 | .Ft char * | |
73 | .Fo rindex | |
74 | .Fa "const char *s" | |
75 | .Fa "int c" | |
76 | .Fc | |
77 | .Ft int | |
78 | .Fo strcasecmp | |
79 | .Fa "const char *s1" | |
80 | .Fa "const char *s2" | |
81 | .Fc | |
82 | .Ft int | |
83 | .Fo strncasecmp | |
84 | .Fa "const char *s1" | |
85 | .Fa "const char *s2" | |
86 | .Fa "size_t n" | |
87 | .Fc | |
88 | .In string.h | |
89 | .Ft char * | |
90 | .Fo stpcpy | |
91 | .Fa "char *dst" | |
92 | .Fa "const char *src" | |
93 | .Fc | |
94 | .Ft char * | |
95 | .Fo strcat | |
96 | .Fa "char *restrict s1" | |
97 | .Fa "const char *restrict s2" | |
98 | .Fc | |
99 | .Ft char * | |
100 | .Fo strchr | |
101 | .Fa "const char *s" | |
102 | .Fa "int c" | |
103 | .Fc | |
104 | .Ft int | |
105 | .Fo strcmp | |
106 | .Fa "const char *s1" | |
107 | .Fa "const char *s2" | |
108 | .Fc | |
109 | .Ft char * | |
110 | .Fo strcpy | |
111 | .Fa "char *restrict s1" | |
112 | .Fa "const char *restrict s2" | |
113 | .Fc | |
114 | .Ft size_t | |
115 | .Fo strcspn | |
116 | .Fa "const char *s1" | |
117 | .Fa "const char *s2" | |
118 | .Fc | |
119 | .Ft char * | |
120 | .Fo strerror | |
121 | .Fa "int errnum" | |
122 | .Fc | |
123 | .Ft size_t | |
124 | .Fo strlen | |
125 | .Fa "const char *s" | |
126 | .Fc | |
127 | .Ft char * | |
128 | .Fo strncat | |
129 | .Fa "char *restrict s1" | |
130 | .Fa "const char *restrict s2" | |
131 | .Fa "size_t n" | |
132 | .Fc | |
133 | .Ft int | |
134 | .Fo strncmp | |
135 | .Fa "const char *s1" | |
136 | .Fa "const char *s2" | |
137 | .Fa "size_t n" | |
138 | .Fc | |
139 | .Ft char * | |
140 | .Fo strncpy | |
141 | .Fa "char *restrict s1" | |
142 | .Fa "const char *restrict s2" | |
143 | .Fa "size_t n" | |
144 | .Fc | |
145 | .Ft char * | |
146 | .Fo strpbrk | |
147 | .Fa "const char *s1" | |
148 | .Fa "const char *s2" | |
149 | .Fc | |
150 | .Ft char * | |
151 | .Fo strrchr | |
152 | .Fa "const char *s" | |
153 | .Fa "int c" | |
154 | .Fc | |
155 | .Ft char * | |
156 | .Fo strsep | |
157 | .Fa "char **stringp" | |
158 | .Fa "const char *delim" | |
159 | .Fc | |
160 | .Ft size_t | |
161 | .Fo strspn | |
162 | .Fa "const char *s1" | |
163 | .Fa "const char *s2" | |
164 | .Fc | |
165 | .Ft char * | |
166 | .Fo strstr | |
167 | .Fa "const char *s1" | |
168 | .Fa "const char *s2" | |
169 | .Fc | |
170 | .Ft char * | |
171 | .Fo strtok | |
172 | .Fa "char *restrict s1" | |
173 | .Fa "const char *restrict s2" | |
174 | .Fc | |
175 | .Sh DESCRIPTION | |
176 | The string | |
177 | functions manipulate strings that are terminated by a | |
178 | null byte. | |
179 | .Pp | |
180 | See the specific manual pages for more information. | |
181 | For manipulating variable length generic objects as byte | |
182 | strings (without the null byte check), see | |
183 | .Xr bstring 3 . | |
184 | .Pp | |
185 | Except as noted in their specific manual pages, | |
186 | the string functions do not test the destination | |
187 | for size limitations. | |
188 | .Sh SEE ALSO | |
189 | .Xr bstring 3 , | |
190 | .Xr index 3 , | |
191 | .Xr rindex 3 , | |
192 | .Xr stpcpy 3 , | |
193 | .Xr strcasecmp 3 , | |
194 | .Xr strcat 3 , | |
195 | .Xr strchr 3 , | |
196 | .Xr strcmp 3 , | |
197 | .Xr strcpy 3 , | |
198 | .Xr strcspn 3 , | |
199 | .Xr strerror 3 , | |
200 | .Xr strlen 3 , | |
201 | .Xr strpbrk 3 , | |
202 | .Xr strrchr 3 , | |
203 | .Xr strsep 3 , | |
204 | .Xr strspn 3 , | |
205 | .Xr strstr 3 , | |
206 | .Xr strtok 3 | |
207 | .Sh STANDARDS | |
208 | The | |
209 | .Fn strcat , | |
210 | .Fn strncat , | |
211 | .Fn strchr , | |
212 | .Fn strrchr , | |
213 | .Fn strcmp , | |
214 | .Fn strncmp , | |
215 | .Fn strcpy , | |
216 | .Fn strncpy , | |
217 | .Fn strerror , | |
218 | .Fn strlen , | |
219 | .Fn strpbrk , | |
220 | .Fn strspn , | |
221 | .Fn strcspn , | |
222 | .Fn strstr , | |
223 | and | |
224 | .Fn strtok | |
225 | functions | |
226 | conform to | |
227 | .St -isoC . |