X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=hook.c;h=aaf1c7c99ff4b3403610e62ff76503798f67664f;hp=4eb6e01efe4f5652a7e540593622649a433d2b06;hb=28dbd9fbf148be07366048163fffbf7f55a57def;hpb=4670d23c56f21afaa7ef2e0289a47a6a0d112671 diff --git a/hook.c b/hook.c index 4eb6e01..aaf1c7c 100644 --- a/hook.c +++ b/hook.c @@ -11,29 +11,29 @@ # include "config.h" #endif +#include +#include +#include +#include +#include + #include #include #include #include #include +#include #include "mutt.h" +#include "alias.h" #include "mx.h" -#include "mutt_crypt.h" +#include #include "compress.h" -#include "lib/rx.h" - -#include -#include -#include -#include -#include - #define ERROR_STOP 0 typedef struct hook { - unsigned long type; /* hook type */ + int type; /* hook type */ rx_t rx; /* regular expression */ char *command; /* filename, command or pattern to execute */ pattern_t *pattern; /* used for fcc,save,send-hook */ @@ -44,8 +44,8 @@ static HOOK *Hooks = NULL; static unsigned long current_hook_type = 0; -int mutt_parse_hook (BUFFER * buf __attribute__ ((unused)), BUFFER * s, unsigned long data, - BUFFER * err) +int mutt_parse_hook (BUFFER * buf __attribute__ ((unused)), BUFFER * s, + unsigned long data, BUFFER * err) { HOOK *ptr; BUFFER command, pattern; @@ -211,7 +211,7 @@ static void delete_hook (HOOK * h) } /* Deletes all hooks of type ``type'', or all defined hooks if ``type'' is 0 */ -static void delete_hooks (unsigned long type) +static void delete_hooks (long type) { HOOK *h; HOOK *prev; @@ -301,7 +301,7 @@ void mutt_folder_hook (char *path) current_hook_type = 0; } -char *mutt_find_hook (unsigned long type, const char *pat) +char *mutt_find_hook (int type, const char *pat) { HOOK *tmp = Hooks; @@ -313,7 +313,7 @@ char *mutt_find_hook (unsigned long type, const char *pat) return (NULL); } -void mutt_message_hook (CONTEXT * ctx, HEADER * hdr, unsigned long type) +void mutt_message_hook (CONTEXT * ctx, HEADER * hdr, int type) { BUFFER err, token; HOOK *hook; @@ -345,7 +345,7 @@ void mutt_message_hook (CONTEXT * ctx, HEADER * hdr, unsigned long type) } static int -mutt_addr_hook (char *path, size_t pathlen, unsigned long type, CONTEXT * ctx, +mutt_addr_hook (char *path, ssize_t pathlen, unsigned long type, CONTEXT * ctx, HEADER * hdr) { HOOK *hook; @@ -365,7 +365,7 @@ mutt_addr_hook (char *path, size_t pathlen, unsigned long type, CONTEXT * ctx, return -1; } -void mutt_default_save (char *path, size_t pathlen, HEADER * hdr) +void mutt_default_save (char *path, ssize_t pathlen, HEADER * hdr) { *path = 0; if (mutt_addr_hook (path, pathlen, M_SAVEHOOK, Context, hdr) != 0) { @@ -391,7 +391,7 @@ void mutt_default_save (char *path, size_t pathlen, HEADER * hdr) } } -void mutt_select_fcc (char *path, size_t pathlen, HEADER * hdr) +void mutt_select_fcc (char *path, ssize_t pathlen, HEADER * hdr) { address_t *adr; char buf[_POSIX_PATH_MAX];