NeoMutt  2018-07-16 +2225-8687db
Teaching an old dog new tricks
DOXYGEN
enriched.c File Reference

Rich text handler. More...

#include "config.h"
#include <stddef.h>
#include <stdbool.h>
#include <stdio.h>
#include <wchar.h>
#include <wctype.h>
#include "mutt/mutt.h"
#include "email/lib.h"
#include "mutt_window.h"
#include "state.h"

Go to the source code of this file.

Data Structures

struct  Etags
 Enriched text tags. More...
 
struct  EnrichedState
 State of enriched-text parser. More...
 

Macros

#define INDENT_SIZE   4
 A (not so) minimal implementation of RFC1563. More...
 

Enumerations

enum  RichAttribs {
  RICH_PARAM = 0, RICH_BOLD, RICH_UNDERLINE, RICH_ITALIC,
  RICH_NOFILL, RICH_INDENT, RICH_INDENT_RIGHT, RICH_EXCERPT,
  RICH_CENTER, RICH_FLUSHLEFT, RICH_FLUSHRIGHT, RICH_COLOR,
  RICH_MAX
}
 Rich text attributes. More...
 

Functions

static void enriched_wrap (struct EnrichedState *stte)
 Wrap enriched text. More...
 
static void enriched_flush (struct EnrichedState *stte, bool wrap)
 Write enriched text to the State. More...
 
static void enriched_putwc (wchar_t c, struct EnrichedState *stte)
 Write one wide character to the state. More...
 
static void enriched_puts (const char *s, struct EnrichedState *stte)
 Write an enriched text string to the State. More...
 
static void enriched_set_flags (const wchar_t *tag, struct EnrichedState *stte)
 Set flags on the enriched text state. More...
 
int text_enriched_handler (struct Body *a, struct State *s)
 Handler for enriched text - Implements handler_t. More...
 

Variables

static const struct Etags EnrichedTags []
 

Detailed Description

Rich text handler.

Authors
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file enriched.c.

Macro Definition Documentation

#define INDENT_SIZE   4

A (not so) minimal implementation of RFC1563.

Definition at line 44 of file enriched.c.

Enumeration Type Documentation

Rich text attributes.

Enumerator
RICH_PARAM 

Parameter label.

RICH_BOLD 

Bold text.

RICH_UNDERLINE 

Underlined text.

RICH_ITALIC 

Italic text.

RICH_NOFILL 

Text will not be reformatted.

RICH_INDENT 

Indented text.

RICH_INDENT_RIGHT 

Right-indented text.

RICH_EXCERPT 

Excerpt text.

RICH_CENTER 

Centred text.

RICH_FLUSHLEFT 

Left-justified text.

RICH_FLUSHRIGHT 

Right-justified text.

RICH_COLOR 

Coloured text.

RICH_MAX 

Definition at line 49 of file enriched.c.

50 {
51  RICH_PARAM = 0,
52  RICH_BOLD,
54  RICH_ITALIC,
55  RICH_NOFILL,
56  RICH_INDENT,
58  RICH_EXCERPT,
59  RICH_CENTER,
62  RICH_COLOR,
63  RICH_MAX,
64 };
Centred text.
Definition: enriched.c:59
Text will not be reformatted.
Definition: enriched.c:55
Left-justified text.
Definition: enriched.c:60
Italic text.
Definition: enriched.c:54
Right-justified text.
Definition: enriched.c:61
Coloured text.
Definition: enriched.c:62
Parameter label.
Definition: enriched.c:51
Indented text.
Definition: enriched.c:56
Underlined text.
Definition: enriched.c:53
Excerpt text.
Definition: enriched.c:58
Right-indented text.
Definition: enriched.c:57
Bold text.
Definition: enriched.c:52

Function Documentation

static void enriched_wrap ( struct EnrichedState stte)
static

Wrap enriched text.

Parameters
stteState of enriched text

Definition at line 121 of file enriched.c.

