1 |
< |
/* Copyright (c) 1990 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1991 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
27 |
|
|
28 |
|
int expand = 0; /* boolean true to expand commands */ |
29 |
|
|
30 |
+ |
char *newmod = NULL; /* new modifier for surfaces */ |
31 |
+ |
|
32 |
|
char *idprefix = NULL; /* prefix for object identifiers */ |
33 |
|
|
34 |
|
#define ALIAS NUMOTYPE /* put alias at end of array */ |
46 |
|
double *farg; /* float arguments */ |
47 |
|
} FUNARGS; |
48 |
|
|
49 |
< |
#define MAXSTR 512 /* maximum string length */ |
49 |
> |
#define MAXSTR 128 /* maximum string length */ |
50 |
|
|
51 |
|
FUNARGS *getfargs(); |
52 |
|
char *malloc(); |
71 |
|
for (a = 1; a < argc; a++) { |
72 |
|
if (argv[a][0] == '-') |
73 |
|
switch (argv[a][1]) { |
74 |
+ |
case 'm': |
75 |
+ |
if (argv[a][2] || a+1 >= argc) |
76 |
+ |
break; |
77 |
+ |
newmod = argv[++a]; |
78 |
+ |
continue; |
79 |
|
case 'n': |
80 |
|
if (argv[a][2] || a+1 >= argc) |
81 |
|
break; |
235 |
|
char *fname; |
236 |
|
FILE *fin; |
237 |
|
{ |
238 |
< |
char stmp[MAXSTR]; |
238 |
> |
char typ[16], nam[MAXSTR]; |
239 |
|
int fn; |
240 |
< |
|
241 |
< |
fscanf(fin, "%s", stmp); /* modifier */ |
242 |
< |
printf("\n%s ", stmp); |
236 |
< |
fscanf(fin, "%s", stmp); /* object type */ |
237 |
< |
if ((fn = otype(stmp)) < 0) { |
240 |
> |
/* modifier and type */ |
241 |
> |
fscanf(fin, "%s %s", nam, typ); |
242 |
> |
if ((fn = otype(typ)) < 0) { |
243 |
|
fprintf(stderr, "%s: (%s): unknown object type \"%s\"\n", |
244 |
< |
progname, fname, stmp); |
244 |
> |
progname, fname, typ); |
245 |
|
exit(1); |
246 |
|
} |
247 |
< |
printf("%s ", stmp); |
248 |
< |
fscanf(fin, "%s", stmp); /* object name */ |
247 |
> |
printf("\n%s %s ", newmod!=NULL && issurface(fn) ? newmod : nam, typ); |
248 |
> |
/* object name */ |
249 |
> |
fscanf(fin, "%s", nam); |
250 |
|
if (idprefix != NULL && issurface(fn)) |
251 |
< |
printf("%s.%s\n", idprefix, stmp); |
251 |
> |
printf("%s.%s\n", idprefix, nam); |
252 |
|
else |
253 |
< |
printf("%s\n", stmp); |
254 |
< |
/* transform arguments */ |
253 |
> |
printf("%s\n", nam); |
254 |
> |
/* transform arguments */ |
255 |
|
if ((*ofun[fn].funp)(fin) < 0) { |
256 |
|
fprintf(stderr, "%s: (%s): bad %s \"%s\"\n", |
257 |
< |
progname, fname, ofun[fn].funame, stmp); |
257 |
> |
progname, fname, ofun[fn].funame, nam); |
258 |
|
exit(1); |
259 |
|
} |
260 |
|
} |