1.\" $NetBSD: strings.3,v 1.2 2016/07/14 17:43:48 abhinav Exp $
2.\"
3.\" Copyright (c) 2007 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Thomas Klausner.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.Dd February 17, 2007
31.Dt STRINGS 3
32.Os
33.Sh NAME
34.Nm bcmp ,
35.Nm bcopy ,
36.Nm bzero ,
37.Nm ffs ,
38.Nm index ,
39.Nm rindex ,
40.Nm strcasecmp ,
41.Nm strncasecmp
42.Nd string operations
43.Sh LIBRARY
44.Lb libc
45.Sh SYNOPSIS
46.In strings.h
47.Ft int
48.Fn bcmp "const void *b1" "const void *b2" "size_t len"
49.Ft void
50.Fn bcopy "const void *src" "void *dst" "size_t len"
51.Ft void
52.Fn bzero "void *b" "size_t len"
53.Ft int
54.Fn ffs "int value"
55.Ft char *
56.Fn index "const char *s" "int c"
57.Ft char *
58.Fn rindex "const char *s" "int c"
59.Ft int
60.Fn strcasecmp "const char *s1" "const char *s2"
61.Ft int
62.Fn strncasecmp "const char *s1" "const char *s2" "size_t len"
63.Sh DESCRIPTION
64These functions all live in the
65.In strings.h
66header file.
67Except for
68.Fn ffs ,
69they operate on strings.
70.Fn index ,
71.Fn rindex ,
72and
73.Fn strcasecmp
74need nul-terminated strings.
75.Pp
76See the specific manual pages for more information.
77.Pp
78See
79.Xr string 3
80for string functions that follow
81.St -ansiC
82or
83.St -isoC-99 ,
84.Xr bstring 3
85for functions that operate on strings that are not nul-terminated, and
86.Xr bitstring 3
87for bit-string manipulation macros.
88.Sh SEE ALSO
89.Xr bcmp 3 ,
90.Xr bcopy 3 ,
91.Xr bitstring 3 ,
92.Xr bstring 3 ,
93.Xr bzero 3 ,
94.Xr ffs 3 ,
95.Xr index 3 ,
96.Xr rindex 3 ,
97.Xr strcasecmp 3 ,
98.Xr string 3
99