]>
diplodocus.org Git - nmh/blob - docs/historical/mh-6.8.5/miscellany/multi-media/misc/rt2raw.c
1 /* taken straight from the MIME specification, to use with multi-media MH, do:
3 mhn-show-text/richtext: rt2raw < %f | fmt -78 | more
7 Note that MTR doesn't use this program. He uses NB's richtext program
8 instead (the one that comes with MetaMail). See RICHTEXT.setup for the
18 while((c
= getc(stdin
)) != EOF
) {
20 for (i
=0; (c
= getc(stdin
)) != '>'
22 token
[i
] = isupper(c
) ? tolower(c
) : c
;
26 if (!strcmp(token
, "lt")) {
28 } else if (!strcmp(token
, "nl")) {
30 } else if (!strcmp(token
, "/paragraph")) {
32 } else if (!strcmp(token
, "comment")) {
35 while ((c
= getc(stdin
)) != '<'
38 for (i
=0; (c
= getc(stdin
)) != '>'
40 token
[i
] = isupper(c
) ?
45 if (!strcmp(token
, "/comment")) --commct
;
46 if (!strcmp(token
, "comment")) ++commct
;
48 } /* Ignore all other tokens */
49 } else if (c
!= '\n') {
51 } else putc (' ', stdout
);
53 putc('\n', stdout
); /* for good measure */