NeoMutt  2024-11-14-138-ge5ca67
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
expando.c
Go to the documentation of this file.
1
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
@ ED_HIS_MATCH
HistoryEntry.history.
Definition: lib.h:79
@ ED_HIS_NUMBER
HistoryEntry.num.
Definition: lib.h:80
Convenience wrapper for the library headers.
uint8_t MuttFormatFlags
Flags for expando_render(), e.g. MUTT_FORMAT_FORCESUBJ.
Definition: render.h:32
Sidebar Expando definitions.
Key value store.
String manipulation buffer.
Definition: buffer.h:36
Basic Expando Node.
Definition: node.h:67
A line in the History menu.
Definition: lib.h:67
int num
Index number.
Definition: lib.h:68
const char * history
Description of history.
Definition: lib.h:69