|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T c
Length: 1377 (0x561) Types: TextFile Names: »checkdoc.c«
└─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12 └─⟦63303ae94⟧ »unix3.14/TeX3.14.tar.Z« └─⟦c58930e5c⟧ └─⟦this⟧ »TeX3.14/TeXcontrib/gnuplot/docs/checkdoc.c«
/* * checkdoc -- check a doc file for correctness of first column. * * Prints out lines that have an illegal first character. * First character must be space, digit, or ?, @, #, %, * or line must be empty. * * usage: checkdoc < docfile * Modified by Russell Lang from hlp2ms.c by Thomas Williams * * Original version by David Kotz used the following one line script! * sed -e '/^$/d' -e '/^[ 0-9?@#%]/d' gnuplot.doc * */ #include <stdio.h> #include <ctype.h> #define MAX_LINE_LEN 256 #define TRUE 1 #define FALSE 0 main() { convert(stdin,stdout); exit(0); } convert(a,b) FILE *a,*b; { static char line[MAX_LINE_LEN]; while (fgets(line,MAX_LINE_LEN,a)) { process_line(line, b); } } process_line(line, b) char *line; FILE *b; { switch(line[0]) { /* control character */ case '?': { /* interactive help entry */ break; /* ignore */ } case '@': { /* start/end table */ break; /* ignore */ } case '#': { /* latex table entry */ break; /* ignore */ } case '%': { /* troff table entry */ break; /* ignore */ } case '\n': /* empty text line */ case ' ': { /* normal text line */ break; } default: { if (isdigit(line[0])) { /* start of section */ /* ignore */ } else fputs(line,b); /* output bad line */ break; } } }