NeoMutt  2023-05-17-16-g61469c
Teaching an old dog new tricks
DOXYGEN
private_data.c
Go to the documentation of this file.
1
29#include "config.h"
30#include "mutt/lib.h"
31#include "private_data.h"
32
37{
38 if (!ptr || !*ptr)
39 return;
40
41 struct BrowserPrivateData *priv = *ptr;
42
45 destroy_state(&priv->state);
46
47 FREE(ptr);
48}
49
55{
56 struct BrowserPrivateData *priv = mutt_mem_calloc(1, sizeof(struct BrowserPrivateData));
57
58 priv->OldLastDir = buf_pool_get();
59 priv->prefix = buf_pool_get();
60
61 return priv;
62}
void destroy_state(struct BrowserState *state)
Free the BrowserState.
Definition: functions.c:74
struct BrowserPrivateData * browser_private_data_new(void)
Create new Browser Data.
Definition: private_data.c:54
void browser_private_data_free(struct BrowserPrivateData **ptr)
Free Private Browser Data - Implements MuttWindow::wdata_free() -.
Definition: private_data.c:36
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:50
#define FREE(x)
Definition: memory.h:43
Convenience wrapper for the library headers.
Private state data for the Pager.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition: pool.c:106
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition: pool.c:119
Private state data for the Browser.
Definition: private_data.h:34
struct Buffer * prefix
Folder prefix string.
Definition: private_data.h:49
struct Buffer * OldLastDir
Previous to last dir.
Definition: private_data.h:48
struct BrowserState state
State containing list of files/dir/mailboxes.
Definition: private_data.h:42