⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rt2raw.c

📁 早期freebsd实现
💻 C
字号:
/* taken straight from the MIME specification, to use with multi-media MH, do:	mhn-show-text/richtext: rt2raw < %f | fmt -78 | more   in your .mhn_profile.   Note that MTR doesn't use this program.  He uses NB's richtext program   instead (the one that comes with MetaMail).  See RICHTEXT.setup for the   details. */#include <stdio.h>#include <ctype.h>main() {    int c, i;    char token[50];    while((c = getc(stdin)) != EOF) {        if (c == '<') {            for (i=0; (c = getc(stdin)) != '>'                      && c != EOF; ++i) {                token[i] = isupper(c) ? tolower(c) : c;            }            if (c == EOF) break;            token[i] = NULL;            if (!strcmp(token, "lt")) {                putc('<', stdout);            } else if (!strcmp(token, "nl")) {                putc('\n', stdout);            } else if (!strcmp(token, "/paragraph")) {                puts("\n\n", stdout);            } else if (!strcmp(token, "comment")) {                int commct=1;                while (commct > 0) {                    while ((c = getc(stdin)) != '<'                     && c != EOF) ;                    if (c == EOF) break;                    for (i=0; (c = getc(stdin)) != '>'                       && c != EOF; ++i) {                        token[i] = isupper(c) ?                         tolower(c) : c;                    }                    if (c== EOF) break;                    token[i] = NULL;                    if (!strcmp(token, "/comment")) --commct;                    if (!strcmp(token, "comment"))  ++commct;                }            } /* Ignore all other tokens */        } else if (c != '\n') {            putc(c, stdout);        }    }    putc('\n', stdout); /* for good measure */    exit(0);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -