NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
wdata.c
Go to the documentation of this file.
1 
29 #include "config.h"
30 #include <stddef.h>
31 #include "private.h"
32 #include "mutt/lib.h"
33 #include "gui/lib.h"
34 
40 {
41  return mutt_mem_calloc(1, sizeof(struct HelpbarWindowData));
42 }
43 
47 void helpbar_wdata_free(struct MuttWindow *win, void **ptr)
48 {
49  struct HelpbarWindowData *wdata = *ptr;
50 
51  // We don't own the help_data
52  FREE(&wdata->help_str);
53 
54  FREE(ptr);
55 }
56 
62 {
63  if (!win || (win->type != WT_HELP_BAR))
64  return NULL;
65 
66  return win->wdata;
67 }
Convenience wrapper for the gui headers.
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:50
struct HelpbarWindowData * helpbar_wdata_new(void)
Create new Window data for the Helpbar.
Definition: wdata.c:39
char * help_str
Formatted Help Bar string.
Definition: private.h:37
Shared constants/structs that are private to the Help Bar.
Help Bar containing list of useful key bindings.
Definition: mutt_window.h:96
Help Bar Window data -.
Definition: private.h:33
struct HelpbarWindowData * helpbar_wdata_get(struct MuttWindow *win)
Get the Helpbar data for this window.
Definition: wdata.c:61
void helpbar_wdata_free(struct MuttWindow *win, void **ptr)
Free Helpbar Window data - Implements MuttWindow::wdata_free() -.
Definition: wdata.c:47
#define FREE(x)
Definition: memory.h:40
Convenience wrapper for the library headers.
void * wdata
Private data.
Definition: mutt_window.h:145
enum WindowType type
Window type, e.g. WT_SIDEBAR.
Definition: mutt_window.h:144