NeoMutt  2025-12-11-596-g7cc1dd
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
hook.c
Go to the documentation of this file.
1
30
36
37#include "config.h"
38#include "mutt/lib.h"
39#include "hook.h"
40#include "expando/lib.h"
41#include "pattern/lib.h"
42
47void hook_free(struct Hook **ptr)
48{
49 if (!ptr || !*ptr)
50 return;
51
52 struct Hook *h = *ptr;
53
54 FREE(&h->command);
55 FREE(&h->source_file);
56 FREE(&h->regex.pattern);
57 if (h->regex.regex)
58 {
59 regfree(h->regex.regex);
60 FREE(&h->regex.regex);
61 }
64 FREE(ptr);
65}
66
71struct Hook *hook_new(void)
72{
73 return MUTT_MEM_CALLOC(1, struct Hook);
74}
void mutt_pattern_free(struct PatternList **pat)
Free a Pattern.
Definition compile.c:826
void expando_free(struct Expando **ptr)
Free an Expando object.
Definition expando.c:61
Parse Expando string.
void hook_free(struct Hook **ptr)
Free a Hook.
Definition hook.c:47
struct Hook * hook_new(void)
Create a Hook.
Definition hook.c:71
User-defined Hooks.
#define FREE(x)
Free memory and set the pointer to NULL.
Definition memory.h:68
#define MUTT_MEM_CALLOC(n, type)
Definition memory.h:52
Convenience wrapper for the library headers.
Match patterns to emails.
A list of user hooks.
Definition hook.h:33
struct PatternList * pattern
Used for fcc,save,send-hook.
Definition hook.h:38
struct Regex regex
Regular expression.
Definition hook.h:35
char * command
Filename, command or pattern to execute.
Definition hook.h:36
struct Expando * expando
Used for format hooks.
Definition hook.h:39
char * source_file
Used for relative-directory source.
Definition hook.h:37
char * pattern
printable version
Definition regex3.h:86
regex_t * regex
compiled expression
Definition regex3.h:87