/* * rnofix -- Fix table file for runoff */ /*)BUILD $(TKBOPTIONS) = { TASK = ...FIX } */ #ifdef DOCUMENTATION title fixrno Fix table file for Runoff index Fix table file for Runoff synopsis fixrno output.fil description fixrno is used to scan the output of getkwk or similar programs that build tables for input to runoff. It scans the input text, marking all runoff formatting characters. bugs diagnostics author Martin Minow #endif #include #define EOS 0 char line[513]; main() { register char c; register char *lp; while (gets(line) != NULL) { for (lp = line; (c = *lp++) != EOS;) { switch (c) { case '.': if (lp > &line[1]) break; case '_': case '%': case '&': case '\\': case '^': case '#': putchar('_'); default: break; } putchar(c); } putchar('\n'); } }