Artifact 644c0fa1631bf40f29c872a4f6834c39ab3bcf2a50470c175348e491fbb18113:
- File
r34.1/plot/docs/checkdoc.c
— part of check-in
[f2fda60abd]
at
2011-09-02 18:13:33
on branch master
— Some historical releases purely for archival purposes
git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1375 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 1479) [annotate] [blame] [check-ins using] [more...]
#ifndef lint static char *RCSid = "$Id: checkdoc.c,v 3.26 1992/03/25 04:53:29 woo Exp woo $"; #endif /* * 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; } } }