1994-05-27 05:00:24 +00:00
|
|
|
.\" Copyright (c) 1993
|
|
|
|
.\" The Regents of the University of California. All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" This code is derived from software contributed to Berkeley by
|
|
|
|
.\" Paul Borman at Krystal Technologies.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by the University of
|
|
|
|
.\" California, Berkeley and its contributors.
|
|
|
|
.\" 4. Neither the name of the University nor the names of its contributors
|
|
|
|
.\" may be used to endorse or promote products derived from this software
|
|
|
|
.\" without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" @(#)mbrune.3 8.2 (Berkeley) 4/19/94
|
1999-08-28 00:22:10 +00:00
|
|
|
.\" $FreeBSD$
|
1994-05-27 05:00:24 +00:00
|
|
|
.\"
|
1997-06-23 04:03:49 +00:00
|
|
|
.Dd April 19, 1994
|
1994-05-27 05:00:24 +00:00
|
|
|
.Dt MBRUNE 3
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm mbrune ,
|
|
|
|
.Nm mbrrune ,
|
|
|
|
.Nm mbmb
|
|
|
|
.Nd multibyte rune support for C
|
2000-04-21 09:42:15 +00:00
|
|
|
.Sh LIBRARY
|
|
|
|
.Lb libc
|
1994-05-27 05:00:24 +00:00
|
|
|
.Sh SYNOPSIS
|
2001-10-01 16:09:29 +00:00
|
|
|
.In rune.h
|
1994-05-27 05:00:24 +00:00
|
|
|
.Ft char *
|
|
|
|
.Fn mbrune "const char *string" "rune_t rune"
|
|
|
|
.Ft char *
|
|
|
|
.Fn mbrrune "const char *string" "rune_t rune"
|
|
|
|
.Ft char *
|
|
|
|
.Fn mbmb "const char *string" "char *pattern"
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
These routines provide the corresponding functionality of
|
|
|
|
.Fn strchr ,
|
|
|
|
.Fn strrchr
|
|
|
|
and
|
|
|
|
.Fn strstr
|
|
|
|
for multibyte strings.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fn mbrune
|
|
|
|
function locates the first occurrence of
|
|
|
|
.Fn rune
|
|
|
|
in the string pointed to by
|
|
|
|
.Ar string .
|
|
|
|
The terminating
|
1997-12-28 12:06:29 +00:00
|
|
|
.Dv NUL
|
1994-05-27 05:00:24 +00:00
|
|
|
character is considered part of the string.
|
|
|
|
If
|
|
|
|
.Fa rune
|
|
|
|
is
|
|
|
|
.Ql \e0 ,
|
|
|
|
.Fn mbrune
|
|
|
|
locates the terminating
|
|
|
|
.Ql \e0 .
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fn mbrrune
|
|
|
|
function
|
|
|
|
locates the last occurrence of
|
|
|
|
.Fa rune
|
|
|
|
in the string
|
|
|
|
.Fa string .
|
|
|
|
If
|
|
|
|
.Fa rune
|
|
|
|
is
|
|
|
|
.Ql \e0 ,
|
|
|
|
.Fn mbrune
|
|
|
|
locates the terminating
|
|
|
|
.Ql \e0 .
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fn mbmb
|
|
|
|
function locates the first occurrence of the null-terminated string
|
|
|
|
.Fa pattern
|
|
|
|
in the null-terminated string
|
2001-02-01 16:38:02 +00:00
|
|
|
.Fa string .
|
1994-05-27 05:00:24 +00:00
|
|
|
If
|
|
|
|
.Fa pattern
|
|
|
|
is the empty string,
|
|
|
|
.Fn mbmb
|
|
|
|
returns
|
|
|
|
.Fa string ;
|
|
|
|
if
|
|
|
|
.Fa pattern
|
|
|
|
occurs nowhere in
|
|
|
|
.Fa string ,
|
|
|
|
.Fn mbmb
|
|
|
|
returns
|
|
|
|
.Dv NULL ;
|
|
|
|
otherwise
|
|
|
|
.Fn mbmb
|
|
|
|
returns a pointer to the first character of the first occurrence of
|
|
|
|
.Fa pattern .
|
|
|
|
.Sh RETURN VALUES
|
|
|
|
The function
|
|
|
|
.Fn mbrune
|
|
|
|
returns a pointer to the located character, or
|
|
|
|
.Dv NULL
|
|
|
|
if the character does not appear in the string.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fn mbrrune
|
|
|
|
function
|
|
|
|
returns a pointer to the character, or
|
|
|
|
.Dv NULL
|
|
|
|
if the character does not appear in the string.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fn mbmb
|
|
|
|
function
|
2001-07-15 07:53:42 +00:00
|
|
|
returns a pointer to the
|
1994-05-27 05:00:24 +00:00
|
|
|
.Fa pattern ,
|
|
|
|
or
|
|
|
|
.Dv NULL
|
2001-07-15 07:53:42 +00:00
|
|
|
if the
|
1994-05-27 05:00:24 +00:00
|
|
|
.Fa pattern
|
|
|
|
does not appear in the string.
|
|
|
|
.Sh "SEE ALSO
|
|
|
|
.Xr mbrune 3 ,
|
|
|
|
.Xr rune 3 ,
|
|
|
|
.Xr setlocale 3 ,
|
1997-01-20 23:23:22 +00:00
|
|
|
.Xr euc 4 ,
|
1994-05-27 05:00:24 +00:00
|
|
|
.Xr utf2 4
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Fn mbrune ,
|
|
|
|
.Fn mbrrune ,
|
|
|
|
and
|
|
|
|
.Fn mbmb
|
|
|
|
functions
|
|
|
|
first appeared in Plan 9 from Bell Labs as
|
|
|
|
.Fn utfrune ,
|
|
|
|
.Fn utfrrune ,
|
|
|
|
and
|
|
|
|
.Fn utfutf .
|