X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=pattern.c;h=cef1722b9092de735ff907321b3a5bda7bc72ac1;hp=868d7abbcb2b409cb4834672d2fddc0a6b537275;hb=c01e17f6b99066ca30931a082ea855656174619b;hpb=d4321859bb9ce5b43fbd8303394cf98ae7720a38 diff --git a/pattern.c b/pattern.c index 868d7ab..cef1722 100644 --- a/pattern.c +++ b/pattern.c @@ -11,6 +11,13 @@ # include "config.h" #endif +#include +#include +#include +#include +#include +#include + #include #include #include @@ -24,6 +31,7 @@ #include #include "mutt.h" +#include "alias.h" #include "handler.h" #include "mx.h" #include "keymap.h" @@ -31,13 +39,6 @@ #include -#include -#include -#include -#include -#include -#include - #include static int eat_regexp (pattern_t * pat, BUFFER *, BUFFER *); @@ -49,59 +50,56 @@ struct pattern_flags { int tag; /* character used to represent this op */ int op; /* operation to perform */ int class; - int (*eat_arg) (pattern_t *, BUFFER *, BUFFER *); + int (*eat_arg)(pattern_t *, BUFFER *, BUFFER *); } Flags[] = { - { - 'A', M_ALL, 0, NULL}, { - 'b', M_BODY, M_FULL_MSG, eat_regexp}, { - 'B', M_WHOLE_MSG, M_FULL_MSG, eat_regexp}, { - 'c', M_CC, 0, eat_regexp}, { - 'C', M_RECIPIENT, 0, eat_regexp}, { - 'd', M_DATE, 0, eat_date}, { - 'D', M_DELETED, 0, NULL}, { - 'e', M_SENDER, 0, eat_regexp}, { - 'E', M_EXPIRED, 0, NULL}, { - 'f', M_FROM, 0, eat_regexp}, { - 'F', M_FLAG, 0, NULL}, { - 'g', M_CRYPT_SIGN, 0, NULL}, { - 'G', M_CRYPT_ENCRYPT, 0, NULL}, { - 'h', M_HEADER, M_FULL_MSG, eat_regexp}, { - 'H', M_HORMEL, 0, eat_regexp}, { - 'i', M_ID, 0, eat_regexp}, { - 'k', M_PGP_KEY, 0, NULL}, { - 'L', M_ADDRESS, 0, eat_regexp}, { - 'l', M_LIST, 0, NULL}, { - 'm', M_MESSAGE, 0, eat_range}, { - 'M', M_MULTIPART, 0, NULL}, { - 'n', M_SCORE, 0, eat_range}, { - 'N', M_NEW, 0, NULL}, { - 'O', M_OLD, 0, NULL}, { - 'p', M_PERSONAL_RECIP, 0, NULL}, { - 'P', M_PERSONAL_FROM, 0, NULL}, { - 'Q', M_REPLIED, 0, NULL}, { - 'R', M_READ, 0, NULL}, { - 'r', M_DATE_RECEIVED, 0, eat_date}, { - 's', M_SUBJECT, 0, eat_regexp}, { - 'S', M_SUPERSEDED, 0, NULL}, { - 'T', M_TAG, 0, NULL}, { - 't', M_TO, 0, eat_regexp}, { - 'U', M_UNREAD, 0, NULL}, { - 'u', M_SUBSCRIBED_LIST, 0, NULL}, { - 'v', M_COLLAPSED, 0, NULL}, { - 'V', M_CRYPT_VERIFIED, 0, NULL}, + {'A', M_ALL, 0, NULL}, + {'b', M_BODY, M_FULL_MSG, eat_regexp}, + {'B', M_WHOLE_MSG, M_FULL_MSG, eat_regexp}, + {'c', M_CC, 0, eat_regexp}, + {'C', M_RECIPIENT, 0, eat_regexp}, + {'d', M_DATE, 0, eat_date}, + {'D', M_DELETED, 0, NULL}, + {'e', M_SENDER, 0, eat_regexp}, + {'E', M_EXPIRED, 0, NULL}, + {'f', M_FROM, 0, eat_regexp}, + {'F', M_FLAG, 0, NULL}, + {'g', M_CRYPT_SIGN, 0, NULL}, + {'G', M_CRYPT_ENCRYPT, 0, NULL}, + {'h', M_HEADER, M_FULL_MSG, eat_regexp}, + {'H', M_HORMEL, 0, eat_regexp}, + {'i', M_ID, 0, eat_regexp}, + {'k', M_PGP_KEY, 0, NULL}, + {'L', M_ADDRESS, 0, eat_regexp}, + {'l', M_LIST, 0, NULL}, + {'m', M_MESSAGE, 0, eat_range}, + {'M', M_MULTIPART, 0, NULL}, + {'n', M_SCORE, 0, eat_range}, + {'N', M_NEW, 0, NULL}, + {'O', M_OLD, 0, NULL}, + {'p', M_PERSONAL_RECIP, 0, NULL}, + {'P', M_PERSONAL_FROM, 0, NULL}, + {'Q', M_REPLIED, 0, NULL}, + {'R', M_READ, 0, NULL}, + {'r', M_DATE_RECEIVED, 0, eat_date}, + {'s', M_SUBJECT, 0, eat_regexp}, + {'S', M_SUPERSEDED, 0, NULL}, + {'T', M_TAG, 0, NULL}, + {'t', M_TO, 0, eat_regexp}, + {'U', M_UNREAD, 0, NULL}, + {'u', M_SUBSCRIBED_LIST, 0, NULL}, + {'v', M_COLLAPSED, 0, NULL}, + {'V', M_CRYPT_VERIFIED, 0, NULL}, #ifdef USE_NNTP - { - 'w', M_NEWSGROUPS, 0, eat_regexp}, + {'w', M_NEWSGROUPS, 0, eat_regexp}, #endif - { - 'x', M_REFERENCE, 0, eat_regexp}, { - 'X', M_MIMEATTACH, 0, eat_range}, { - 'y', M_XLABEL, 0, eat_regexp}, { - 'z', M_SIZE, 0, eat_range}, { - '=', M_DUPLICATED, 0, NULL}, { - '$', M_UNREFERENCED, 0, NULL}, { - '*', M_REALNAME, 0, NULL}, { - 0, 0, 0, NULL} + {'x', M_REFERENCE, 0, eat_regexp}, + {'X', M_MIMEATTACH, 0, eat_range}, + {'y', M_XLABEL, 0, eat_regexp}, + {'z', M_SIZE, 0, eat_range}, + {'=', M_DUPLICATED, 0, NULL}, + {'$', M_UNREFERENCED, 0, NULL}, + {'*', M_REALNAME, 0, NULL}, + {0, 0, 0, NULL} }; static pattern_t *SearchPattern = NULL; /* current search pattern */ @@ -1112,7 +1110,7 @@ mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags, */ return (h->env && h->env->from && (mutt_addr_is_user(h->env->from) - || alias_reverse_lookup(Aliases, h->env->from) + || alias_reverse_lookup(h->env->from) || (h->env->from->personal && valid_realname(h->env-> from->personal) && h->env->from->mailbox) @@ -1143,7 +1141,7 @@ static void quote_simple (char *tmp, ssize_t len, const char *p) } /* convert a simple search into a real request */ -void mutt_check_simple (char *s, size_t len, const char *simple) +void mutt_check_simple (char *s, ssize_t len, const char *simple) { char tmp[LONG_STRING];