122 {
123  if (!stte)
124  return;
125 
126  int x;
127 
128  if (stte->line_len)
129  {
130  if (stte->tag_level[RICH_CENTER] || stte->tag_level[RICH_FLUSHRIGHT])
131  {
132  /* Strip trailing white space */
133  size_t y = stte->line_used - 1;
134 
135  while (y && iswspace(stte->line[y]))
136  {
137  stte->line[y] = (wchar_t) '\0';
138  y--;
139  stte->line_used--;
140  stte->line_len--;
141  }
142  if (stte->tag_level[RICH_CENTER])
143  {
144  /* Strip leading whitespace */
145  y = 0;
146 
147  while (stte->line[y] && iswspace(stte->line[y]))
148  y++;
149  if (y)
150  {
151  for (size_t z = y; z <= stte->line_used; z++)
152  {
153  stte->line[z - y] = stte->line[z];
154  }
155 
156  stte->line_len -= y;
157  stte->line_used -= y;
158  }
159  }
160  }
161 
162  const int extra = stte->wrap_margin - stte->line_len - stte->indent_len -
164  if (extra > 0)
165  {
166  if (stte->tag_level[RICH_CENTER])
167  {
168  x = extra / 2;
169  while (x)
170  {
171  state_putc(' ', stte->s);
172  x--;
173  }
174  }
175  else if (stte->tag_level[RICH_FLUSHRIGHT])
176  {
177  x = extra - 1;
178  while (x)
179  {
180  state_putc(' ', stte->s);
181  x--;
182  }
183  }
184  }
185  state_putws((const wchar_t *) stte->line, stte->s);
186  }
187 
188  state_putc('\n', stte->s);
189  stte->line[0] = (wchar_t) '\0';
190  stte->line_len = 0;
191  stte->line_used = 0;
192  stte->indent_len = 0;
193  if (stte->s->prefix)
194  {
195  state_puts(stte->s->prefix, stte->s);
196  stte->indent_len += mutt_str_strlen(stte->s->prefix);
197  }
198 
199  if (stte->tag_level[RICH_EXCERPT])
200  {
201  x = stte->tag_level[RICH_EXCERPT];
202  while (x)
203  {
204  if (stte->s->prefix)
205  {
206  state_puts(stte->s->prefix, stte->s);
207  stte->indent_len += mutt_str_strlen(stte->s->prefix);
208  }
209  else
210  {
211  state_puts("> ", stte->s);
212  stte->indent_len += mutt_str_strlen("> ");
213  }
214  x--;
215  }
216  }
217  else
218  stte->indent_len = 0;
219  if (stte->tag_level[RICH_INDENT])
220  {
221  x = stte->tag_level[RICH_INDENT] * INDENT_SIZE;
222  stte->indent_len += x;
223  while (x)
224  {
225  state_putc(' ', stte->s);
226  x--;
227  }
228  }
229 }
Centred text.
Definition: enriched.c:59
char * prefix
String to add to the beginning of each output line.
Definition: state.h:48
size_t mutt_str_strlen(const char *a)
Calculate the length of a string, safely.
Definition: string.c:666
size_t line_used
Definition: enriched.c:105
size_t line_len
Definition: enriched.c:104
int wrap_margin
Definition: enriched.c:113
int tag_level[RICH_MAX]
Definition: enriched.c:112
Right-justified text.
Definition: enriched.c:61
size_t indent_len
Definition: enriched.c:107
Indented text.
Definition: enriched.c:56
#define state_puts(str, state)
Definition: state.h:54
#define state_putc(str, state)
Definition: state.h:55
wchar_t * line
Definition: enriched.c:101
int state_putws(const wchar_t *ws, struct State *s)
Write a wide string to the state.
Definition: state.c:107
struct State * s
Definition: enriched.c:114
#define INDENT_SIZE
A (not so) minimal implementation of RFC1563.
Definition: enriched.c:44
Excerpt text.
Definition: enriched.c:58
Right-indented text.
Definition: enriched.c:57
static void enriched_flush ( struct EnrichedState stte,
bool  wrap 
)
static

Write enriched text to the State.

Parameters
stteState of Enriched text
wraptrue if the text should be wrapped

Definition at line 236 of file enriched.c.

