NeoMutt  2025-12-11-949-g4870ee
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
menudef.c File Reference

Menu Definitions. More...

#include "config.h"
#include "mutt/lib.h"
#include "menudef.h"
#include "keymap.h"
+ Include dependency graph for menudef.c:

Go to the source code of this file.

Functions

void submenu_free (struct SubMenu **pptr)
 Free a SubMenu.
 
struct SubMenusubmenu_new (void)
 Create a new SubMenu.
 
void menudef_free (struct MenuDefinition **pptr)
 Free a MenuDefinition.
 
struct MenuDefinitionmenudef_new (void)
 Create a new MenuDefinition.
 

Detailed Description

Menu Definitions.

Authors
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file menudef.c.

Function Documentation

◆ submenu_free()

void submenu_free ( struct SubMenu ** pptr)

Free a SubMenu.

Parameters
pptrSubMenu to free

Definition at line 38 of file menudef.c.

39{
40 if (!pptr || !*pptr)
41 return;
42
43 struct SubMenu *sm = *pptr;
45
46 FREE(pptr);
47}
void keymaplist_free(struct KeymapList *kml)
Free a List of Keymaps.
Definition keymap.c:162
#define FREE(x)
Free memory and set the pointer to NULL.
Definition memory.h:68
Collection of related functions.
Definition menudef.h:33
struct KeymapList keymaps
All keybindings.
Definition menudef.h:36
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ submenu_new()

struct SubMenu * submenu_new ( void )

Create a new SubMenu.

Return values
NewSubMenu

Definition at line 53 of file menudef.c.

54{
55 struct SubMenu *sm = MUTT_MEM_CALLOC(1, struct SubMenu);
56
57 ARRAY_INIT(&sm->keymaps);
58
59 return sm;
60}
#define ARRAY_INIT(head)
Initialize an array.
Definition array.h:65
#define MUTT_MEM_CALLOC(n, type)
Definition memory.h:52
+ Here is the caller graph for this function:

◆ menudef_free()

void menudef_free ( struct MenuDefinition ** pptr)

Free a MenuDefinition.

Parameters
pptrMenuDefinition to free

Definition at line 66 of file menudef.c.

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}
#define ARRAY_FREE(head)
Release all memory.
Definition array.h:209
Functions for a Dialog or Window.
Definition menudef.h:44
struct SubMenuArray submenus
Parts making up the Menu.
Definition menudef.h:47
const char * name
Menu name, e.g. "alias".
Definition menudef.h:46
+ Here is the caller graph for this function:

◆ menudef_new()

struct MenuDefinition * menudef_new ( void )

Create a new MenuDefinition.

Return values
ptrNew MenuDefinition

Definition at line 84 of file menudef.c.

85{
86 struct MenuDefinition *md = MUTT_MEM_CALLOC(1, struct MenuDefinition);
87
88 ARRAY_INIT(&md->submenus);
89
90 return md;
91}
+ Here is the caller graph for this function: