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