]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libc/locale/mbrune.3
This commit was generated by cvs2svn to compensate for changes in r51384,
[FreeBSD/FreeBSD.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$
37 .\"
38 .Dd April 19, 1994
39 .Dt MBRUNE 3
40 .Os
41 .Sh NAME
42 .Nm mbrune ,
43 .Nm mbrrune ,
44 .Nm mbmb
45 .Nd multibyte rune support for C
46 .Sh SYNOPSIS
47 .Fd #include <rune.h>
48 .Ft char *
49 .Fn mbrune "const char *string" "rune_t rune"
50 .Ft char *
51 .Fn mbrrune "const char *string" "rune_t rune"
52 .Ft char *
53 .Fn mbmb "const char *string" "char *pattern"
54 .Sh DESCRIPTION
55 These routines provide the corresponding functionality of
56 .Fn strchr ,
57 .Fn strrchr
58 and
59 .Fn strstr
60 for multibyte strings.
61 .Pp
62 The
63 .Fn mbrune
64 function locates the first occurrence of
65 .Fn rune
66 in the string pointed to by
67 .Ar string .
68 The terminating
69 .Dv NUL
70 character is considered part of the string.
71 If
72 .Fa rune
73 is
74 .Ql \e0 ,
75 .Fn mbrune
76 locates the terminating
77 .Ql \e0 .
78 .Pp
79 The
80 .Fn mbrrune
81 function
82 locates the last occurrence of
83 .Fa rune
84 in the string
85 .Fa string .
86 If
87 .Fa rune
88 is
89 .Ql \e0 ,
90 .Fn mbrune
91 locates the terminating
92 .Ql \e0 .
93 .Pp
94 The
95 .Fn mbmb
96 function locates the first occurrence of the null-terminated string
97 .Fa pattern
98 in the null-terminated string
99 .Fa string.
100 If
101 .Fa pattern
102 is the empty string,
103 .Fn mbmb
104 returns
105 .Fa string ;
106 if
107 .Fa pattern
108 occurs nowhere in
109 .Fa string ,
110 .Fn mbmb
111 returns
112 .Dv NULL ;
113 otherwise
114 .Fn mbmb
115 returns a pointer to the first character of the first occurrence of
116 .Fa pattern .
117 .Sh RETURN VALUES
118 The function
119 .Fn mbrune
120 returns a pointer to the located character, or
121 .Dv NULL
122 if the character does not appear in the string.
123 .Pp
124 The
125 .Fn mbrrune
126 function
127 returns a pointer to the character, or
128 .Dv NULL
129 if the character does not appear in the string.
130 .Pp
131 The
132 .Fn mbmb
133 function
134 returns a pointer to the 
135 .Fa pattern ,
136 or
137 .Dv NULL
138 if the 
139 .Fa pattern
140 does not appear in the string.
141 .Sh "SEE ALSO
142 .Xr mbrune 3 ,
143 .Xr rune 3 ,
144 .Xr setlocale 3 ,
145 .Xr euc 4 ,
146 .Xr utf2 4
147 .Sh HISTORY
148 The
149 .Fn mbrune ,
150 .Fn mbrrune ,
151 and
152 .Fn mbmb
153 functions
154 first appeared in Plan 9 from Bell Labs as
155 .Fn utfrune ,
156 .Fn utfrrune ,
157 and
158 .Fn utfutf .