NeoMutt  2024-03-23-147-g885fbc
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
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#include "lib.h"
33
38{
39 if (!ptr || !*ptr)
40 return;
41
42 struct BrowserPrivateData *priv = *ptr;
43
46 destroy_state(&priv->state);
47
48 FREE(ptr);
49}
50
56{
57 struct BrowserPrivateData *priv = mutt_mem_calloc(1, sizeof(struct BrowserPrivateData));
58
59 priv->OldLastDir = buf_pool_get();
60 priv->prefix = buf_pool_get();
61
62 return priv;
63}
void destroy_state(struct BrowserState *state)
Free the BrowserState.
Definition: functions.c:137
struct BrowserPrivateData * browser_private_data_new(void)
Create new Browser Data.
Definition: private_data.c:55
void browser_private_data_free(struct BrowserPrivateData **ptr)
Free Private Browser Data - Implements MuttWindow::wdata_free() -.
Definition: private_data.c:37
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:45
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:81
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition: pool.c:94
Key value store.
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