--- ray/src/px/mt160r.c 1991/11/11 14:01:28 1.9 +++ ray/src/px/mt160r.c 2003/02/22 02:07:27 2.6 @@ -1,9 +1,6 @@ -/* Copyright (c) 1991 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,11 +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) @@ -24,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 @@ -41,7 +47,7 @@ char *fname; int xres, yres; COLR scanline[NCOLS]; int i; - + if (fname == NULL) { input = stdin; fname = ""; @@ -110,6 +116,7 @@ int y; } putchar('\r'); putchar('\n'); + fflush(stdout); } } @@ -119,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);