1 |
– |
/* Copyright (c) 1986 Regents of the University of California */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* getinfo.c - program to read info. header from file. |
6 |
|
* |
9 |
|
|
10 |
|
#include <stdio.h> |
11 |
|
|
12 |
+ |
#ifdef MSDOS |
13 |
+ |
#include <fcntl.h> |
14 |
+ |
extern int _fmode; |
15 |
+ |
#endif |
16 |
+ |
|
17 |
|
extern int fputs(); |
18 |
|
|
19 |
|
|
20 |
+ |
int |
21 |
|
tabstr(s) /* put out line followed by tab */ |
22 |
|
register char *s; |
23 |
|
{ |
27 |
|
} |
28 |
|
if (*--s == '\n') |
29 |
|
putchar('\t'); |
30 |
+ |
return(0); |
31 |
|
} |
32 |
|
|
33 |
|
|
34 |
|
main(argc, argv) |
35 |
|
int argc; |
36 |
< |
char *argv[]; |
36 |
> |
char **argv; |
37 |
|
{ |
38 |
|
int dim = 0; |
39 |
|
FILE *fp; |
42 |
|
if (argc > 1 && !strcmp(argv[1], "-d")) { |
43 |
|
argc--; argv++; |
44 |
|
dim = 1; |
45 |
+ |
#ifdef MSDOS |
46 |
+ |
setmode(fileno(stdin), _fmode = O_BINARY); |
47 |
+ |
#endif |
48 |
|
} else if (argc == 2 && !strcmp(argv[1], "-")) { |
49 |
< |
getheader(stdin, NULL); |
49 |
> |
#ifdef MSDOS |
50 |
> |
setmode(fileno(stdin), O_BINARY); |
51 |
> |
setmode(fileno(stdout), O_BINARY); |
52 |
> |
#endif |
53 |
> |
getheader(stdin, NULL, NULL); |
54 |
|
copycat(); |
55 |
|
exit(0); |
56 |
|
} |
87 |
|
int j; |
88 |
|
register int c; |
89 |
|
|
90 |
< |
getheader(fp, NULL); /* skip header */ |
90 |
> |
getheader(fp, NULL, NULL); /* skip header */ |
91 |
|
|
92 |
|
switch (c = getc(fp)) { |
93 |
|
case '+': /* picture */ |