NeoMutt
2025-12-11-1009-ga75d9e
Teaching an old dog new tricks
DOXYGEN
Toggle main menu visibility
Loading...
Searching...
No Matches
menudef.c
Go to the documentation of this file.
1
22
28
29
#include "config.h"
30
#include "
mutt/lib.h
"
31
#include "
menudef.h
"
32
#include "
keymap.h
"
33
38
void
submenu_free
(
struct
SubMenu
**pptr)
39
{
40
if
(!pptr || !*pptr)
41
return
;
42
43
struct
SubMenu
*sm = *pptr;
44
keymaplist_free
(&sm->
keymaps
);
45
46
FREE
(pptr);
47
}
48
53
struct
SubMenu
*
submenu_new
(
void
)
54
{
55
struct
SubMenu
*sm =
MUTT_MEM_CALLOC
(1,
struct
SubMenu
);
56
57
ARRAY_INIT
(&sm->
keymaps
);
58
59
return
sm;
60
}
61
66
void
menudef_free
(
struct
MenuDefinition
**pptr)
67
{
68
if
(!pptr || !*pptr)
69
return
;
70
71
struct
MenuDefinition
*md = *pptr;
72
73
FREE
(&md->
name
);
74
75
ARRAY_FREE
(&md->
submenus
);
76
77
FREE
(pptr);
78
}
79
84
struct
MenuDefinition
*
menudef_new
(
void
)
85
{
86
struct
MenuDefinition
*md =
MUTT_MEM_CALLOC
(1,
struct
MenuDefinition
);
87
88
ARRAY_INIT
(&md->
submenus
);
89
90
return
md;
91
}
ARRAY_FREE
#define ARRAY_FREE(head)
Release all memory.
Definition
array.h:209
ARRAY_INIT
#define ARRAY_INIT(head)
Initialize an array.
Definition
array.h:65
keymaplist_free
void keymaplist_free(struct KeymapList *kml)
Free a List of Keymaps.
Definition
keymap.c:162
keymap.h
Keymap handling.
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
submenu_free
void submenu_free(struct SubMenu **pptr)
Free a SubMenu.
Definition
menudef.c:38
menudef_new
struct MenuDefinition * menudef_new(void)
Create a new MenuDefinition.
Definition
menudef.c:84
submenu_new
struct SubMenu * submenu_new(void)
Create a new SubMenu.
Definition
menudef.c:53
menudef_free
void menudef_free(struct MenuDefinition **pptr)
Free a MenuDefinition.
Definition
menudef.c:66
menudef.h
Menu Definitions.
lib.h
Convenience wrapper for the library headers.
MenuDefinition
Functions for a Dialog or Window.
Definition
menudef.h:44
MenuDefinition::submenus
struct SubMenuArray submenus
Parts making up the Menu.
Definition
menudef.h:47
MenuDefinition::name
const char * name
Menu name, e.g. "alias".
Definition
menudef.h:46
SubMenu
Collection of related functions.
Definition
menudef.h:33
SubMenu::keymaps
struct KeymapList keymaps
All keybindings.
Definition
menudef.h:36