xref: /original-bsd/lib/libc/string/string.3 (revision c3e32dec)
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.\" %sccs.include.redist.man%
7.\"
8.\"     @(#)string.3	8.1 (Berkeley) 06/04/93
9.\"
10.Dd
11.Dt STRING 3
12.Os BSD 4
13.Sh NAME
14.Nm strcat ,
15.Nm strncat ,
16.Nm strchr ,
17.Nm strrchr ,
18.Nm strcmp ,
19.Nm strncmp ,
20.Nm strcasecmp,
21.Nm strncasecmp ,
22.Nm strcpy ,
23.Nm strncpy ,
24.Nm strerror ,
25.Nm strlen ,
26.Nm strpbrk ,
27.Nm strsep,
28.Nm strspn ,
29.Nm strcspn ,
30.Nm strstr ,
31.Nm strtok ,
32.Nm index ,
33.Nm rindex
34.Nd string specific functions
35.Sh SYNOPSIS
36.Fd #include <string.h>
37.Ft char *
38.Fn strcat "char *s" "const char * append"
39.Ft char *
40.Fn strncat "char *s" "const char *append" "size_t count"
41.Ft char *
42.Fn strchr "const char *s" "int c"
43.Ft char *
44.Fn strrchr "const char *s" "int c"
45.Ft int
46.Fn strcmp "const char *s1" "const char *s2"
47.Ft int
48.Fn strncmp "const char *s1" "const char *s2" "size_t count"
49.Ft int
50.Fn strcasecmp "const char *s1" "const char *s2"
51.Ft int
52.Fn strncasecmp "const char *s1" "const char *s2" "size_t count"
53.Ft char *
54.Fn strcpy "char *dst" "const char *src"
55.Ft char *
56.Fn strncpy "char *dst" "const char *src" "size_t count"
57.Ft char *
58.Fn strerror "int errno"
59.Ft size_t
60.Fn strlen "const char *s"
61.Ft char *
62.Fn strpbrk "const char *s" "const char *charset"
63.Ft char *
64.Fn strsep "char **stringp" "const char *delim"
65.Ft size_t
66.Fn strspn "const char *s" "const char *charset"
67.Ft size_t
68.Fn strcspn "const char *s" "const char *charset"
69.Ft char *
70.Fn strstr "const char *big" "const char *little"
71.Ft char *
72.Fn strtok "char *s" "const char *delim"
73.Ft char *
74.Fn index "const char *s" "int c"
75.Ft char *
76.Fn rindex "const char *s" "int c"
77.Sh DESCRIPTION
78The string functions
79functions manipulate strings terminated by a
80null byte.
81.Pp
82See the specific manual pages for more information.
83For manipulating variable length generic objects as byte
84strings (without the null byte check), see
85.Xr bstring 3 .
86.Pp
87Except as noted in their specific manual pages,
88the string functions do not test the destination
89for size limitations.
90.Sh SEE ALSO
91.Xr index 3 ,
92.Xr strcat 3 ,
93.Xr strchr 3 ,
94.Xr strrchr 3 ,
95.Xr strcmp 3 ,
96.Xr strcasecmp 3 ,
97.Xr strcpy 3 ,
98.Xr strerror 3 ,
99.Xr strlen 3 ,
100.Xr strpbrk 3 ,
101.Xr strsep 3 ,
102.Xr strspn 3 ,
103.Xr strcspn 3 ,
104.Xr strstr 3 ,
105.Xr strtok 3 ,
106.Xr rindex 3
107.Xr bstring 3
108.Sh STANDARDS
109The
110.Fn strcat ,
111.Fn strncat ,
112.Fn strchr ,
113.Fn strrchr ,
114.Fn strcmp ,
115.Fn strncmp ,
116.Fn strcpy ,
117.Fn strncpy ,
118.Fn strerror ,
119.Fn strlen ,
120.Fn strpbrk ,
121.Fn strsep ,
122.Fn strspn ,
123.Fn strcspn ,
124.Fn strstr ,
125and
126.Fn strtok
127functions
128conform to
129.St -ansiC .
130