1 |
< |
/* Copyright (c) 1991 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1992 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
11 |
|
*/ |
12 |
|
|
13 |
|
#include <stdio.h> |
14 |
+ |
#ifdef MSDOS |
15 |
+ |
#include <fcntl.h> |
16 |
+ |
#endif |
17 |
|
|
18 |
|
#include "color.h" |
19 |
|
#include "resolu.h" |
20 |
|
|
21 |
< |
#define NCOLS 1440 /* 8" at 180 dpi */ |
21 |
> |
#define NCOLS 1440 /* 8" at 180 dpi */ |
22 |
|
|
23 |
|
|
24 |
|
main(argc, argv) |
26 |
|
char *argv[]; |
27 |
|
{ |
28 |
|
int i, status = 0; |
29 |
< |
|
29 |
> |
#ifdef MSDOS |
30 |
> |
extern int _fmode; |
31 |
> |
_fmode = O_BINARY; |
32 |
> |
setmode(fileno(stdin), O_BINARY); |
33 |
> |
setmode(fileno(stdout), O_BINARY); |
34 |
> |
#endif |
35 |
|
if (argc < 2) |
36 |
|
status = printp(NULL) == -1; |
37 |
|
else |
121 |
|
register int a; |
122 |
|
{ |
123 |
|
static int cerr[NCOLS][3]; |
124 |
< |
static int err[3], errp[3]; |
125 |
< |
int b; |
124 |
> |
static int err[3]; |
125 |
> |
int b, errp; |
126 |
|
register int ison; |
127 |
|
|
128 |
|
b = col[a]; |
129 |
< |
errp[a] = err[a]; |
129 |
> |
errp = err[a]; |
130 |
|
err[a] += b + cerr[x][a]; |
131 |
|
ison = err[a] > 128; |
132 |
|
if (ison) err[a] -= 256; |
133 |
|
err[a] /= 3; |
134 |
< |
cerr[x][a] = err[a] + errp[a]; |
134 |
> |
cerr[x][a] = err[a] + errp; |
135 |
|
return(ison); |
136 |
|
} |