237 {
238  if (!stte || !stte->buffer)
239  return;
240 
241  if (!stte->tag_level[RICH_NOFILL] &&
242  ((stte->line_len + stte->word_len) >
243  (stte->wrap_margin - (stte->tag_level[RICH_INDENT_RIGHT] * INDENT_SIZE) - stte->indent_len)))
244  {
245  enriched_wrap(stte);
246  }
247 
248  if (stte->buf_used)
249  {
250  stte->buffer[stte->buf_used] = (wchar_t) '\0';
251  stte->line_used += stte->buf_used;
252  if (stte->line_used > stte->line_max)
253  {
254  stte->line_max = stte->line_used;
255  mutt_mem_realloc(&stte->line, (stte->line_max + 1) * sizeof(wchar_t));
256  }
257  wcscat(stte->line, stte->buffer);
258  stte->line_len += stte->word_len;
259  stte->word_len = 0;
260  stte->buf_used = 0;
261  }
262  if (wrap)
263  enriched_wrap(stte);
264  fflush(stte->s->fp_out);
265 }
size_t buf_used
Definition: enriched.c:109
FILE * fp_out
File to write to.
Definition: state.h:47
Text will not be reformatted.
Definition: enriched.c:55
size_t line_max
Definition: enriched.c:106
size_t line_used
Definition: enriched.c:105
size_t line_len
Definition: enriched.c:104
size_t word_len
Definition: enriched.c:108
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
Definition: memory.c:114
int wrap_margin
Definition: enriched.c:113
int tag_level[RICH_MAX]
Definition: enriched.c:112
size_t indent_len
Definition: enriched.c:107
static void enriched_wrap(struct EnrichedState *stte)
Wrap enriched text.
Definition: enriched.c:121
wchar_t * line
Definition: enriched.c:101
struct State * s
Definition: enriched.c:114
#define INDENT_SIZE
A (not so) minimal implementation of RFC1563.
Definition: enriched.c:44
wchar_t * buffer
Definition: enriched.c:100
Right-indented text.
Definition: enriched.c:57
static void enriched_putwc ( wchar_t  c,
struct EnrichedState stte 
)
static

Write one wide character to the state.

Parameters
cCharacter to write
stteState of Enriched text

Definition at line 272 of file enriched.c.

273 {
274  if (!stte)
275  return;
276 
277  if (stte->tag_level[RICH_PARAM])
278  {
279  if (stte->tag_level[RICH_COLOR])
280  {
281  if (stte->param_used + 1 >= stte->param_len)
282  mutt_mem_realloc(&stte->param, (stte->param_len += 256) * sizeof(wchar_t));
283 
284  stte->param[stte->param_used++] = c;
285  }
286  return; /* nothing to do */
287  }
288 
289  /* see if more space is needed (plus extra for possible rich characters) */
290  if (stte->buf_len < (stte->buf_used + 3))
291  {
292  stte->buf_len += 1024;
293  mutt_mem_realloc(&stte->buffer, (stte->buf_len + 1) * sizeof(wchar_t));
294  }
295 
296  if ((!stte->tag_level[RICH_NOFILL] && iswspace(c)) || (c == (wchar_t) '\0'))
297  {
298  if (c == (wchar_t) '\t')
299  stte->word_len += 8 - (stte->line_len + stte->word_len) % 8;
300  else
301  stte->word_len++;
302 
303  stte->buffer[stte->buf_used++] = c;
304  enriched_flush(stte, false);
305  }
306  else
307  {
308  if (stte->s->flags & MUTT_DISPLAY)
309  {
310  if (stte->tag_level[RICH_BOLD])
311  {
312  stte->buffer[stte->buf_used++] = c;
313  stte->buffer[stte->buf_used++] = (wchar_t) '\010'; // Ctrl-H (backspace)
314  stte->buffer[stte->buf_used++] = c;
315  }
316  else if (stte->tag_level[RICH_UNDERLINE])
317  {
318  stte->buffer[stte->buf_used++] = '_';
319  stte->buffer[stte->buf_used++] = (wchar_t) '\010'; // Ctrl-H (backspace)
320  stte->buffer[stte->buf_used++] = c;
321  }
322  else if (stte->tag_level[RICH_ITALIC])
323  {
324  stte->buffer[stte->buf_used++] = c;
325  stte->buffer[stte->buf_used++] = (wchar_t) '\010'; // Ctrl-H (backspace)
326  stte->buffer[stte->buf_used++] = '_';
327  }
328  else
329  {
330  stte->buffer[stte->buf_used++] = c;
331  }
332  }
333  else
334  {
335  stte->buffer[stte->buf_used++] = c;
336  }
337  stte->word_len++;
338  }
339 }
#define MUTT_DISPLAY
Output is displayed to the user.
Definition: state.h:32
size_t buf_used
Definition: enriched.c:109
Text will not be reformatted.
Definition: enriched.c:55
StateFlags flags
Flags, e.g. MUTT_DISPLAY.
Definition: state.h:49
size_t line_len
Definition: enriched.c:104
wchar_t * param
Definition: enriched.c:102
size_t word_len
Definition: enriched.c:108
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
Definition: memory.c:114
Italic text.
Definition: enriched.c:54
int tag_level[RICH_MAX]
Definition: enriched.c:112
static void enriched_flush(struct EnrichedState *stte, bool wrap)
Write enriched text to the State.
Definition: enriched.c:236
size_t buf_len
Definition: enriched.c:103
Coloured text.
Definition: enriched.c:62
Parameter label.
Definition: enriched.c:51
size_t param_len
Definition: enriched.c:111
Underlined text.
Definition: enriched.c:53
size_t param_used
Definition: enriched.c:110
struct State * s
Definition: enriched.c:114
wchar_t * buffer
Definition: enriched.c:100
Bold text.
Definition: enriched.c:52
static void enriched_puts ( const char *  s,
struct EnrichedState stte 
)
static

