NeoMutt
2025-12-11-1039-g550ac6
Teaching an old dog new tricks
DOXYGEN
Toggle main menu visibility
Loading...
Searching...
No Matches
expando.c
Go to the documentation of this file.
1
22
28
29
#include <stdbool.h>
30
#include <stdio.h>
31
#include "
mutt/lib.h
"
32
#include "
expando.h
"
33
#include "
lib.h
"
34
#include "
expando/lib.h
"
35
39
static
long
history_number
(
const
struct
ExpandoNode
*node,
void
*data,
MuttFormatFlags
flags)
40
{
41
const
struct
HistoryEntry
*entry = data;
42
43
return
entry->
num
+ 1;
44
}
45
49
static
void
history_match
(
const
struct
ExpandoNode
*node,
void
*data,
50
MuttFormatFlags
flags,
struct
Buffer
*buf)
51
{
52
const
struct
HistoryEntry
*entry = data;
53
54
const
char
*s = entry->
history
;
55
buf_strcpy
(buf, s);
56
}
57
63
const
struct
ExpandoRenderCallback
HistoryRenderCallbacks
[] = {
64
// clang-format off
65
{
ED_HISTORY
,
ED_HIS_NUMBER
, NULL,
history_number
},
66
{
ED_HISTORY
,
ED_HIS_MATCH
,
history_match
, NULL },
67
{ -1, -1, NULL, NULL },
68
// clang-format on
69
};
buf_strcpy
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition
buffer.c:401
ED_HISTORY
@ ED_HISTORY
History ED_HIS_ ExpandoDataHistory.
Definition
domain.h:45
lib.h
Parse Expando string.
history_number
static long history_number(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
History: Index number - Implements get_number_t -.
Definition
expando.c:39
history_match
static void history_match(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
History: History match - Implements get_string_t -.
Definition
expando.c:49
HistoryRenderCallbacks
const struct ExpandoRenderCallback HistoryRenderCallbacks[]
Callbacks for History Expandos.
Definition
expando.c:63
expando.h
History Expando definitions.
lib.h
Read/write command history from/to a file.
ED_HIS_MATCH
@ ED_HIS_MATCH
HistoryEntry.history.
Definition
lib.h:83
ED_HIS_NUMBER
@ ED_HIS_NUMBER
HistoryEntry.num.
Definition
lib.h:84
lib.h
Convenience wrapper for the library headers.
MuttFormatFlags
uint8_t MuttFormatFlags
Definition
render.h:45
Buffer
String manipulation buffer.
Definition
buffer.h:36
ExpandoNode
Basic Expando Node.
Definition
node.h:67
ExpandoRenderCallback
Definition
render.h:82
HistoryEntry
A line in the History menu.
Definition
lib.h:71
HistoryEntry::num
int num
Index number.
Definition
lib.h:72
HistoryEntry::history
const char * history
Description of history.
Definition
lib.h:73