X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-lib%2Frx.h;h=af8637485ee3966bef3225e266aab42d21d476d3;hp=0341a197175b3602d580c71db3678b17df9cd673;hb=9233c1f8fefc6ecfe015682f532a7f1ff5038143;hpb=7b8296cfa5c33fbc73c34c4fe1ff6d7bfbaaba01 diff --git a/lib-lib/rx.h b/lib-lib/rx.h index 0341a19..af86374 100644 --- a/lib-lib/rx.h +++ b/lib-lib/rx.h @@ -29,10 +29,7 @@ #ifndef MUTT_LIB_LIB_RX_H #define MUTT_LIB_LIB_RX_H -#include -#include - -#include "../lib/list.h" +#include /* this is a non-standard option supported by Solaris 2.5.x which allows * patterns of the form \<...\> @@ -42,20 +39,26 @@ #endif typedef struct rx_t { + struct rx_t *next; char *pattern; /* printable version */ regex_t *rx; /* compiled expression */ int not; /* do not match */ + + int nmatch; /* nb matches */ + char *template; /* out template */ } rx_t; -rx_t* rx_compile (const char*, int); +rx_t* rx_compile(const char*, int); +void rx_set_template(rx_t *, const char*); void rx_delete(rx_t **); +DO_SLIST(rx_t, rx, rx_delete); /* 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 */ +int rx_list_match2(rx_t *l, const char *s, char *dst, int dlen); +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)