Write an enriched text string to the State.

Parameters
sString to write
stteState of Enriched text

Definition at line 346 of file enriched.c.

347 {
348  if (!stte)
349  return;
350 
351  const char *c = NULL;
352 
353  if (stte->buf_len < (stte->buf_used + mutt_str_strlen(s)))
354  {
355  stte->buf_len += 1024;
356  mutt_mem_realloc(&stte->buffer, (stte->buf_len + 1) * sizeof(wchar_t));
357  }
358  c = s;
359  while (*c)
360  {
361  stte->buffer[stte->buf_used++] = (wchar_t) *c;
362  c++;
363  }
364 }
size_t buf_used
Definition: enriched.c:109
size_t mutt_str_strlen(const char *a)
Calculate the length of a string, safely.
Definition: string.c:666
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
Definition: memory.c:114
size_t buf_len
Definition: enriched.c:103
wchar_t * buffer
Definition: enriched.c:100
static void enriched_set_flags ( const wchar_t *  tag,
struct EnrichedState stte 
)
static

Set flags on the enriched text state.

Parameters
tagTag to set
stteState of Enriched text

Definition at line 371 of file enriched.c.

372 {
373  if (!stte)
374  return;
375 
376  const wchar_t *tagptr = tag;
377  int i, j;
378 
379  if (*tagptr == (wchar_t) '/')
380  tagptr++;
381 
382  for (i = 0, j = -1; EnrichedTags[i].tag_name; i++)
383  {
384  if (wcscasecmp(EnrichedTags[i].tag_name, tagptr) == 0)
385  {
386  j = EnrichedTags[i].index;
387  break;
388  }
389  }
390 
391  if (j != -1)
392  {
393  if ((j == RICH_CENTER) || (j == RICH_FLUSHLEFT) || (j == RICH_FLUSHRIGHT))
394  enriched_flush(stte, true);
395 
396  if (*tag == (wchar_t) '/')
397  {
398  if (stte->tag_level[j]) /* make sure not to go negative */
399  stte->tag_level[j]--;
400  if ((stte->s->flags & MUTT_DISPLAY) && (j == RICH_PARAM) && stte->tag_level[RICH_COLOR])
401  {
402  stte->param[stte->param_used] = (wchar_t) '\0';
403  if (wcscasecmp(L"black", stte->param) == 0)
404  {
405  enriched_puts("\033[30m", stte); // Escape
406  }
407  else if (wcscasecmp(L"red", stte->param) == 0)
408  {
409  enriched_puts("\033[31m", stte); // Escape
410  }
411  else if (wcscasecmp(L"green", stte->param) == 0)
412  {
413  enriched_puts("\033[32m", stte); // Escape
414  }
415  else if (wcscasecmp(L"yellow", stte->param) == 0)
416  {
417  enriched_puts("\033[33m", stte); // Escape
418  }
419  else if (wcscasecmp(L"blue", stte->param) == 0)
420  {
421  enriched_puts("\033[34m", stte); // Escape
422  }
423  else if (wcscasecmp(L"magenta", stte->param) == 0)
424  {
425  enriched_puts("\033[35m", stte); // Escape
426  }
427  else if (wcscasecmp(L"cyan", stte->param) == 0)
428  {
429  enriched_puts("\033[36m", stte); // Escape
430  }
431  else if (wcscasecmp(L"white", stte->param) == 0)
432  {
433  enriched_puts("\033[37m", stte); // Escape
434  }
435  }
436  if ((stte->s->flags & MUTT_DISPLAY) && (j == RICH_COLOR))
437  {
438  enriched_puts("\033[0m", stte); // Escape
439  }
440 
441  /* flush parameter buffer when closing the tag */
442  if (j == RICH_PARAM)
443  {
444  stte->param_used = 0;
445  stte->param[0] = (wchar_t) '\0';
446  }
447  }
448  else
449  stte->tag_level[j]++;
450 
451  if (j == RICH_EXCERPT)
452  enriched_flush(stte, true);
453  }
454 }
#define MUTT_DISPLAY
Output is displayed to the user.
Definition: state.h:32
Centred text.
Definition: enriched.c:59
Left-justified text.
Definition: enriched.c:60
static const struct Etags EnrichedTags[]
Definition: enriched.c:76
const wchar_t * tag_name
Definition: enriched.c:71
StateFlags flags
Flags, e.g. MUTT_DISPLAY.
Definition: state.h:49
wchar_t * param
Definition: enriched.c:102
int index
Definition: enriched.c:72
static void enriched_puts(const char *s, struct EnrichedState *stte)
Write an enriched text string to the State.
Definition: enriched.c:346
int tag_level[RICH_MAX]
Definition: enriched.c:112
static void enriched_flush(struct EnrichedState *stte, bool wrap)
Write enriched text to the State.
Definition: enriched.c:236
Right-justified text.
Definition: enriched.c:61
int wcscasecmp(const wchar_t *a, const wchar_t *b)
Compare two wide-character strings, ignoring case.
Definition: wcscasecmp.c:41
Coloured text.
Definition: enriched.c:62
Parameter label.
Definition: enriched.c:51
size_t param_used
Definition: enriched.c:110
struct State * s
Definition: enriched.c:114
Excerpt text.
Definition: enriched.c:58
int text_enriched_handler ( struct Body a,
struct State s 
)

