NeoMutt  2024-04-25-91-gb0e085
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 <stdbool.h>
28#include "mutt/lib.h"
29#include "format.h"
30#include "render.h"
31
36{
45};
46
47ARRAY_HEAD(ExpandoNodeArray, struct ExpandoNode *);
48
53{
57 char leader;
58 bool lower;
59 const char *start;
60 const char *end;
61};
62
69{
71 struct ExpandoNode *next;
72 int did;
73 int uid;
74
76
77 struct ExpandoNodeArray children;
78
79 const char *start;
80 const char *end;
81
82 void *ndata;
83 void (*ndata_free)(void **ptr);
84
96 int (*render)(const struct ExpandoNode *node, const struct ExpandoRenderData *rdata, struct Buffer *buf, int max_cols, void *data, MuttFormatFlags flags);
97};
98
99struct ExpandoNode *node_new(void);
100
101void node_free (struct ExpandoNode **ptr);
102void node_tree_free(struct ExpandoNode **ptr);
103
104void node_append (struct ExpandoNode **root, struct ExpandoNode *new_node);
105struct ExpandoNode *node_get_child(const struct ExpandoNode *node, int index);
106
107struct ExpandoNode *node_last (struct ExpandoNode *node);
108
109#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_tree_free(struct ExpandoNode **ptr)
Free a tree of ExpandoNodes.
Definition: node.c:76
ExpandoNodeType
Type of Expando Node.
Definition: node.h:36
@ ENT_EXPANDO
Expando, e.g. 'n'.
Definition: node.h:39
@ ENT_CONTAINER
Container for other nodes.
Definition: node.h:44
@ ENT_CONDITION
True/False condition.
Definition: node.h:41
@ ENT_TEXT
Plain text.
Definition: node.h:38
@ ENT_CONDDATE
True/False date condition.
Definition: node.h:43
@ ENT_EMPTY
Empty.
Definition: node.h:37
@ ENT_CONDBOOL
True/False boolean condition.
Definition: node.h:42
@ ENT_PADDING
Padding: soft, hard, EOL.
Definition: node.h:40
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:116
struct ExpandoNode * node_last(struct ExpandoNode *node)
Find the last Node in a tree.
Definition: node.c:138
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:53
char leader
Leader character, 0 or space.
Definition: node.h:57
enum FormatJustify justification
Justification: left, centre, right.
Definition: node.h:56
const char * start
Start of Expando specifier string.
Definition: node.h:59
int min_cols
Minimum number of screen columns.
Definition: node.h:54
int max_cols
Maximum number of screen columns.
Definition: node.h:55
bool lower
Display in lower case.
Definition: node.h:58
const char * end
End of Expando specifier string.
Definition: node.h:60
Basic Expando Node.
Definition: node.h:69
int uid
Unique ID, e.g. ED_EMA_SIZE.
Definition: node.h:73
int(* render)(const struct ExpandoNode *node, const struct ExpandoRenderData *rdata, struct Buffer *buf, int max_cols, void *data, MuttFormatFlags flags)
Definition: node.h:96
void * ndata
Private node data.
Definition: node.h:82
struct ExpandoFormat * format
Formatting info.
Definition: node.h:75
const char * end
End of string data.
Definition: node.h:80
struct ExpandoNode * next
Linked list.
Definition: node.h:71
int did
Domain ID, e.g. ED_EMAIL.
Definition: node.h:72
enum ExpandoNodeType type
Type of Node, e.g. ENT_EXPANDO.
Definition: node.h:70
const char * start
Start of string data.
Definition: node.h:79
void(* ndata_free)(void **ptr)
Function to free the private node data.
Definition: node.h:83
struct ExpandoNodeArray children
Children nodes.
Definition: node.h:77