OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc2/] [newlib/] [libc/] [posix/] [fnmatch.3] - Diff between revs 207 and 520

Only display areas with differences | Details | Blame | View Log

Rev 207 Rev 520
.\" Copyright (c) 1989, 1991, 1993
.\" Copyright (c) 1989, 1991, 1993
.\"     The Regents of the University of California.  All rights reserved.
.\"     The Regents of the University of California.  All rights reserved.
.\"
.\"
.\" This code is derived from software contributed to Berkeley by
.\" This code is derived from software contributed to Berkeley by
.\" Guido van Rossum.
.\" Guido van Rossum.
.\" Redistribution and use in source and binary forms, with or without
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"    must display the following acknowledgement:
.\"     This product includes software developed by the University of
.\"     This product includes software developed by the University of
.\"     California, Berkeley and its contributors.
.\"     California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of 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
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"    without specific prior written permission.
.\"
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" 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
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\" SUCH DAMAGE.
.\"
.\"
.\"     @(#)fnmatch.3   8.3 (Berkeley) 4/28/95
.\"     @(#)fnmatch.3   8.3 (Berkeley) 4/28/95
.\" $FreeBSD: src/lib/libc/gen/fnmatch.3,v 1.12 2001/10/01 16:08:50 ru Exp $
.\" $FreeBSD: src/lib/libc/gen/fnmatch.3,v 1.12 2001/10/01 16:08:50 ru Exp $
.\"
.\"
.Dd April 28, 1995
.Dd April 28, 1995
.Dt FNMATCH 3
.Dt FNMATCH 3
.Os
.Os
.Sh NAME
.Sh NAME
.Nm fnmatch
.Nm fnmatch
.Nd match filename or pathname
.Nd match filename or pathname
.Sh LIBRARY
.Sh LIBRARY
.Lb libc
.Lb libc
.Sh SYNOPSIS
.Sh SYNOPSIS
.In fnmatch.h
.In fnmatch.h
.Ft int
.Ft int
.Fn fnmatch "const char *pattern" "const char *string" "int flags"
.Fn fnmatch "const char *pattern" "const char *string" "int flags"
.Sh DESCRIPTION
.Sh DESCRIPTION
The
The
.Fn fnmatch
.Fn fnmatch
function
function
matches patterns according to the rules used by the shell.
matches patterns according to the rules used by the shell.
It checks the string specified by the
It checks the string specified by the
.Fa string
.Fa string
argument to see if it matches the pattern specified by the
argument to see if it matches the pattern specified by the
.Fa pattern
.Fa pattern
argument.
argument.
.Pp
.Pp
The
The
.Fa flags
.Fa flags
argument modifies the interpretation of
argument modifies the interpretation of
.Fa pattern
.Fa pattern
and
and
.Fa string .
.Fa string .
The value of
The value of
.Fa flags
.Fa flags
is the bitwise inclusive
is the bitwise inclusive
.Tn OR
.Tn OR
of any of the following
of any of the following
constants, which are defined in the include file
constants, which are defined in the include file
.Pa fnmatch.h .
.Pa fnmatch.h .
.Bl -tag -width FNM_PATHNAME
.Bl -tag -width FNM_PATHNAME
.It Dv FNM_NOESCAPE
.It Dv FNM_NOESCAPE
Normally, every occurrence of a backslash
Normally, every occurrence of a backslash
.Pq Ql \e
.Pq Ql \e
followed by a character in
followed by a character in
.Fa pattern
.Fa pattern
is replaced by that character.
is replaced by that character.
This is done to negate any special meaning for the character.
This is done to negate any special meaning for the character.
If the
If the
.Dv FNM_NOESCAPE
.Dv FNM_NOESCAPE
flag is set, a backslash character is treated as an ordinary character.
flag is set, a backslash character is treated as an ordinary character.
.It Dv FNM_PATHNAME
.It Dv FNM_PATHNAME
Slash characters in
Slash characters in
.Fa string
.Fa string
must be explicitly matched by slashes in
must be explicitly matched by slashes in
.Fa pattern .
.Fa pattern .
If this flag is not set, then slashes are treated as regular characters.
If this flag is not set, then slashes are treated as regular characters.
.It Dv FNM_PERIOD
.It Dv FNM_PERIOD
Leading periods in
Leading periods in
.Fa string
.Fa string
must be explicitly matched by periods in
must be explicitly matched by periods in
.Fa pattern .
.Fa pattern .
If this flag is not set, then leading periods are treated as regular
If this flag is not set, then leading periods are treated as regular
characters.
characters.
The definition of
The definition of
.Dq leading
.Dq leading
is related to the specification of
is related to the specification of
.Dv FNM_PATHNAME .
.Dv FNM_PATHNAME .
A period is always
A period is always
.Dq leading
.Dq leading
if it is the first character in
if it is the first character in
.Ar string .
.Ar string .
Additionally, if
Additionally, if
.Dv FNM_PATHNAME
.Dv FNM_PATHNAME
is set,
is set,
a period is
a period is
leading
leading
if it immediately follows a slash.
if it immediately follows a slash.
.It Dv FNM_LEADING_DIR
.It Dv FNM_LEADING_DIR
Ignore
Ignore
.Nm /*
.Nm /*
rest after successful
rest after successful
.Fa pattern
.Fa pattern
matching.
matching.
.It Dv FNM_CASEFOLD
.It Dv FNM_CASEFOLD
Ignore  case  distinctions in both the
Ignore  case  distinctions in both the
.Fa pattern
.Fa pattern
and the
and the
.Fa string .
.Fa string .
.El
.El
.Sh RETURN VALUES
.Sh RETURN VALUES
The
The
.Fn fnmatch
.Fn fnmatch
function returns zero if
function returns zero if
.Fa string
.Fa string
matches the pattern specified by
matches the pattern specified by
.Fa pattern ,
.Fa pattern ,
otherwise, it returns the value
otherwise, it returns the value
.Dv FNM_NOMATCH .
.Dv FNM_NOMATCH .
.Sh SEE ALSO
.Sh SEE ALSO
.Xr sh 1 ,
.Xr sh 1 ,
.Xr glob 3 ,
.Xr glob 3 ,
.Xr regex 3
.Xr regex 3
.Sh STANDARDS
.Sh STANDARDS
The
The
.Fn fnmatch
.Fn fnmatch
function conforms to
function conforms to
.St -p1003.2 .
.St -p1003.2 .
.Sh HISTORY
.Sh HISTORY
The
The
.Fn fnmatch
.Fn fnmatch
function first appeared in
function first appeared in
.Bx 4.4 .
.Bx 4.4 .
.Sh BUGS
.Sh BUGS
The pattern
The pattern
.Ql *
.Ql *
matches the empty string, even if
matches the empty string, even if
.Dv FNM_PATHNAME
.Dv FNM_PATHNAME
is specified.
is specified.
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.