--- ray/src/px/mt160r.c 1991/05/06 13:14:21 1.8 +++ ray/src/px/mt160r.c 2003/02/22 02:07:27 2.6 @@ -1,9 +1,6 @@ -/* Copyright (c) 1986 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: mt160r.c,v 2.6 2003/02/22 02:07:27 greg Exp $"; #endif - /* * mt160r.c - program to dump pixel file to Mannesman-Tally 160. * @@ -11,10 +8,15 @@ static char SCCSid[] = "$SunId$ LBL"; */ #include +#ifdef MSDOS +#include +#endif +#include #include "color.h" +#include "resolu.h" -#define NCOLS 880 /* for wide carriage */ +#define NCOLS 880 /* for wide carriage */ main(argc, argv) @@ -23,7 +25,12 @@ char *argv[]; { int i; int status = 0; - +#ifdef MSDOS + extern int _fmode; + _fmode = O_BINARY; + setmode(fileno(stdin), O_BINARY); + setmode(fileno(stdout), O_BINARY); +#endif if (argc < 2) status += printp(NULL) == -1; else @@ -40,7 +47,7 @@ char *fname; int xres, yres; COLR scanline[NCOLS]; int i; - + if (fname == NULL) { input = stdin; fname = ""; @@ -54,7 +61,7 @@ char *fname; return(-1); } /* get picture dimensions */ - if (fgetresolu(&xres, &yres, input) != (YMAJOR|YDECR)) { + if (fgetresolu(&xres, &yres, input) < 0) { fprintf(stderr, "%s: bad picture size\n", fname); return(-1); } @@ -109,6 +116,7 @@ int y; } putchar('\r'); putchar('\n'); + fflush(stdout); } } @@ -118,8 +126,8 @@ COLR clr; register int x; { static int cerr[NCOLS]; - static int err, errp; - int b; + static int err; + int b, errp; register int isblack; b = normbright(clr);