projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make rx_t be chaine-able so that we can get rid of list2_t (stage 1).
[apps/madmutt.git]
/
lib-lib
/
rx.h
diff --git
a/lib-lib/rx.h
b/lib-lib/rx.h
index
48e295b
..
14709d1
100644
(file)
--- a/
lib-lib/rx.h
+++ b/
lib-lib/rx.h
@@
-26,13
+26,10
@@
* this is an internal abstraction layer for regular expressions
*/
* this is an internal abstraction layer for regular expressions
*/
-#ifndef _LIB_RX_H
-#define _LIB_RX_H
+#ifndef
MUTT_LIB
_LIB_RX_H
+#define
MUTT_LIB
_LIB_RX_H
-#include <sys/types.h>
-#include <regex.h>
-
-#include "../lib/list.h"
+#include <lib-lib/lib-lib.h>
/* this is a non-standard option supported by Solaris 2.5.x which allows
* patterns of the form \<...\>
/* this is a non-standard option supported by Solaris 2.5.x which allows
* patterns of the form \<...\>
@@
-42,6
+39,7
@@
#endif
typedef struct rx_t {
#endif
typedef struct rx_t {
+ struct rx_t *next;
char *pattern; /* printable version */
regex_t *rx; /* compiled expression */
int not; /* do not match */
char *pattern; /* printable version */
regex_t *rx; /* compiled expression */
int not; /* do not match */
@@
-49,12
+47,14
@@
typedef struct rx_t {
rx_t* rx_compile (const char*, int);
void rx_delete(rx_t **);
rx_t* rx_compile (const char*, int);
void rx_delete(rx_t **);
+DO_SLIST(rx_t, rx, rx_delete);
/* for handling lists */
/* for handling lists */
-int rx_list_match(list2_t*, const char*); /* match all items list agains string */
-int rx_lookup(list2_t*, const char*); /* lookup pattern */
+int rx_list_match(rx_t *, const char*); /* match all items list agains string */
+rx_t **rx_lookup(rx_t**, const char*); /* lookup pattern */
+int rx_sanitize_string(char *, ssize_t, const char *);
#define REGCOMP(X,Y,Z) regcomp(X, Y, REG_WORDS|REG_EXTENDED|(Z))
#define REGEXEC(X,Y) regexec(X, Y, 0, NULL, 0)
#define REGCOMP(X,Y,Z) regcomp(X, Y, REG_WORDS|REG_EXTENDED|(Z))
#define REGEXEC(X,Y) regexec(X, Y, 0, NULL, 0)
-#endif /* !_LIB_RX_H */
+#endif /* !
MUTT_LIB
_LIB_RX_H */