xref: /freebsd/contrib/libarchive/libarchive/archive_pathmatch.h (revision fd082e96c469d04c399fc0556f40cb7152ee9148)
1*fd082e96SMartin Matuska /*-
2*fd082e96SMartin Matuska  * Copyright (c) 2003-2007 Tim Kientzle
3*fd082e96SMartin Matuska  * All rights reserved.
4*fd082e96SMartin Matuska  *
5*fd082e96SMartin Matuska  * Redistribution and use in source and binary forms, with or without
6*fd082e96SMartin Matuska  * modification, are permitted provided that the following conditions
7*fd082e96SMartin Matuska  * are met:
8*fd082e96SMartin Matuska  * 1. Redistributions of source code must retain the above copyright
9*fd082e96SMartin Matuska  *    notice, this list of conditions and the following disclaimer
10*fd082e96SMartin Matuska  *    in this position and unchanged.
11*fd082e96SMartin Matuska  * 2. Redistributions in binary form must reproduce the above copyright
12*fd082e96SMartin Matuska  *    notice, this list of conditions and the following disclaimer in the
13*fd082e96SMartin Matuska  *    documentation and/or other materials provided with the distribution.
14*fd082e96SMartin Matuska  *
15*fd082e96SMartin Matuska  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
16*fd082e96SMartin Matuska  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17*fd082e96SMartin Matuska  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18*fd082e96SMartin Matuska  * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
19*fd082e96SMartin Matuska  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20*fd082e96SMartin Matuska  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21*fd082e96SMartin Matuska  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22*fd082e96SMartin Matuska  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23*fd082e96SMartin Matuska  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24*fd082e96SMartin Matuska  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*fd082e96SMartin Matuska  *
26*fd082e96SMartin Matuska  * $FreeBSD$
27*fd082e96SMartin Matuska  */
28*fd082e96SMartin Matuska 
29*fd082e96SMartin Matuska #ifndef __LIBARCHIVE_BUILD
30*fd082e96SMartin Matuska #ifndef __LIBARCHIVE_TEST
31*fd082e96SMartin Matuska #error This header is only to be used internally to libarchive.
32*fd082e96SMartin Matuska #endif
33*fd082e96SMartin Matuska #endif
34*fd082e96SMartin Matuska 
35*fd082e96SMartin Matuska #ifndef ARCHIVE_PATHMATCH_H
36*fd082e96SMartin Matuska #define ARCHIVE_PATHMATCH_H
37*fd082e96SMartin Matuska 
38*fd082e96SMartin Matuska /* Don't anchor at beginning unless the pattern starts with "^" */
39*fd082e96SMartin Matuska #define PATHMATCH_NO_ANCHOR_START	1
40*fd082e96SMartin Matuska /* Don't anchor at end unless the pattern ends with "$" */
41*fd082e96SMartin Matuska #define PATHMATCH_NO_ANCHOR_END 	2
42*fd082e96SMartin Matuska 
43*fd082e96SMartin Matuska /* Note that "^" and "$" are not special unless you set the corresponding
44*fd082e96SMartin Matuska  * flag above. */
45*fd082e96SMartin Matuska 
46*fd082e96SMartin Matuska int __archive_pathmatch(const char *p, const char *s, int flags);
47*fd082e96SMartin Matuska int __archive_pathmatch_w(const wchar_t *p, const wchar_t *s, int flags);
48*fd082e96SMartin Matuska 
49*fd082e96SMartin Matuska #define archive_pathmatch(p, s, f)	__archive_pathmatch(p, s, f)
50*fd082e96SMartin Matuska #define archive_pathmatch_w(p, s, f)	__archive_pathmatch_w(p, s, f)
51*fd082e96SMartin Matuska 
52*fd082e96SMartin Matuska #endif
53