1 | /****************************************************** |
2 | Copyright (c) 2011-2013 Percona LLC and/or its affiliates. |
3 | |
4 | This program is free software; you can redistribute it and/or modify |
5 | it under the terms of the GNU General Public License as published by |
6 | the Free Software Foundation; version 2 of the License. |
7 | |
8 | This program is distributed in the hope that it will be useful, |
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 | GNU General Public License for more details. |
12 | |
13 | You should have received a copy of the GNU General Public License |
14 | along with this program; if not, write to the Free Software |
15 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
16 | |
17 | *******************************************************/ |
18 | |
19 | /* This file is required to abstract away regex(3) calls so that |
20 | my_regex is used on Windows and native calls are used on POSIX platforms. */ |
21 | |
22 | #ifndef XB_REGEX_H |
23 | #define XB_REGEX_H |
24 | |
25 | #ifdef HAVE_SYSTEM_REGEX |
26 | #include <regex.h> |
27 | #else |
28 | #include <pcreposix.h> |
29 | #endif |
30 | |
31 | typedef regex_t* xb_regex_t; |
32 | |
33 | #define xb_regex_init() |
34 | |
35 | #define xb_regexec(preg,string,nmatch,pmatch,eflags) \ |
36 | regexec(preg, string, nmatch, pmatch, eflags) |
37 | |
38 | #define xb_regerror(errcode,preg,errbuf,errbuf_size) \ |
39 | regerror(errcode, preg, errbuf, errbuf_size) |
40 | |
41 | #define xb_regcomp(preg,regex,cflags) \ |
42 | regcomp(preg, regex, cflags) |
43 | |
44 | #define xb_regfree(preg) regfree(preg) |
45 | |
46 | #define xb_regex_end() |
47 | |
48 | #endif /* XB_REGEX_H */ |
49 | |