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