NeoMutt  2024-10-02-37-gfa9146
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
wdata_free()

Free the private data attached to the MuttWindow. More...

+ Collaboration diagram for wdata_free():

Functions

void browser_private_data_free (struct BrowserPrivateData **ptr)
 Free Private Browser Data - Implements MuttWindow::wdata_free() -.
 
void cbar_data_free (struct MuttWindow *win, void **ptr)
 Free the private Compose Bar data - Implements MuttWindow::wdata_free() -.
 
void compose_shared_data_free (struct MuttWindow *win, void **ptr)
 Free the compose shared data - Implements MuttWindow::wdata_free() -.
 
void env_wdata_free (struct MuttWindow *win, void **ptr)
 Free the Envelope Data - Implements MuttWindow::wdata_free() -.
 
void msgwin_wdata_free (struct MuttWindow *win, void **ptr)
 Free the private data - Implements MuttWindow::wdata_free() -.
 
static void sbar_wdata_free (struct MuttWindow *win, void **ptr)
 Free the private data of the Simple Bar - Implements MuttWindow::wdata_free() -.
 
void helpbar_wdata_free (struct MuttWindow *win, void **ptr)
 Free Helpbar Window data - Implements MuttWindow::wdata_free() -.
 
static void ibar_data_free (struct MuttWindow *win, void **ptr)
 Free the private data - Implements MuttWindow::wdata_free() -.
 
void index_private_data_free (struct MuttWindow *win, void **ptr)
 Free Private Index Data - Implements MuttWindow::wdata_free() -.
 
void index_shared_data_free (struct MuttWindow *win, void **ptr)
 Free Shared Index Data - Implements MuttWindow::wdata_free() -.
 
static void menu_wdata_free (struct MuttWindow *win, void **ptr)
 Free the Menu - Implements MuttWindow::wdata_free() -.
 
static void pbar_data_free (struct MuttWindow *win, void **ptr)
 Free the private data - Implements MuttWindow::wdata_free() -.
 
void progress_wdata_free (struct MuttWindow *win, void **ptr)
 Free Progress Bar Window data - Implements MuttWindow::wdata_free() -.
 
void sb_wdata_free (struct MuttWindow *win, void **ptr)
 Free Sidebar Window data - Implements MuttWindow::wdata_free() -.
 

Detailed Description

Free the private data attached to the MuttWindow.

Parameters
winWindow
ptrWindow data to free
Precondition
win is not NULL
ptr is not NULL
*ptr is not NULL

Function Documentation

◆ browser_private_data_free()

void browser_private_data_free ( struct BrowserPrivateData **  ptr)

Free Private Browser Data - Implements MuttWindow::wdata_free() -.

Definition at line 37 of file private_data.c.

38{
39 if (!ptr || !*ptr)
40 return;
41
42 struct BrowserPrivateData *priv = *ptr;
43
46 destroy_state(&priv->state);
47
48 FREE(ptr);
49}
void destroy_state(struct BrowserState *state)
Free the BrowserState.
Definition: functions.c:137
#define FREE(x)
Definition: memory.h:45
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition: pool.c:94
Private state data for the Browser.
Definition: private_data.h:34
struct Buffer * prefix
Folder prefix string.
Definition: private_data.h:49
struct Buffer * old_last_dir
Previous to last dir.
Definition: private_data.h:48
struct BrowserState state
State containing list of files/dir/mailboxes.
Definition: private_data.h:42
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cbar_data_free()

void cbar_data_free ( struct MuttWindow win,
void **  ptr 
)

Free the private Compose Bar data - Implements MuttWindow::wdata_free() -.

Definition at line 36 of file cbar_data.c.

37{
38 if (!ptr || !*ptr)
39 return;
40
41 struct ComposeBarData *cbar_data = *ptr;
42
43 FREE(&cbar_data->compose_format);
44
45 FREE(ptr);
46}
Data to fill the Compose Bar Window.
Definition: cbar_data.h:34
char * compose_format
Cached status string.
Definition: cbar_data.h:35
+ Here is the caller graph for this function:

◆ compose_shared_data_free()

void compose_shared_data_free ( struct MuttWindow win,
void **  ptr 
)

Free the compose shared data - Implements MuttWindow::wdata_free() -.

Definition at line 36 of file shared_data.c.

37{
38 if (!ptr || !*ptr)
39 return;
40
41 FREE(ptr);
42}
+ Here is the caller graph for this function:

◆ env_wdata_free()

void env_wdata_free ( struct MuttWindow win,
void **  ptr 
)

Free the Envelope Data - Implements MuttWindow::wdata_free() -.

Definition at line 39 of file wdata.c.

40{
41 if (!ptr || !*ptr)
42 return;
43
44 FREE(ptr);
45}
+ Here is the caller graph for this function:

