NeoMutt  2024-04-16-36-g75b6fb
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
node.h
Go to the documentation of this file.
1
24#ifndef MUTT_EXPANDO_NODE_H
25#define MUTT_EXPANDO_NODE_H
26
27#include "mutt/lib.h"
28#include "format.h"
29#include "render.h"
30
35{
44};
45
46ARRAY_HEAD(ExpandoNodeArray, struct ExpandoNode *);
47
52{
56 char leader;
57 const char *start;
58 const char *end;
59};
60
67{
69 struct ExpandoNode *next;
70 int did;
71 int uid;
72
74
75 struct ExpandoNodeArray children;
76
77 const char *start;
78 const char *end;
79
80 void *ndata;
81 void (*ndata_free)(void **ptr);
82
94 int (*render)(const struct ExpandoNode *node, const struct ExpandoRenderData *rdata, struct Buffer *buf, int max_cols, void *data, MuttFormatFlags flags);
95};
96
97struct ExpandoNode *node_new(void);
98
99void node_free (struct ExpandoNode **ptr);
100void node_tree_free(struct ExpandoNode **ptr);
101
102void node_append (struct ExpandoNode **root, struct ExpandoNode *new_node);
103struct ExpandoNode *node_get_child(const struct ExpandoNode *node, int index);
104void node_set_child(struct ExpandoNode *node, int index, struct ExpandoNode *child);
105
106#endif /* MUTT_EXPANDO_NODE_H */
#define ARRAY_HEAD(name, type)
Define a named struct for arrays of elements of a certain type.
Definition: array.h:47
Simple string formatting.
FormatJustify
Alignment for format_string()
Definition: format.h:33
Convenience wrapper for the library headers.
struct ExpandoNode * node_new(void)
Create a new empty ExpandoNode.
Definition: node.c:39
void node_set_child(struct ExpandoNode *node, int index, struct ExpandoNode *child)
Set the child of an ExpandoNode.
Definition: node.c:117
void node_tree_free(struct ExpandoNode **ptr)
Free a tree of ExpandoNodes.
Definition: node.c:76
ExpandoNodeType
Type of Expando Node.
Definition: node.h:35
@ ENT_EXPANDO
Expando, e.g. 'n'.
Definition: node.h:38
@ ENT_CONTAINER
Container for other nodes.
Definition: node.h:43
@ ENT_CONDITION
True/False condition.
Definition: node.h:40
@ ENT_TEXT
Plain text.
Definition: node.h:37
@ ENT_CONDDATE
True/False date condition.
Definition: node.h:42
@ ENT_EMPTY
Empty.
Definition: node.h:36
@ ENT_CONDBOOL
True/False boolean condition.
Definition: node.h:41
@ ENT_PADDING
Padding: soft, hard, EOL.
Definition: node.h:39
struct ExpandoNode * node_get_child(const struct ExpandoNode *node, int index)
Get a child of an ExpandoNode.
Definition: node.c:99
void node_append(struct ExpandoNode **root, struct ExpandoNode *new_node)
Append an ExpandoNode to an existing node.
Definition: node.c:133
void node_free(struct ExpandoNode **ptr)
Free an ExpandoNode and its private data.
Definition: node.c:48
Render Expandos using Data.
uint8_t MuttFormatFlags
Flags for expando_render(), e.g. MUTT_FORMAT_FORCESUBJ.
Definition: render.h:32
String manipulation buffer.
Definition: buffer.h:36
Formatting information for an Expando.
Definition: node.h:52
char leader
Leader character, 0 or space.
Definition: node.h:56
enum FormatJustify justification
Justification: left, centre, right.
Definition: node.h:55
const char * start
Start of Expando specifier string.
Definition: node.h:57
int min_cols
Minimum number of screen columns.
Definition: node.h:53
int max_cols
Maximum number of screen columns.
Definition: node.h:54
const char * end
End of Expando specifier string.
Definition: node.h:58
Basic Expando Node.
Definition: node.h:67
int uid
Unique ID, e.g. ED_EMA_SIZE.
Definition: node.h:71
int(* render)(const struct ExpandoNode *node, const struct ExpandoRenderData *rdata, struct Buffer *buf, int max_cols, void *data, MuttFormatFlags flags)
Definition: node.h:94
void * ndata
Private node data.
Definition: node.h:80
struct ExpandoFormat * format
Formatting info.
Definition: node.h:73
const char * end
End of string data.
Definition: node.h:78
struct ExpandoNode * next
Linked list.
Definition: node.h:69
int did
Domain ID, e.g. ED_EMAIL.
Definition: node.h:70
enum ExpandoNodeType type
Type of Node, e.g. ENT_EXPANDO.
Definition: node.h:68
const char * start
Start of string data.
Definition: node.h:77
void(* ndata_free)(void **ptr)
Function to free the private node data.
Definition: node.h:81
struct ExpandoNodeArray children
Children nodes.
Definition: node.h:75