NeoMutt  2025-09-05-55-g97fc89
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 "private.h"
32#include "mutt/lib.h"
33#include "expando/lib.h"
34#include "pattern_data.h"
35
39static void pattern_description(const struct ExpandoNode *node, void *data,
40 MuttFormatFlags flags, struct Buffer *buf)
41{
42 const struct PatternEntry *entry = data;
43
44 const char *s = entry->desc;
45 buf_strcpy(buf, s);
46}
47
51static void pattern_expression(const struct ExpandoNode *node, void *data,
52 MuttFormatFlags flags, struct Buffer *buf)
53{
54 const struct PatternEntry *entry = data;
55
56 const char *s = entry->expr;
57 buf_strcpy(buf, s);
58}
59
63static long pattern_number_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
64{
65 const struct PatternEntry *entry = data;
66
67 return entry->num;
68}
69
76 // clang-format off
80 { -1, -1, NULL, NULL },
81 // clang-format on
82};
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition buffer.c:395
@ ED_PATTERN
Pattern ED_PAT_ ExpandoDataPattern.
Definition domain.h:50
Parse Expando string.
static long pattern_number_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Pattern: Index number - Implements get_number_t -.
Definition expando.c:63
static void pattern_description(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Pattern: pattern description - Implements get_string_t -.
Definition expando.c:39
static void pattern_expression(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Pattern: pattern expression - Implements get_string_t -.
Definition expando.c:51
Convenience wrapper for the library headers.
const struct ExpandoRenderCallback PatternRenderCallbacks[]
Callbacks for Pattern Expandos.
Definition expando.c:75
Shared constants/structs that are private to libpattern.
@ ED_PAT_DESCRIPTION
PatternEntry.desc.
Definition private.h:40
@ ED_PAT_EXPRESSION
PatternEntry.expr.
Definition private.h:41
@ ED_PAT_NUMBER
PatternEntry.num.
Definition private.h:42
Private Pattern Data.
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 Pattern Completion menu.
const char * desc
Description of pattern.
int num
Index number.
const char * expr
Displayed in the menu.