◆ msgwin_wdata_free()

void msgwin_wdata_free ( struct MuttWindow win,
void **  ptr 
)

Free the private data - Implements MuttWindow::wdata_free() -.

Definition at line 37 of file msgwin_wdata.c.

38{
39 if (!ptr || !*ptr)
40 return;
41
42 struct MsgWinWindowData *wdata = *ptr;
43
44 for (int i = 0; i < MSGWIN_MAX_ROWS; i++)
45 {
46 ARRAY_FREE(&wdata->rows[i]);
47 }
48
49 // We don't own MwChar->ac_color, so there's nothing but the ARRAY to free
50 ARRAY_FREE(&wdata->chars);
51 buf_free(&wdata->text);
52
53 FREE(ptr);
54}
#define ARRAY_FREE(head)
Release all memory.
Definition: array.h:204
void buf_free(struct Buffer **ptr)
Deallocates a buffer.
Definition: buffer.c:319
#define MSGWIN_MAX_ROWS
Definition: msgwin_wdata.h:30
Message Window private Window data.
Definition: msgwin_wdata.h:66
struct Buffer * text
Cached display string.
Definition: msgwin_wdata.h:67
struct MwCharArray chars
Text: Breakdown of bytes and widths.
Definition: msgwin_wdata.h:68
struct MwChunkArray rows[MSGWIN_MAX_ROWS]
String byte counts for each row.
Definition: msgwin_wdata.h:69
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sbar_wdata_free()

static void sbar_wdata_free ( struct MuttWindow win,
void **  ptr 
)
static

Free the private data of the Simple Bar - Implements MuttWindow::wdata_free() -.

Definition at line 178 of file sbar.c.

179{
180 if (!ptr || !*ptr)
181 return;
182
183 struct SBarPrivateData *priv = *ptr;
184
185 FREE(&priv->display);
186
187 FREE(ptr);
188}
Private data for the Simple Bar.
Definition: sbar.c:75
char * display
Cached display string.
Definition: sbar.c:76
+ Here is the caller graph for this function:

◆ helpbar_wdata_free()

void helpbar_wdata_free ( struct MuttWindow win,
void **  ptr 
)

Free Helpbar Window data - Implements MuttWindow::wdata_free() -.

Definition at line 47 of file wdata.c.

48{
49 if (!ptr || !*ptr)
50 return;
51
52 struct HelpbarWindowData *wdata = *ptr;
53
54 // We don't own the help_data
55 FREE(&wdata->help_str);
56
57 FREE(ptr);
58}
Help Bar Window data -.
Definition: private.h:34
void * wdata
Private data.
Definition: mutt_window.h:144
+ Here is the caller graph for this function:

◆ ibar_data_free()

static void ibar_data_free ( struct MuttWindow win,
void **  ptr 
)
static

Free the private data - Implements MuttWindow::wdata_free() -.

Definition at line 299 of file ibar.c.

300{
301 if (!ptr || !*ptr)
302 return;
303
304 struct IBarPrivateData *ibar_data = *ptr;
305
306 FREE(&ibar_data->status_format);
307 FREE(&ibar_data->ts_status_format);
308 FREE(&ibar_data->ts_icon_format);
309
310 FREE(ptr);
311}
Data to draw the Index Bar.
Definition: ibar.c:79
char * ts_icon_format
Cached terminal icon string.
Definition: ibar.c:84
char * ts_status_format
Cached terminal status string.
Definition: ibar.c:83
char * status_format
Cached screen status string.
Definition: ibar.c:82
+ Here is the caller graph for this function:

◆ index_private_data_free()

void index_private_data_free ( struct MuttWindow win,
void **  ptr 
)

Free Private Index Data - Implements MuttWindow::wdata_free() -.

Definition at line 36 of file private_data.c.

37{
38 if (!ptr || !*ptr)
39 return;
40
41 FREE(ptr);
42}
+ Here is the caller graph for this function:

◆ index_shared_data_free()

void index_shared_data_free ( struct MuttWindow win,
void **  ptr 
)

Free Shared Index Data - Implements MuttWindow::wdata_free() -.

Only notify is owned by IndexSharedData and should be freed.

Definition at line 278 of file shared_data.c.

