--- ray/src/meta/mt160l.c 2003/02/22 02:07:26 1.1 +++ ray/src/meta/mt160l.c 2003/11/15 02:13:37 1.4 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: mt160l.c,v 1.1 2003/02/22 02:07:26 greg Exp $"; +static const char RCSid[] = "$Id: mt160l.c,v 1.4 2003/11/15 02:13:37 schorsch Exp $"; #endif /* * Program to print meta-files on a dot-matrix printer @@ -41,17 +41,12 @@ static const char RCSid[] = "$Id: mt160l.c,v 1.1 2003/ #define XCOM "pexpand +vOCIsp %s | psort -Y +x" - - +#include "rtprocess.h" #include "meta.h" - #include "plot.h" - #include "span.h" - - char *progname; struct span outspan; @@ -91,42 +86,29 @@ static short condonly = FALSE, conditioned = FALSE; -main(argc, argv) - -int argc; -char **argv; - +int +main( + int argc, + char **argv +) { FILE *fp; -#ifdef UNIX - FILE *popen(); -#endif char comargs[200], command[300]; -#ifdef CPM - fixargs("mt160l", &argc, &argv); -#endif - progname = *argv++; argc--; condonly = FALSE; -#ifdef CPM - conditioned = TRUE; -#else conditioned = FALSE; -#endif while (argc && **argv == '-') { switch (*(*argv+1)) { -#ifdef UNIX case 'c': condonly = TRUE; break; case 'r': conditioned = TRUE; break; -#endif default: error(WARNING, "unknown option"); break; @@ -159,7 +141,6 @@ char **argv; argc--; } sprintf(command, XCOM, comargs); -#ifdef UNIX if (condonly) return(system(command)); else { @@ -172,62 +153,45 @@ char **argv; nextpage(); fputs(PUNINIT, stdout); } -#endif } - return(0); - } +} - - - - - -thispage() /* rewind and initialize current page */ - +void +thispage(void) /* rewind and initialize current page */ { - if (lineno) error(USER, "cannot restart page in thispage"); - } - - -nextpage() /* advance to next page */ - +void +nextpage(void) /* advance to next page */ { - fputs("\f\r", stdout); lineno = 0; - } - - -contpage() /* continue new plot on current page */ - +void +contpage(void) /* continue new plot on current page */ { while (lineno++ < NLINES) putc('\n', stdout); lineno = 0; - } - -printspan() /* output span to printer */ - +void +printspan(void) /* output span to printer */ { register unsigned shiftreg; unsigned short outc; - register k; + register int k; unsigned short offset, mask; int i,j; @@ -269,17 +233,13 @@ printspan() /* output span to printer */ } putc('\n', stdout); lineno++; - } - - - -printstr(p) /* output a string to the printer */ - -PRIMITIVE *p; - +void +printstr( /* output a string to the printer */ + PRIMITIVE *p +) { int i;