Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / lib / libc / locale / mbrune.3
1 .\" Copyright (c) 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 .\" Paul Borman at Krystal Technologies.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\" 3. All advertising materials mentioning features or use of this software
16 .\"    must display the following acknowledgement:
17 .\"     This product includes software developed by the University of
18 .\"     California, Berkeley and its contributors.
19 .\" 4. Neither the name of the University nor the names of its contributors
20 .\"    may be used to endorse or promote products derived from this software
21 .\"    without specific prior written permission.
22 .\"
23 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .\" SUCH DAMAGE.
34 .\"
35 .\"     @(#)mbrune.3    8.2 (Berkeley) 4/19/94
36 .\" $FreeBSD: src/lib/libc/locale/mbrune.3,v 1.6.2.4 2001/12/14 18:33:54 ru Exp $
37 .\" $DragonFly: src/lib/libc/locale/Attic/mbrune.3,v 1.2 2003/06/17 04:26:44 dillon Exp $
38 .\"
39 .Dd April 19, 1994
40 .Dt MBRUNE 3
41 .Os
42 .Sh NAME
43 .Nm mbrune ,
44 .Nm mbrrune ,
45 .Nm mbmb
46 .Nd multibyte rune support for C
47 .Sh LIBRARY
48 .Lb libc
49 .Sh SYNOPSIS
50 .In rune.h
51 .Ft char *
52 .Fn mbrune "const char *string" "rune_t rune"
53 .Ft char *
54 .Fn mbrrune "const char *string" "rune_t rune"
55 .Ft char *
56 .Fn mbmb "const char *string" "char *pattern"
57 .Sh DESCRIPTION
58 These routines provide the corresponding functionality of
59 .Fn strchr ,
60 .Fn strrchr
61 and
62 .Fn strstr
63 for multibyte strings.
64 .Pp
65 The
66 .Fn mbrune
67 function locates the first occurrence of
68 .Fn rune
69 in the string pointed to by
70 .Ar string .
71 The terminating
72 .Dv NUL
73 character is considered part of the string.
74 If
75 .Fa rune
76 is
77 .Ql \e0 ,
78 .Fn mbrune
79 locates the terminating
80 .Ql \e0 .
81 .Pp
82 The
83 .Fn mbrrune
84 function
85 locates the last occurrence of
86 .Fa rune
87 in the string
88 .Fa string .
89 If
90 .Fa rune
91 is
92 .Ql \e0 ,
93 .Fn mbrune
94 locates the terminating
95 .Ql \e0 .
96 .Pp
97 The
98 .Fn mbmb
99 function locates the first occurrence of the null-terminated string
100 .Fa pattern
101 in the null-terminated string
102 .Fa string .
103 If
104 .Fa pattern
105 is the empty string,
106 .Fn mbmb
107 returns
108 .Fa string ;
109 if
110 .Fa pattern
111 occurs nowhere in
112 .Fa string ,
113 .Fn mbmb
114 returns
115 .Dv NULL ;
116 otherwise
117 .Fn mbmb
118 returns a pointer to the first character of the first occurrence of
119 .Fa pattern .
120 .Sh RETURN VALUES
121 The function
122 .Fn mbrune
123 returns a pointer to the located character, or
124 .Dv NULL
125 if the character does not appear in the string.
126 .Pp
127 The
128 .Fn mbrrune
129 function
130 returns a pointer to the character, or
131 .Dv NULL
132 if the character does not appear in the string.
133 .Pp
134 The
135 .Fn mbmb
136 function
137 returns a pointer to the
138 .Fa pattern ,
139 or
140 .Dv NULL
141 if the
142 .Fa pattern
143 does not appear in the string.
144 .Sh "SEE ALSO
145 .Xr mbrune 3 ,
146 .Xr rune 3 ,
147 .Xr setlocale 3 ,
148 .Xr euc 4 ,
149 .Xr utf2 4
150 .Sh HISTORY
151 The
152 .Fn mbrune ,
153 .Fn mbrrune ,
154 and
155 .Fn mbmb
156 functions
157 first appeared in Plan 9 from Bell Labs as
158 .Fn utfrune ,
159 .Fn utfrrune ,
160 and
161 .Fn utfutf .