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 "
core/lib.h
"
33
#include "
expando.h
"
34
#include "
lib.h
"
35
#include "
expando/lib.h
"
36
40
static
void
compress_from
(
const
struct
ExpandoNode
*node,
void
*data,
41
MuttFormatFlags
flags,
struct
Buffer
*buf)
42
{
43
const
struct
Mailbox
*m = data;
44
45
buf_quote_filename
(buf, m->
realpath
,
false
);
46
}
47
51
static
void
compress_to
(
const
struct
ExpandoNode
*node,
void
*data,
52
MuttFormatFlags
flags,
struct
Buffer
*buf)
53
{
54
const
struct
Mailbox
*m = data;
55
56
buf_quote_filename
(buf,
mailbox_path
(m),
false
);
57
}
58
64
const
struct
ExpandoRenderCallback
CompressRenderCallbacks
[] = {
65
// clang-format off
66
{
ED_COMPRESS
,
ED_CMP_FROM
,
compress_from
, NULL },
67
{
ED_COMPRESS
,
ED_CMP_TO
,
compress_to
, NULL },
68
{ -1, -1, NULL, NULL },
69
// clang-format on
70
};
CompressRenderCallbacks
const struct ExpandoRenderCallback CompressRenderCallbacks[]
Callbacks for Compression Hook Expandos.
Definition
expando.c:64
expando.h
Compress Expando definitions.
lib.h
Compressed mbox local mailbox type.
ED_CMP_FROM
@ ED_CMP_FROM
'from' path
Definition
lib.h:51
ED_CMP_TO
@ ED_CMP_TO
'to' path
Definition
lib.h:52
lib.h
Convenience wrapper for the core headers.
mailbox_path
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
Definition
mailbox.h:216
ED_COMPRESS
@ ED_COMPRESS
Compress ED_CMP_ ExpandoDataCompress.
Definition
domain.h:40
lib.h
Parse Expando string.
buf_quote_filename
void buf_quote_filename(struct Buffer *buf, const char *filename, bool add_outer)
Quote a filename to survive the shell's quoting rules.
Definition
file.c:803
compress_from
static void compress_from(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Compress: From filename - Implements get_string_t -.
Definition
expando.c:40
compress_to
static void compress_to(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Compress: To filename - Implements get_string_t -.
Definition
expando.c:51
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
Mailbox
A mailbox.
Definition
mailbox.h:81
Mailbox::realpath
char * realpath
Used for duplicate detection, context comparison, and the sidebar.
Definition
mailbox.h:83