135 while (y && iswspace(enriched->
line[y]))
137 enriched->
line[y] = (wchar_t)
'\0';
147 while (enriched->
line[y] && iswspace(enriched->
line[y]))
151 for (
size_t z = y; z <= enriched->
line_used; z++)
153 enriched->
line[z - y] = enriched->
line[z];
189 enriched->
line[0] = (wchar_t)
'\0';
240 if (!enriched || !enriched->
buffer)
304 if (c == (
wchar_t)
'\t')
357 const char *c = NULL;
382 const wchar_t *tagptr = tag;
385 if (*tagptr == (
wchar_t)
'/')
402 if (*tag == (
wchar_t)
'/')
452 enriched->
param[0] = (wchar_t)
'\0';
482 long bytes = b_email->
length;
486 wchar_t tag[1024 + 1];
506 while (text_state != DONE)
508 if (text_state != ST_EOF)
510 if (!bytes || ((wc = fgetwc(
state->
fp_in)) == WEOF))
533 text_state = NEWLINE;
543 if (wc == (
wchar_t)
'<')
558 if (wc == (
wchar_t)
'>')
560 tag[tag_len] = (wchar_t)
'\0';
564 else if (tag_len < 1024)
570 text_state = BOGUS_TAG;
575 if (wc == (
wchar_t)
'>')
580 if (wc == (
wchar_t)
'\n')
Structs that make up an email.
static void enriched_set_flags(const wchar_t *tag, struct EnrichedState *enriched)
Set flags on the enriched text state.
static void enriched_wrap(struct EnrichedState *enriched)
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_putwc(wchar_t c, struct EnrichedState *enriched)
Write one wide character to the state.
static const struct Etags EnrichedTags[]
EnrichedTags - Lookup table of tags allowed in enriched text.
#define INDENT_SIZE
A (not so) minimal implementation of RFC1563.
static void enriched_flush(struct EnrichedState *enriched, bool wrap)
Write enriched text to the State.
static void enriched_puts(const char *s, struct EnrichedState *enriched)
Write an enriched text string to the State.
int text_enriched_handler(struct Body *b_email, struct State *state)
Handler for enriched text - Implements handler_t -.
#define MUTT_MEM_CALLOC(n, type)
#define MUTT_MEM_REALLOC(pptr, n, type)
Convenience wrapper for the library headers.
int state_putws(struct State *state, const wchar_t *ws)
Write a wide string to the state.
#define state_puts(STATE, STR)
#define STATE_DISPLAY
Output is displayed to the user.
#define state_putc(STATE, STR)
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 & STATE_DISPLAY)
StateFlags flags
Flags, e.g. STATE_DISPLAY.
FILE * fp_out
File to write to.
FILE * fp_in
File to read from.
const char * prefix
String to add to the beginning of each output line.