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)
301 if (c == (
wchar_t)
'\t')
354 const char *c = NULL;
379 const wchar_t *tagptr = tag;
382 if (*tagptr == (
wchar_t)
'/')
399 if (*tag == (
wchar_t)
'/')
449 enriched->
param[0] = (wchar_t)
'\0';
479 long bytes = b_email->
length;
483 wchar_t tag[1024 + 1];
503 while (text_state != DONE)
505 if (text_state != ST_EOF)
507 if (!bytes || ((wc = fgetwc(
state->
fp_in)) == WEOF))
530 text_state = NEWLINE;
540 if (wc == (
wchar_t)
'<')
555 if (wc == (
wchar_t)
'>')
557 tag[tag_len] = (wchar_t)
'\0';
561 else if (tag_len < 1024)
567 text_state = BOGUS_TAG;
572 if (wc == (
wchar_t)
'>')
577 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 -.
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 *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.