wu_fnmatch.3
上传用户:zibowangxu
上传日期:2007-01-04
资源大小:331k
文件大小:3k
- ."
- ." Copyright (c) 1999 WU-FTPD Development Group.
- ." All rights reserved.
- ."
- ." Portions Copyright (c) 1980, 1985, 1988, 1989, 1990, 1991, 1993, 1994
- ." The Regents of the University of California. Portions Copyright (c)
- ." 1993, 1994 Washington University in Saint Louis. Portions Copyright
- ." (c) 1996, 1998 Berkeley Software Design, Inc. Portions Copyright (c)
- ." 1998 Sendmail, Inc. Portions Copyright (c) 1983, 1995, 1996, 1997 Eric
- ." P. Allman. Portions Copyright (c) 1989 Massachusetts Institute of
- ." Technology. Portions Copyright (c) 1997 Stan Barber. Portions
- ." Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997 Free Software
- ." Foundation, Inc. Portions Copyright (c) 1997 Kent Landfield.
- ."
- ." Use and distribution of this software and its source code are governed
- ." by the terms and conditions of the WU-FTPD Software License ("LICENSE").
- ."
- ." $Id: wu_fnmatch.3,v 1.2 1999/08/27 15:01:24 wuftpd Exp $
- ."
- .TH WU_FNMATCH 3 "July 28, 1999"
- .UC 7
- .SH NAME
- wu_fnmatch - match filename or pathname
- .SH SYNOPSIS
- .nf
- #include "wu_fnmatch.h"
- int wu_fnmatch(const char *pattern, const char *string, int flags);
- .fi
- .SH DESCRIPTION
- .I wu_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 wu_fnmatch.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_NOESCAPE
- 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.
- If this flag is set, then backslashes are treated as regular characters.
- .TP
- FNM_PERIOD
- If this flag is set, then a leading period in
- .I string
- must be explicity matched by a period in
- .IR pattern .
- A period is considered leading if it is the first character in
- .IR string ,
- or if both
- .T FNM_PATHNAME
- is set and the period immediately follows a slash.
- .TP
- FNM_LEADING_DIR
- If this flag is set, if the entire
- .I pattern
- has been matched, and there are more characters remaining in the
- .IR string ,
- and either the last character matched was a slash, or the next character in the
- .I string
- is a slash, then consider the entire
- .I string
- matched.
- .TP
- FNM_CASEFOLD
- Normally, upper case and lower case letters are distinct. This flag causes
- them to be considered equal.
- .SH RETURNS
- If
- .I string
- matches the pattern specified by
- .IR pattern ,
- then
- .I wu_fnmatch
- returns zero.
- Otherwise,
- .I wu_fnmatch
- returns FNM_NOMATCH.
- .SH SEE ALSO
- sh(1), glob(3), wordexp(3), regexp(3)
- .SH BUGS
- {} alternatives are not handled.