NeoMutt  2025-09-05-43-g177ed6
Teaching an old dog new tricks
DOXYGEN
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
39static 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
49static 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
64 // clang-format off
67 { -1, -1, NULL, NULL },
68 // clang-format on
69};
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition buffer.c:395
@ ED_HISTORY
History ED_HIS_ ExpandoDataHistory.
Definition domain.h:45
Parse Expando string.
static long history_number(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
History: Index number - Implements get_number_t -.
Definition expando.c:39
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
const struct ExpandoRenderCallback HistoryRenderCallbacks[]
Callbacks for History Expandos.
Definition expando.c:63
History Expando definitions.
Read/write command history from/to a file.
@ ED_HIS_MATCH
HistoryEntry.history.
Definition lib.h:80
@ ED_HIS_NUMBER
HistoryEntry.num.
Definition lib.h:81
Convenience wrapper for the library headers.
uint8_t MuttFormatFlags
Flags for expando_render(), e.g. MUTT_FORMAT_FORCESUBJ.
Definition render.h:32
String manipulation buffer.
Definition buffer.h:36
Basic Expando Node.
Definition node.h:67
A line in the History menu.
Definition lib.h:68
int num
Index number.
Definition lib.h:69
const char * history
Description of history.
Definition lib.h:70