NeoMutt
2025-12-11-1009-ga75d9e
Teaching an old dog new tricks
DOXYGEN
Toggle main menu visibility
Loading...
Searching...
No Matches
msgwin_wdata.c
Go to the documentation of this file.
1
22
28
29
#include "config.h"
30
#include <stddef.h>
31
#include "
mutt/lib.h
"
32
#include "
msgwin_wdata.h
"
33
37
void
msgwin_wdata_free
(
struct
MuttWindow
*win,
void
**ptr)
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
}
55
60
struct
MsgWinWindowData
*
msgwin_wdata_new
(
void
)
61
{
62
struct
MsgWinWindowData
*wdata =
MUTT_MEM_CALLOC
(1,
struct
MsgWinWindowData
);
63
64
wdata->
text
=
buf_new
(NULL);
65
66
return
wdata;
67
}
ARRAY_FREE
#define ARRAY_FREE(head)
Release all memory.
Definition
array.h:209
buf_free
void buf_free(struct Buffer **ptr)
Deallocates a buffer.
Definition
buffer.c:326
buf_new
struct Buffer * buf_new(const char *str)
Allocate a new Buffer.
Definition
buffer.c:311
msgwin_wdata_free
void msgwin_wdata_free(struct MuttWindow *win, void **ptr)
Free the private data - Implements MuttWindow::wdata_free() -.
Definition
msgwin_wdata.c:37
FREE
#define FREE(x)
Free memory and set the pointer to NULL.
Definition
memory.h:68
MUTT_MEM_CALLOC
#define MUTT_MEM_CALLOC(n, type)
Definition
memory.h:52
msgwin_wdata_new
struct MsgWinWindowData * msgwin_wdata_new(void)
Create new private data for the Message Window.
Definition
msgwin_wdata.c:60
msgwin_wdata.h
Message Window private data.
MSGWIN_MAX_ROWS
#define MSGWIN_MAX_ROWS
Maximum number of rows to show in the message window.
Definition
msgwin_wdata.h:31
lib.h
Convenience wrapper for the library headers.
MsgWinWindowData
Message Window private Window data.
Definition
msgwin_wdata.h:67
MsgWinWindowData::text
struct Buffer * text
Cached display string.
Definition
msgwin_wdata.h:68
MsgWinWindowData::chars
struct MwCharArray chars
Text: Breakdown of bytes and widths.
Definition
msgwin_wdata.h:69
MsgWinWindowData::rows
struct MwChunkArray rows[MSGWIN_MAX_ROWS]
String byte counts for each row.
Definition
msgwin_wdata.h:70
MuttWindow
Definition
mutt_window.h:129