279{
280 if (!ptr || !*ptr)
281 return;
282
283 struct IndexSharedData *shared = *ptr;
284
285 mutt_debug(LL_NOTIFY, "NT_INDEX_DELETE: %p\n", (void *) shared);
286 notify_send(shared->notify, NT_INDEX, NT_INDEX_DELETE, shared);
287 notify_free(&shared->notify);
288
289 if (shared->account)
291 if (shared->mailbox_view)
293 if (shared->mailbox)
295 if (shared->email)
297
299
300 FREE(ptr);
301}
#define mutt_debug(LEVEL,...)
Definition: logging2.h:89
static int index_shared_mview_observer(struct NotifyCallback *nc)
Notification that the MailboxView has changed - Implements observer_t -.
Definition: shared_data.c:43
static int index_shared_account_observer(struct NotifyCallback *nc)
Notification that an Account has changed - Implements observer_t -.
Definition: shared_data.c:68
static int index_shared_email_observer(struct NotifyCallback *nc)
Notification that an Email has changed - Implements observer_t -.
Definition: shared_data.c:118
static int index_shared_mailbox_observer(struct NotifyCallback *nc)
Notification that a Mailbox has changed - Implements observer_t -.
Definition: shared_data.c:93
#define NT_INDEX_DELETE
Index Shared Data is about to be freed.
Definition: lib.h:60
@ LL_NOTIFY
Log of notifications.
Definition: logging2.h:48
bool notify_observer_remove(struct Notify *notify, const observer_t callback, const void *global_data)
Remove an observer from an object.
Definition: notify.c:230
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition: notify.c:173
void notify_free(struct Notify **ptr)
Free a notification handler.
Definition: notify.c:75
@ NT_INDEX
Index data has changed, NotifyIndex, IndexSharedData.
Definition: notify_type.h:48
void search_state_free(struct SearchState **ptr)
Free a SearchState.
Definition: search_state.c:51
struct Notify * notify
Notifications: NotifyAccount, EventAccount.
Definition: account.h:41
struct Notify * notify
Notifications: NotifyEmail, EventEmail.
Definition: email.h:73
Data shared between Index, Pager and Sidebar.
Definition: shared_data.h:37
struct Account * account
Current Account.
Definition: shared_data.h:39
struct Email * email
Currently selected Email.
Definition: shared_data.h:42
struct Mailbox * mailbox
Current Mailbox.
Definition: shared_data.h:41
struct MailboxView * mailbox_view
Current Mailbox view.
Definition: shared_data.h:40
struct SearchState * search_state
State of the current search.
Definition: shared_data.h:45
struct Notify * notify
Notifications: NotifyIndex, IndexSharedData.
Definition: shared_data.h:44
struct Notify * notify
Notifications: NotifyMview, EventMview.
Definition: mview.h:52
struct Notify * notify
Notifications: NotifyMailbox, EventMailbox.
Definition: mailbox.h:145
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ menu_wdata_free()

static void menu_wdata_free ( struct MuttWindow win,
void **  ptr 
)
static

Free the Menu - Implements MuttWindow::wdata_free() -.

Definition at line 129 of file window.c.

130{
131 menu_free((struct Menu **) ptr);
132}
void menu_free(struct Menu **ptr)
Free a Menu.
Definition: menu.c:114
Definition: lib.h:79
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pbar_data_free()

static void pbar_data_free ( struct MuttWindow win,
void **  ptr 
)
static

Free the private data - Implements MuttWindow::wdata_free() -.

Definition at line 296 of file pbar.c.

297{
298 if (!ptr || !*ptr)
299 return;
300
301 struct PBarPrivateData *pbar_data = *ptr;
302
303 FREE(&pbar_data->pager_format);
304
305 FREE(ptr);
306}
Data to draw the Pager Bar.
Definition: pbar.c:83
char * pager_format
Cached status string.
Definition: pbar.c:86
+ Here is the caller graph for this function:

◆ progress_wdata_free()

void progress_wdata_free ( struct MuttWindow win,
void **  ptr 
)

Free Progress Bar Window data - Implements MuttWindow::wdata_free() -.

Definition at line 45 of file wdata.c.

46{
47 if (!win || !ptr || !*ptr)
48 return;
49
50 FREE(ptr);
51}
+ Here is the caller graph for this function:

◆ sb_wdata_free()

void sb_wdata_free ( struct MuttWindow win,
void **  ptr 
)

Free Sidebar Window data - Implements MuttWindow::wdata_free() -.

Definition at line 56 of file wdata.c.

57{
58 if (!ptr || !*ptr)
59 return;
60
61 struct SidebarWindowData *wdata = *ptr;
62
63 struct SbEntry **sbep = NULL;
64 ARRAY_FOREACH(sbep, &wdata->entries)
65 {
66 FREE(sbep);
67 }
68 ARRAY_FREE(&wdata->entries);
69
70 FREE(ptr);
71}
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition: array.h:212
Info about folders in the sidebar.
Definition: private.h:41
Sidebar private Window data -.
Definition: private.h:88
struct SbEntryArray entries
Items to display in the sidebar.
Definition: private.h:91
+ Here is the caller graph for this function: