67 if (last->
start[len - 1] !=
'|')
72 for (
int i = len - 2; i >= 0; i--)
74 if (last->
start[i] ==
'\\')
99 if (buf->
data[len - 1] ==
'|')
100 buf->
data[len - 1] =
'\0';
103 FILE *fp_filter = NULL;
109 size_t n = fread(buf->
data, 1, buf->
dsize - 1, fp_filter);
120 strerror(errno), errno);
144 if (!exp || !exp->
node)
150 int old_cols = max_cols;
164 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.
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 * end
End of string data.
enum ExpandoNodeType type
Type of Node, e.g. ENT_EXPANDO.
const char * start
Start of string data.
struct ExpandoNode * node
Parsed tree.