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 |
|
* ttyimage.c - program to dump pixel file to dumb terminal. |
6 |
|
* |
8 |
|
*/ |
9 |
|
|
10 |
|
#include <stdio.h> |
11 |
+ |
#ifdef MSDOS |
12 |
+ |
#include <fcntl.h> |
13 |
+ |
#endif |
14 |
+ |
#include <time.h> |
15 |
|
|
16 |
|
#include "color.h" |
17 |
+ |
#include "resolu.h" |
18 |
|
|
19 |
|
|
20 |
< |
#define NCOLS 133 |
20 |
> |
#define NCOLS 133 |
21 |
|
|
22 |
|
|
23 |
|
main(argc, argv) |
35 |
|
fprintf(stderr, "%s: can't open file \"%s\"\n", argv[0], argv[1]); |
36 |
|
exit(1); |
37 |
|
} |
38 |
< |
|
38 |
> |
#ifdef MSDOS |
39 |
> |
setmode(fileno(input), O_BINARY); |
40 |
> |
#endif |
41 |
|
/* get picture dimensions */ |
42 |
|
if (checkheader(input, COLRFMT, NULL) < 0 || |
43 |
< |
fgetresolu(&xres, &yres, input) != (YMAJOR|YDECR)) { |
43 |
> |
fgetresolu(&xres, &yres, input) < 0) { |
44 |
|
fprintf(stderr, "%s: bad picture format\n", argv[0]); |
45 |
|
exit(1); |
46 |
|
} |
68 |
|
shade(clr) /* return character for color */ |
69 |
|
COLR clr; |
70 |
|
{ |
71 |
< |
#define NSHADES 13 |
71 |
> |
#define NSHADES 13 |
72 |
|
|
73 |
|
static char shadech[NSHADES+1] = " .,:;+?%&*$@#"; |
74 |
|
|