2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or (at
5 * your option) any later version.
7 * This program is distributed in the hope that it will be useful, but
8 * WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 * Copyright © 2006 Pierre Habouzit
20 * This file is part of mutt-ng, see http://www.muttng.org/.
21 * It's licensed under the GNU General Public License,
22 * please see the file GPL in the top level source directory.
26 * this is an internal abstraction layer for regular expressions
29 #ifndef MUTT_LIB_LIB_RX_H
30 #define MUTT_LIB_LIB_RX_H
32 #include <sys/types.h>
35 #include "../lib/list.h"
37 /* this is a non-standard option supported by Solaris 2.5.x which allows
38 * patterns of the form \<...\>
45 char *pattern; /* printable version */
46 regex_t *rx; /* compiled expression */
47 int not; /* do not match */
50 rx_t* rx_compile (const char*, int);
51 void rx_delete(rx_t **);
53 /* for handling lists */
54 int rx_list_match(list2_t*, const char*); /* match all items list agains string */
55 int rx_lookup(list2_t*, const char*); /* lookup pattern */
56 int rx_sanitize_string(char *, ssize_t, const char *);
59 #define REGCOMP(X,Y,Z) regcomp(X, Y, REG_WORDS|REG_EXTENDED|(Z))
60 #define REGEXEC(X,Y) regexec(X, Y, 0, NULL, 0)
62 #endif /* !MUTT_LIB_LIB_RX_H */