File:  [CSRG BSD Unix] / 43BSDReno / lib / libc / gen / fnmatch.3
Revision 1.1: download - view: text, annotated - select for diffs
Tue Apr 24 16:12:55 2018 UTC (8 years, 1 month ago) by root
CVS tags: MAIN, HEAD
Initial revision

.\" Copyright (c) 1989 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" Guido van Rossum.
.\"
.\" Redistribution and use in source and binary forms are permitted provided
.\" that: (1) source distributions retain this entire copyright notice and
.\" comment, and (2) distributions including binaries display the following
.\" acknowledgement:  ``This product includes software developed by the
.\" University of California, Berkeley and its contributors'' in the
.\" documentation or other materials provided with the distribution and in
.\" all advertising materials mentioning features or use of this software.
.\" 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
.\"	@(#)fnmatch.3	5.2 (Berkeley) 6/23/90
.\"
.TH FNMATCH 3 "June 23, 1990"
.UC 7
.SH NAME
fnmatch \- match filename or pathname
.SH SYNOPSIS
.nf
#include <unistd.h>

int fnmatch(const char *pattern, const char *string, int flags);
.fi
.SH DESCRIPTION
.I Fnmatch
matches patterns according to the rules used by the shell.
It checks the string specified by the
.I string
argument to see if it matches the pattern specified by the
.I pattern
argument.
.PP
The
.I flags
argument modifies the interpretation of
.I pattern
and
.I string.
The value of
.I flags
is the bitwise inclusive OR of any of the following
constants, which are defined in the include file
.IR unistd.h .
.TP
FNM_PATHNAME
Slash characters in
.I string
must be explicitly matched by slashes in
.IR pattern .
If this flag is not set, then slashes are treated as regular characters.
.TP
FNM_QUOTE
Every occurrence of a backslash (``\e'') followed by a character in
.I pattern
is replaced by that character.
This is done to negate any special meaning for the character.
.SH RETURNS
If
.I string
matches the pattern specified by
.IR pattern ,
then
.I fnmatch
returns zero.
Otherwise,
.I fnmatch
returns nonzero.
.SH SEE ALSO
sh(1), glob(3), wordexp(3), regexp(3)
.SH BUGS
Quotes and slashes in range patterns are not handled correctly.
.PP
The pattern ``*'' matches the empty string, even if
.I FNM_PATHNAME
is specified.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.