6 |
|
*/ |
7 |
|
|
8 |
|
#include <string.h> |
9 |
– |
|
9 |
|
#include "platform.h" |
10 |
|
#include "rterror.h" |
11 |
|
#include "rholo.h" |
12 |
|
|
14 |
– |
char *progname; /* our program name */ |
13 |
|
char *hdkfile; /* holodeck file name */ |
14 |
|
char gargc; /* global argc */ |
15 |
|
char **gargv; /* global argv */ |
48 |
|
int i, rval; |
49 |
|
|
50 |
|
gargc = argc; gargv = argv; |
51 |
< |
progname = argv[0]; /* get arguments */ |
51 |
> |
fixargv0(argv[0]); /* get arguments */ |
52 |
|
for (i = 1; i < argc && argv[i][0] == '-'; i++) { |
53 |
|
rval = getviewopt(&myview, argc-i, argv+i); |
54 |
|
if (rval >= 0) { /* view option */ |
214 |
|
/* prepare output */ |
215 |
|
if (outspec != NULL) { |
216 |
|
sprintf(fname, outspec, fn); |
217 |
< |
if (freopen(fname, "w", stdout) == NULL) { |
217 |
> |
if (freopen(fname, "wb", stdout) == NULL) { |
218 |
|
sprintf(errmsg, "cannot open output \"%s\"", fname); |
219 |
|
error(SYSTEM, errmsg); |
220 |
|
} |
228 |
|
fputs(VIEWSTR, stdout); |
229 |
|
fprintview(&myview, stdout); |
230 |
|
fputc('\n', stdout); |
231 |
< |
if ((pa < 0.99) | (pa > 1.01)) |
231 |
> |
if ((pa < 0.995) | (pa > 1.005)) |
232 |
|
fputaspect(pa, stdout); |
233 |
|
if ((expval < 0.99) | (expval > 1.01)) |
234 |
|
fputexpos(expval, stdout); |
285 |
|
int n; |
286 |
|
off_t nextloc; |
287 |
|
/* open holodeck file */ |
288 |
< |
if ((fp = fopen(hdkfile, "r")) == NULL) { |
288 |
> |
if ((fp = fopen(hdkfile, "rb")) == NULL) { |
289 |
|
sprintf(errmsg, "cannot open \"%s\" for reading", hdkfile); |
290 |
|
error(SYSTEM, errmsg); |
291 |
|
} |
315 |
|
|
316 |
|
|
317 |
|
void |
318 |
< |
eputs(s) /* put error message to stderr */ |
321 |
< |
char *s; |
318 |
> |
eputs(const char *s) /* put error message to stderr */ |
319 |
|
{ |
320 |
|
static int midline = 0; |
321 |
|
|