NeoMutt
2025-12-11-1009-ga75d9e
Teaching an old dog new tricks
DOXYGEN
Toggle main menu visibility
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
47
void
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
}
62
mutt_pattern_free
(&h->
pattern
);
63
expando_free
(&h->
expando
);
64
FREE
(ptr);
65
}
66
71
struct
Hook
*
hook_new
(
void
)
72
{
73
return
MUTT_MEM_CALLOC
(1,
struct
Hook
);
74
}
mutt_pattern_free
void mutt_pattern_free(struct PatternList **pat)
Free a Pattern.
Definition
compile.c:836
expando_free
void expando_free(struct Expando **ptr)
Free an Expando object.
Definition
expando.c:61
lib.h
Parse Expando string.
hook_free
void hook_free(struct Hook **ptr)
Free a Hook.
Definition
hook.c:47
hook_new
struct Hook * hook_new(void)
Create a Hook.
Definition
hook.c:71
hook.h
User-defined Hooks.
FREE
#define FREE(x)
Free memory and set the pointer to NULL.
Definition
memory.h:68
MUTT_MEM_CALLOC
#define MUTT_MEM_CALLOC(n, type)
Definition
memory.h:52
lib.h
Convenience wrapper for the library headers.
lib.h
Match patterns to emails.
Hook
A list of user hooks.
Definition
hook.h:33
Hook::pattern
struct PatternList * pattern
Used for fcc,save,send-hook.
Definition
hook.h:38
Hook::regex
struct Regex regex
Regular expression.
Definition
hook.h:35
Hook::command
char * command
Filename, command or pattern to execute.
Definition
hook.h:36
Hook::expando
struct Expando * expando
Used for format hooks.
Definition
hook.h:39
Hook::source_file
char * source_file
Used for relative-directory source.
Definition
hook.h:37
Regex::pattern
char * pattern
printable version
Definition
regex3.h:86
Regex::regex
regex_t * regex
compiled expression
Definition
regex3.h:87