9 |
|
|
10 |
|
#include <stdlib.h> |
11 |
|
#include "platform.h" |
12 |
+ |
#include "paths.h" |
13 |
|
#include "rtio.h" |
14 |
|
#include "rtmath.h" |
15 |
|
#include "normcodec.h" |
16 |
|
|
16 |
– |
char *progname; /* set in main() */ |
17 |
|
|
18 |
– |
|
18 |
|
/* Report usage error and exit */ |
19 |
|
static void |
20 |
|
usage_exit(int code) |
224 |
|
int unbuffered = 0; |
225 |
|
NORMCODEC nc; |
226 |
|
int a; |
227 |
< |
|
228 |
< |
progname = argv[0]; |
227 |
> |
/* set global progname */ |
228 |
> |
fixargv0(argv[0]); |
229 |
|
set_nc_defaults(&nc); |
230 |
|
nc.hdrflags = HF_ALL; |
231 |
|
for (a = 1; a < argc && argv[a][0] == '-'; a++) |
341 |
|
fputs(": cannot open for writing\n", stderr); |
342 |
|
return 1; |
343 |
|
} |
344 |
< |
SET_FILE_BINARY(dc.finp); /* starting assumption */ |
344 |
> |
SET_FILE_BINARY(nc.finp); /* starting assumption */ |
345 |
|
SET_FILE_BINARY(stdout); |
346 |
|
#ifdef getc_unlocked /* avoid stupid semaphores */ |
347 |
|
flockfile(nc.finp); |