46 |
|
|
47 |
|
int expand; /* expand commands? */ |
48 |
|
|
49 |
– |
char *progname; |
50 |
– |
|
49 |
|
static void convert(char *name, FILE *fin); |
50 |
|
static void cvcomm(char *fname, FILE *fin); |
51 |
|
static void cvobject(char *fname, FILE *fin); |
64 |
|
FILE *fp; |
65 |
|
int i, j; |
66 |
|
|
67 |
< |
progname = argv[0]; |
67 |
> |
fixargv0(argv[0]); /* sets global progname */ |
68 |
|
i = 1; |
69 |
|
while (i < argc && argv[i][0] == '-') { |
70 |
|
do { |
137 |
|
void |
138 |
|
convert( /* replace marks in a stream */ |
139 |
|
char *name, |
140 |
< |
register FILE *fin |
140 |
> |
FILE *fin |
141 |
|
) |
142 |
|
{ |
143 |
< |
register int c; |
143 |
> |
int c; |
144 |
|
|
145 |
|
while ((c = getc(fin)) != EOF) { |
146 |
|
if (isspace(c)) /* blank */ |
170 |
|
) |
171 |
|
{ |
172 |
|
FILE *pin; |
173 |
< |
char buf[512], *fgetline(); |
173 |
> |
char buf[512]; |
174 |
|
|
175 |
|
fgetline(buf, sizeof(buf), fin); |
176 |
|
if (expand) { |
181 |
|
exit(1); |
182 |
|
} |
183 |
|
convert(buf, pin); |
184 |
< |
if (pclose(pin) != 0) { |
184 |
> |
if (pclose(pin) != 0) |
185 |
|
fprintf(stderr, |
186 |
< |
"%s: (%s): bad status from \"%s\"\n", |
186 |
> |
"%s: (%s): warning - bad status from \"%s\"\n", |
187 |
|
progname, fname, buf); |
190 |
– |
exit(1); |
191 |
– |
} |
188 |
|
} else |
189 |
|
printf("\n%s\n", buf); |
190 |
|
} |
196 |
|
FILE *fin |
197 |
|
) |
198 |
|
{ |
203 |
– |
extern char *fgetword(); |
199 |
|
char buf[128], typ[16], nam[128]; |
200 |
|
int i, n; |
201 |
< |
register int j; |
201 |
> |
int j; |
202 |
|
|
203 |
|
if (fgetword(buf, sizeof(buf), fin) == NULL || |
204 |
|
fgetword(typ, sizeof(typ), fin) == NULL || |
243 |
|
void |
244 |
|
replace( /* replace marker */ |
245 |
|
char *fname, |
246 |
< |
register struct mrkr *m, |
246 |
> |
struct mrkr *m, |
247 |
|
char *mark, |
248 |
|
FILE *fin |
249 |
|
) |
297 |
|
|
298 |
|
int |
299 |
|
buildxf( /* build transform for marker */ |
300 |
< |
register char *xf, |
300 |
> |
char *xf, |
301 |
|
double markscale, |
302 |
|
FILE *fin |
303 |
|
) |
307 |
|
FVECT xvec, yvec, zvec; |
308 |
|
double xlen; |
309 |
|
int n; |
310 |
< |
register int i; |
310 |
> |
int i; |
311 |
|
/* |
312 |
|
* Read and sort vectors: longest is hypotenuse, |
313 |
|
* second longest is x' axis, |
380 |
|
|
381 |
|
int |
382 |
|
addrot( /* compute rotation (x,y,z) => (xp,yp,zp) */ |
383 |
< |
register char *xf, |
383 |
> |
char *xf, |
384 |
|
FVECT xp, |
385 |
|
FVECT yp, |
386 |
|
FVECT zp |