Handler for enriched text - Implements handler_t.

Return values
0Always

Definition at line 460 of file enriched.c.

461 {
462  enum
463  {
464  TEXT,
465  LANGLE,
466  TAG,
467  BOGUS_TAG,
468  NEWLINE,
469  ST_EOF,
470  DONE
471  } state = TEXT;
472 
473  long bytes = a->length;
474  struct EnrichedState stte = { 0 };
475  wchar_t wc = 0;
476  int tag_len = 0;
477  wchar_t tag[1024 + 1];
478 
479  stte.s = s;
480  stte.wrap_margin =
481  ((s->flags & MUTT_DISPLAY) ?
482  (MuttIndexWindow->cols - 4) :
483  ((MuttIndexWindow->cols - 4) < 72) ? (MuttIndexWindow->cols - 4) : 72);
484  stte.line_max = stte.wrap_margin * 4;
485  stte.line = mutt_mem_calloc(1, (stte.line_max + 1) * sizeof(wchar_t));
486  stte.param = mutt_mem_calloc(1, 256 * sizeof(wchar_t));
487 
488  stte.param_len = 256;
489  stte.param_used = 0;
490 
491  if (s->prefix)
492  {
493  state_puts(s->prefix, s);
494  stte.indent_len += mutt_str_strlen(s->prefix);
495  }
496 
497  while (state != DONE)
498  {
499  if (state != ST_EOF)
500  {
501  if (!bytes || ((wc = fgetwc(s->fp_in)) == WEOF))
502  state = ST_EOF;
503  else
504  bytes--;
505  }
506 
507  switch (state)
508  {
509  case TEXT:
510  switch (wc)
511  {
512  case '<':
513  state = LANGLE;
514  break;
515 
516  case '\n':
517  if (stte.tag_level[RICH_NOFILL])
518  {
519  enriched_flush(&stte, true);
520  }
521  else
522  {
523  enriched_putwc((wchar_t) ' ', &stte);
524  state = NEWLINE;
525  }
526  break;
527 
528  default:
529  enriched_putwc(wc, &stte);
530  }
531  break;
532 
533  case LANGLE:
534  if (wc == (wchar_t) '<')
535  {
536  enriched_putwc(wc, &stte);
537  state = TEXT;
538  break;
539  }
540  else
541  {
542  tag_len = 0;
543  state = TAG;
544  }
545  /* Yes, (it wasn't a <<, so this char is first in TAG) */
546  /* fallthrough */
547  case TAG:
548  if (wc == (wchar_t) '>')
549  {
550  tag[tag_len] = (wchar_t) '\0';
551  enriched_set_flags(tag, &stte);
552  state = TEXT;
553  }
554  else if (tag_len < 1024) /* ignore overly long tags */
555  tag[tag_len++] = wc;
556  else
557  state = BOGUS_TAG;
558  break;
559 
560  case BOGUS_TAG:
561  if (wc == (wchar_t) '>')
562  state = TEXT;
563  break;
564 
565  case NEWLINE:
566  if (wc == (wchar_t) '\n')
567  enriched_flush(&stte, true);
568  else
569  {
570  ungetwc(wc, s->fp_in);
571  bytes++;
572  state = TEXT;
573  }
574  break;
575 
576  case ST_EOF:
577  enriched_putwc((wchar_t) '\0', &stte);
578  enriched_flush(&stte, true);
579  state = DONE;
580  break;
581 
582  case DONE:
583  /* not reached */
584  break;
585  }
586  }
587 
588  state_putc('\n', s); /* add a final newline */
589 
590  FREE(&(stte.buffer));
591  FREE(&(stte.line));
592  FREE(&(stte.param));
593 
594  return 0;
595 }
#define MUTT_DISPLAY
Output is displayed to the user.
Definition: state.h:32
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:50
State of enriched-text parser.
Definition: enriched.c:98
char * prefix
String to add to the beginning of each output line.
Definition: state.h:48
Text will not be reformatted.
Definition: enriched.c:55
size_t mutt_str_strlen(const char *a)
Calculate the length of a string, safely.
Definition: string.c:666
size_t line_max
Definition: enriched.c:106
FILE * fp_in
File to read from.
Definition: state.h:46
StateFlags flags
Flags, e.g. MUTT_DISPLAY.
Definition: state.h:49
wchar_t * param
Definition: enriched.c:102
static void enriched_putwc(wchar_t c, struct EnrichedState *stte)
Write one wide character to the state.
Definition: enriched.c:272
int wrap_margin
Definition: enriched.c:113
int tag_level[RICH_MAX]
Definition: enriched.c:112
LOFF_T length
length (in bytes) of attachment
Definition: body.h:45
struct MuttWindow * MuttIndexWindow
Index Window.
Definition: mutt_window.c:39
static void enriched_flush(struct EnrichedState *stte, bool wrap)
Write enriched text to the State.
Definition: enriched.c:236
size_t indent_len
Definition: enriched.c:107
#define state_puts(str, state)
Definition: state.h:54
size_t param_len
Definition: enriched.c:111
#define state_putc(str, state)
Definition: state.h:55
#define FREE(x)
Definition: memory.h:40
wchar_t * line
Definition: enriched.c:101
size_t param_used
Definition: enriched.c:110
struct State * s
Definition: enriched.c:114
static void enriched_set_flags(const wchar_t *tag, struct EnrichedState *stte)
Set flags on the enriched text state.
Definition: enriched.c:371
wchar_t * buffer
Definition: enriched.c:100

