134 while (y && iswspace(stte->
line[y]))
136 stte->
line[y] = (wchar_t)
'\0';
146 while (stte->
line[y] && iswspace(stte->
line[y]))
150 for (
size_t z = y; z <= stte->
line_used; z++)
188 stte->
line[0] = (wchar_t)
'\0';
237 if (!stte || !stte->
buffer)
297 if (c == (
wchar_t)
'\t')
350 const char *c = NULL;
375 const wchar_t *tagptr = tag;
378 if (*tagptr == (
wchar_t)
'/')
395 if (*tag == (
wchar_t)
'/')
444 stte->
param[0] = (wchar_t)
'\0';
476 wchar_t tag[1024 + 1];
495 while (state != DONE)
499 if (!bytes || ((wc = fgetwc(
s->
fp_in)) == WEOF))
532 if (wc == (
wchar_t)
'<')
546 if (wc == (
wchar_t)
'>')
548 tag[tag_len] = (wchar_t)
'\0';
552 else if (tag_len < 1024)
559 if (wc == (
wchar_t)
'>')
564 if (wc == (
wchar_t)
'\n')
Structs that make up an email.
static void enriched_wrap(struct EnrichedState *stte)
Wrap enriched text.
RichAttribs
Rich text attributes.
@ RICH_FLUSHRIGHT
Right-justified text.
@ RICH_NOFILL
Text will not be reformatted.
@ RICH_COLOR
Coloured text.
@ RICH_PARAM
Parameter label.
@ RICH_INDENT
Indented text.
@ RICH_CENTER
Centred text.
@ RICH_ITALIC
Italic text.
@ RICH_UNDERLINE
Underlined text.
@ RICH_EXCERPT
Excerpt text.
@ RICH_INDENT_RIGHT
Right-indented text.
@ RICH_FLUSHLEFT
Left-justified text.
static void enriched_flush(struct EnrichedState *stte, bool wrap)
Write enriched text to the State.
static void enriched_putwc(wchar_t c, struct EnrichedState *stte)
Write one wide character to the state.
static const struct Etags EnrichedTags[]
#define INDENT_SIZE
A (not so) minimal implementation of RFC1563.
static void enriched_puts(const char *s, struct EnrichedState *stte)
Write an enriched text string to the State.
static void enriched_set_flags(const wchar_t *tag, struct EnrichedState *stte)
Set flags on the enriched text state.
int text_enriched_handler(struct Body *a, struct State *s)
Handler for enriched text - Implements handler_t -.
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
Convenience wrapper for the library headers.
int state_putws(struct State *s, const wchar_t *ws)
Write a wide string to the state.
#define state_puts(STATE, STR)
#define state_putc(STATE, STR)
#define MUTT_DISPLAY
Output is displayed to the user.
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
int wcscasecmp(const wchar_t *a, const wchar_t *b)
Compare two wide-character strings, ignoring case.
LOFF_T length
length (in bytes) of attachment
State of enriched-text parser.
Keep track when processing files.
int wraplen
Width to wrap lines to (when flags & MUTT_DISPLAY)
StateFlags flags
Flags, e.g. MUTT_DISPLAY.
FILE * fp_out
File to write to.
char * prefix
String to add to the beginning of each output line.
FILE * fp_in
File to read from.