Update fnmatch to be more posix complient (from keith bostic)

This commit is contained in:
jtc 1993-06-16 17:17:30 +00:00
parent dacb3d324d
commit 9a11d802b6
2 changed files with 52 additions and 8 deletions

51
include/fnmatch.h Normal file
View File

@ -0,0 +1,51 @@
/*-
* Copyright (c) 1992 The Regents of the University of California.
* All rights reserved.
*
* 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.
*
* @(#)fnmatch.h 5.1 (Berkeley) 6/28/92
*/
#ifndef _FNMATCH_H_
#define _FNMATCH_H_
#define FNM_NOMATCH 1 /* Match failed. */
#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */
#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */
#define FNM_PERIOD 0x04 /* Period must be matched by period. */
#include <sys/cdefs.h>
__BEGIN_DECLS
int fnmatch __P((const char *, const char *, int));
__END_DECLS
#endif /* !_FNMATCH_H_ */

View File

@ -40,16 +40,10 @@
#include <sys/types.h>
#include <sys/unistd.h>
#define STDIN_FILENO 0 /* standard input file descriptor */
#define STDIN_FILENO 0 /* standard input file descriptor */
#define STDOUT_FILENO 1 /* standard output file descriptor */
#define STDERR_FILENO 2 /* standard error file descriptor */
/* fnmatch(3) defines */
#define FNM_PATHNAME 0x01 /* match pathnames, not filenames */
#ifndef _POSIX_SOURCE
#define FNM_QUOTE 0x02 /* escape special chars with \ */
#endif
#ifndef NULL
#define NULL 0 /* null pointer constant */
#endif
@ -123,7 +117,6 @@ int exect __P((const char *, char * const *, char * const *));
int fchdir __P((int));
int fchflags __P((int, long));
int fchown __P((int, int, int));
int fnmatch __P((const char *, const char *, int));
int fsync __P((int));
int ftruncate __P((int, off_t));
int getdtablesize __P((void));