64 if (last->
text[len - 1] !=
'|')
69 for (
int i = len - 2; i >= 0; i--)
71 if (last->
text[i] ==
'\\')
96 if (buf->
data[len - 1] ==
'|')
97 buf->
data[len - 1] =
'\0';
100 FILE *fp_filter = NULL;
106 size_t n = fread(buf->
data, 1, buf->
dsize - 1, fp_filter);
117 strerror(errno), errno);
141 if (!exp || !exp->
node)
147 int old_cols = max_cols;
161 buf->
data[bytes] =
'\0';
size_t buf_len(const struct Buffer *buf)
Calculate the length of a Buffer.
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
void buf_fix_dptr(struct Buffer *buf)
Move the dptr to end of the Buffer.
const char * buf_find_char(const struct Buffer *buf, const char c)
Return a pointer to a char found in the buffer.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
size_t mutt_wstr_trunc(const char *src, size_t maxlen, size_t maxwid, size_t *width)
Work out how to truncate a widechar string.
int expando_filter(const struct Expando *exp, const struct ExpandoRenderData *rdata, void *data, MuttFormatFlags flags, int max_cols, struct Buffer *buf)
Render an Expando and run the result through a filter.
bool check_for_pipe(struct ExpandoNode *root)
Should the Expando be piped to an external command?
void filter_text(struct Buffer *buf)
Filter the text through an external command.
int expando_render(const struct Expando *exp, const struct ExpandoRenderData *rdata, void *data, MuttFormatFlags flags, int max_cols, struct Buffer *buf)
Render an Expando + data into a string.
#define mutt_file_fclose(FP)
char ** EnvList
Private copy of the environment variables.
#define mutt_debug(LEVEL,...)
Convenience wrapper for the gui headers.
@ LL_DEBUG3
Log at debug level 3.
@ LL_DEBUG1
Log at debug level 1.
int filter_wait(pid_t pid)
Wait for the exit of a process and return its status.
pid_t filter_create(const char *cmd, FILE **fp_in, FILE **fp_out, FILE **fp_err, char **envlist)
Set up filter program.
Convenience wrapper for the library headers.
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
struct ExpandoNode * node_last(struct ExpandoNode *node)
Find the last Node in a tree.
Render Expandos using Data.
uint8_t MuttFormatFlags
Flags for expando_render(), e.g. MUTT_FORMAT_FORCESUBJ.
String manipulation buffer.
size_t dsize
Length of data.
char * data
Pointer to data.
const char * text
Node-specific text.
enum ExpandoNodeType type
Type of Node, e.g. ENT_EXPANDO.
struct ExpandoNode * node
Parsed tree.