X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=hook.c;h=fb742061170078965a35f52d02910c8ee2094e3d;hb=69cbbd6ba2aec89f81ecf169e21b7bc4ec5bce90;hp=c6686ae0612aa92b9c5a3935f33d83ebfba7ffae;hpb=c8bf978fc5c4f6c793620a515fa2456a3fa9eb13;p=apps%2Fmadmutt.git diff --git a/hook.c b/hook.c index c6686ae..fb74206 100644 --- a/hook.c +++ b/hook.c @@ -36,7 +36,7 @@ #define ERROR_STOP 0 typedef struct hook { - int type; /* hook type */ + unsigned long 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 */ @@ -45,9 +45,9 @@ typedef struct hook { static HOOK *Hooks = NULL; -static int current_hook_type = 0; +static unsigned long current_hook_type = 0; -int mutt_parse_hook (BUFFER * buf, BUFFER * s, unsigned long data, +int mutt_parse_hook (BUFFER * buf __attribute__ ((unused)), BUFFER * s, unsigned long data, BUFFER * err) { HOOK *ptr; @@ -216,7 +216,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 (int type) +static void delete_hooks (unsigned long type) { HOOK *h; HOOK *prev; @@ -239,7 +239,7 @@ static void delete_hooks (int type) } } -int mutt_parse_unhook (BUFFER * buf, BUFFER * s, unsigned long data, +int mutt_parse_unhook (BUFFER * buf, BUFFER * s, unsigned long data __attribute__ ((unused)), BUFFER * err) { while (MoreArgs (s)) { @@ -253,7 +253,7 @@ int mutt_parse_unhook (BUFFER * buf, BUFFER * s, unsigned long data, delete_hooks (0); } else { - int type = mutt_get_hook_type (buf->data); + unsigned long type = mutt_get_hook_type (buf->data); if (!type) { snprintf (err->data, err->dsize, @@ -306,7 +306,7 @@ void mutt_folder_hook (char *path) current_hook_type = 0; } -char *mutt_find_hook (int type, const char *pat) +char *mutt_find_hook (unsigned long type, const char *pat) { HOOK *tmp = Hooks; @@ -318,7 +318,7 @@ char *mutt_find_hook (int type, const char *pat) return (NULL); } -void mutt_message_hook (CONTEXT * ctx, HEADER * hdr, int type) +void mutt_message_hook (CONTEXT * ctx, HEADER * hdr, unsigned long type) { BUFFER err, token; HOOK *hook; @@ -350,7 +350,7 @@ void mutt_message_hook (CONTEXT * ctx, HEADER * hdr, int type) } static int -mutt_addr_hook (char *path, size_t pathlen, int type, CONTEXT * ctx, +mutt_addr_hook (char *path, size_t pathlen, unsigned long type, CONTEXT * ctx, HEADER * hdr) { HOOK *hook; @@ -375,7 +375,7 @@ void mutt_default_save (char *path, size_t pathlen, HEADER * hdr) *path = 0; if (mutt_addr_hook (path, pathlen, M_SAVEHOOK, Context, hdr) != 0) { char tmp[_POSIX_PATH_MAX]; - ADDRESS *adr; + address_t *adr; ENVELOPE *env = hdr->env; int fromMe = mutt_addr_is_user (env->from); @@ -398,7 +398,7 @@ void mutt_default_save (char *path, size_t pathlen, HEADER * hdr) void mutt_select_fcc (char *path, size_t pathlen, HEADER * hdr) { - ADDRESS *adr; + address_t *adr; char buf[_POSIX_PATH_MAX]; ENVELOPE *env = hdr->env; @@ -440,7 +440,7 @@ char *mutt_iconv_hook (const char *chs) return _mutt_string_hook (chs, M_ICONVHOOK); } -char *mutt_crypt_hook (ADDRESS * adr) +char *mutt_crypt_hook (address_t * adr) { return _mutt_string_hook (adr->mailbox, M_CRYPTHOOK); }