159bf7050SPeter Avalos /*-
259bf7050SPeter Avalos  * Copyright (c) 2003-2007 Tim Kientzle
359bf7050SPeter Avalos  * All rights reserved.
459bf7050SPeter Avalos  *
559bf7050SPeter Avalos  * Redistribution and use in source and binary forms, with or without
659bf7050SPeter Avalos  * modification, are permitted provided that the following conditions
759bf7050SPeter Avalos  * are met:
859bf7050SPeter Avalos  * 1. Redistributions of source code must retain the above copyright
959bf7050SPeter Avalos  *    notice, this list of conditions and the following disclaimer
1059bf7050SPeter Avalos  *    in this position and unchanged.
1159bf7050SPeter Avalos  * 2. Redistributions in binary form must reproduce the above copyright
1259bf7050SPeter Avalos  *    notice, this list of conditions and the following disclaimer in the
1359bf7050SPeter Avalos  *    documentation and/or other materials provided with the distribution.
1459bf7050SPeter Avalos  *
1559bf7050SPeter Avalos  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
1659bf7050SPeter Avalos  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1759bf7050SPeter Avalos  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1859bf7050SPeter Avalos  * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
1959bf7050SPeter Avalos  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2059bf7050SPeter Avalos  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2159bf7050SPeter Avalos  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2259bf7050SPeter Avalos  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2359bf7050SPeter Avalos  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2459bf7050SPeter Avalos  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2559bf7050SPeter Avalos  *
2659bf7050SPeter Avalos  * $FreeBSD$
2759bf7050SPeter Avalos  */
2859bf7050SPeter Avalos 
29085658deSDaniel Fojt #ifndef ARCHIVE_PATHMATCH_H
30085658deSDaniel Fojt #define ARCHIVE_PATHMATCH_H
31085658deSDaniel Fojt 
3259bf7050SPeter Avalos #ifndef __LIBARCHIVE_BUILD
3359bf7050SPeter Avalos #ifndef __LIBARCHIVE_TEST
3459bf7050SPeter Avalos #error This header is only to be used internally to libarchive.
3559bf7050SPeter Avalos #endif
3659bf7050SPeter Avalos #endif
3759bf7050SPeter Avalos 
3859bf7050SPeter Avalos /* Don't anchor at beginning unless the pattern starts with "^" */
3959bf7050SPeter Avalos #define PATHMATCH_NO_ANCHOR_START	1
4059bf7050SPeter Avalos /* Don't anchor at end unless the pattern ends with "$" */
4159bf7050SPeter Avalos #define PATHMATCH_NO_ANCHOR_END 	2
4259bf7050SPeter Avalos 
4359bf7050SPeter Avalos /* Note that "^" and "$" are not special unless you set the corresponding
4459bf7050SPeter Avalos  * flag above. */
4559bf7050SPeter Avalos 
4659bf7050SPeter Avalos int __archive_pathmatch(const char *p, const char *s, int flags);
4759bf7050SPeter Avalos int __archive_pathmatch_w(const wchar_t *p, const wchar_t *s, int flags);
4859bf7050SPeter Avalos 
4959bf7050SPeter Avalos #define archive_pathmatch(p, s, f)	__archive_pathmatch(p, s, f)
5059bf7050SPeter Avalos #define archive_pathmatch_w(p, s, f)	__archive_pathmatch_w(p, s, f)
5159bf7050SPeter Avalos 
5259bf7050SPeter Avalos #endif
53