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