Variable Documentation

const struct Etags EnrichedTags[]
static
Initial value:
= {
{ L"param", RICH_PARAM },
{ L"bold", RICH_BOLD },
{ L"italic", RICH_ITALIC },
{ L"underline", RICH_UNDERLINE },
{ L"nofill", RICH_NOFILL },
{ L"excerpt", RICH_EXCERPT },
{ L"indent", RICH_INDENT },
{ L"indentright", RICH_INDENT_RIGHT },
{ L"center", RICH_CENTER },
{ L"flushleft", RICH_FLUSHLEFT },
{ L"flushright", RICH_FLUSHRIGHT },
{ L"flushboth", RICH_FLUSHLEFT },
{ L"color", RICH_COLOR },
{ L"x-color", RICH_COLOR },
{ NULL, -1 },
}
Centred text.
Definition: enriched.c:59
Text will not be reformatted.
Definition: enriched.c:55
Left-justified text.
Definition: enriched.c:60
Italic text.
Definition: enriched.c:54
Right-justified text.
Definition: enriched.c:61
Coloured text.
Definition: enriched.c:62
Parameter label.
Definition: enriched.c:51
Indented text.
Definition: enriched.c:56
Underlined text.
Definition: enriched.c:53
Excerpt text.
Definition: enriched.c:58
Right-indented text.
Definition: enriched.c:57
Bold text.
Definition: enriched.c:52

Definition at line 76 of file enriched.c.