blob: 62f438c832febc8f6f0d73bfbaf83c92111b9adb [file] [log] [blame]
"Vladimir N. Oleynik"23f62fc2005-09-14 16:59:11 +00001/* vi: set sw=4 ts=4: */
2/*
Rob Landley86b4d642006-08-03 17:58:17 +00003 * Busybox xregcomp utility routine. This isn't in libbb.h because the
4 * C library we're linking against may not support regex.h.
"Vladimir N. Oleynik"23f62fc2005-09-14 16:59:11 +00005 *
6 * Based in part on code from sash, Copyright (c) 1999 by David I. Bell
Denys Vlasenko0ef64bd2010-08-16 20:14:46 +02007 * Permission has been granted to redistribute this code under GPL.
Denis Vlasenko9213a9e2006-09-17 16:28:10 +00008 *
Denys Vlasenko0ef64bd2010-08-16 20:14:46 +02009 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
"Vladimir N. Oleynik"23f62fc2005-09-14 16:59:11 +000010 */
Denis Vlasenkof81e8db2009-04-09 12:35:13 +000011#ifndef BB_REGEX_H
12#define BB_REGEX_H 1
"Vladimir N. Oleynik"23f62fc2005-09-14 16:59:11 +000013
maxwen27116ba2015-08-14 21:41:28 +020014#if defined(ANDROID) && !defined(RECOVERY_VERSION)
15
16#include <bb_regex.h>
17#define regcomp bb_regcomp
18#define re_compile_pattern bb_re_compile_pattern
19#define re_search bb_re_search
20#define regexec bb_regexec
21#define regfree bb_regfree
22#define regerror bb_regerror
23
24#else
"Vladimir N. Oleynik"23f62fc2005-09-14 16:59:11 +000025#include <regex.h>
maxwen27116ba2015-08-14 21:41:28 +020026#endif
Denis Vlasenko98636eb2008-05-09 17:59:34 +000027
Denis Vlasenkof81e8db2009-04-09 12:35:13 +000028PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
Denis Vlasenko98636eb2008-05-09 17:59:34 +000029
Denis Vlasenkodefc1ea2008-06-27 02:52:20 +000030char* regcomp_or_errmsg(regex_t *preg, const char *regex, int cflags) FAST_FUNC;
31void xregcomp(regex_t *preg, const char *regex, int cflags) FAST_FUNC;
"Vladimir N. Oleynik"23f62fc2005-09-14 16:59:11 +000032
Denis Vlasenkof81e8db2009-04-09 12:35:13 +000033POP_SAVED_FUNCTION_VISIBILITY
Denis Vlasenko98636eb2008-05-09 17:59:34 +000034
"Vladimir N. Oleynik"23f62fc2005-09-14 16:59:11 +000035#endif