2009-04-18 19:00:33 +02:00
|
|
|
/* Copyright (C) 2009 Wildfire Games.
|
|
|
|
* This file is part of 0 A.D.
|
|
|
|
*
|
|
|
|
* 0 A.D. is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* 0 A.D. is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2009-04-18 19:51:05 +02:00
|
|
|
/*
|
|
|
|
* minimal regex implementation
|
2009-04-18 18:14:48 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef INCLUDED_REGEX
|
|
|
|
#define INCLUDED_REGEX
|
|
|
|
|
|
|
|
/**
|
|
|
|
* see if string matches pattern.
|
|
|
|
*
|
|
|
|
* @param s input string
|
|
|
|
* @param w pseudo-regex to match against. case-insensitive;
|
|
|
|
* may contain '?' and/or '*' wildcards. if NULL, matches everything.
|
|
|
|
*
|
|
|
|
* @return 1 if they match, otherwise 0.
|
|
|
|
*
|
2009-11-03 22:46:35 +01:00
|
|
|
* algorithm from http://www.codeproject.com/string/wildcmp.asp.
|
2009-04-18 18:14:48 +02:00
|
|
|
**/
|
2009-11-03 22:46:35 +01:00
|
|
|
extern int match_wildcard(const wchar_t* s, const wchar_t* w);
|
2009-04-18 18:14:48 +02:00
|
|
|
|
|
|
|
#endif // #ifndef INCLUDED_REGEX
|