1 .\" Copyright (c) 1990, 1991, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" This code is derived from software contributed to Berkeley by
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
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. 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.
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
30 .\" from: @(#)string.3 8.2 (Berkeley) 12/11/93
31 .\" $NetBSD: string.3,v 1.16 2009/05/01 17:27:01 perry Exp $
68 .Nd string specific functions
74 .Fn stpcpy "char *dst" "const char *src"
76 .Fn stpncpy "char *dst" "const char *src" "size_t count"
78 .Fn strcat "char *s" "const char * append"
80 .Fn strlcat "char *dst" "const char *src" "size_t size"
82 .Fn strncat "char *s" "const char *append" "size_t count"
84 .Fn strchr "const char *s" "int c"
86 .Fn strrchr "const char *s" "int c"
88 .Fn strcmp "const char *s1" "const char *s2"
90 .Fn strncmp "const char *s1" "const char *s2" "size_t count"
92 .Fn strcasecmp "const char *s1" "const char *s2"
94 .Fn strncasecmp "const char *s1" "const char *s2" "size_t count"
96 .Fn strcoll "const char *s1" "const char *s2"
98 .Fn strcpy "char *dst" "const char *src"
100 .Fn strlcpy "char *dst" "const char *src" "size_t size"
102 .Fn strncpy "char *dst" "const char *src" "size_t count"
104 .Fn strerror "int errno"
106 .Fn strerror_r "int errnum" "char *strerrbuf" "size_t buflen"
108 .Fn strlen "const char *s"
110 .Fn strnlen "const char *s" "size_t count"
112 .Fn strpbrk "const char *s" "const char *charset"
114 .Fn strsep "char **stringp" "const char *delim"
116 .Fn stresep "char **stringp" "const char *delim" "int escape"
118 .Fn strspn "const char *s" "const char *charset"
120 .Fn strcspn "const char *s" "const char *charset"
122 .Fn strdup "const char *str"
124 .Fn strndup "const char *str" "size_t len"
126 .Fn strstr "const char *big" "const char *little"
128 .Fn strcasestr "const char *big" "const char *little"
130 .Fn strtok "char *s" "const char *delim"
132 .Fn strtok_r "char *s" "const char *delim" "char **lasts"
134 .Fn strxfrm "char *dst" "const char *src" "size_t n"
137 functions manipulate strings terminated by a
140 See the specific manual pages for more information.
141 For manipulating variable length generic objects as byte
142 strings (without the nul byte check), see
145 Except as noted in their specific manual pages,
146 the string functions do not test the destination
147 for size limitations.