--- ray/src/util/getinfo.c 1992/09/21 12:13:25 2.2 +++ ray/src/util/getinfo.c 2003/02/22 02:07:30 2.5 @@ -1,9 +1,6 @@ -/* Copyright (c) 1992 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: getinfo.c,v 2.5 2003/02/22 02:07:30 greg Exp $"; #endif - /* * getinfo.c - program to read info. header from file. * @@ -14,11 +11,13 @@ static char SCCSid[] = "$SunId$ LBL"; #ifdef MSDOS #include +extern int _fmode; #endif extern int fputs(); +int tabstr(s) /* put out line followed by tab */ register char *s; { @@ -28,12 +27,13 @@ register char *s; } if (*--s == '\n') putchar('\t'); + return(0); } main(argc, argv) int argc; -char *argv[]; +char **argv; { int dim = 0; FILE *fp; @@ -42,12 +42,15 @@ char *argv[]; if (argc > 1 && !strcmp(argv[1], "-d")) { argc--; argv++; dim = 1; +#ifdef MSDOS + setmode(fileno(stdin), _fmode = O_BINARY); +#endif } else if (argc == 2 && !strcmp(argv[1], "-")) { #ifdef MSDOS setmode(fileno(stdin), O_BINARY); setmode(fileno(stdout), O_BINARY); #endif - getheader(stdin, NULL); + getheader(stdin, NULL, NULL); copycat(); exit(0); } @@ -84,7 +87,7 @@ register FILE *fp; int j; register int c; - getheader(fp, NULL); /* skip header */ + getheader(fp, NULL, NULL); /* skip header */ switch (c = getc(fp)) { case '+': /* picture */ @@ -116,7 +119,7 @@ register FILE *fp; copycat() /* copy input to output */ { register int c; - + while ((c = getchar()) != EOF) putchar(c); }