1 |
< |
/* Copyright (c) 1992 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1995 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
173 |
|
char *name; |
174 |
|
register FILE *fin; |
175 |
|
{ |
176 |
+ |
int nobjs = 0; |
177 |
|
register int c; |
178 |
|
|
179 |
|
while ((c = getc(fin)) != EOF) { |
189 |
|
} else if (c == '!') { /* command */ |
190 |
|
ungetc(c, fin); |
191 |
|
xfcomm(name, fin); |
192 |
+ |
nobjs++; |
193 |
|
} else { /* object */ |
194 |
|
ungetc(c, fin); |
195 |
|
xfobject(name, fin); |
196 |
+ |
nobjs++; |
197 |
|
} |
198 |
|
} |
199 |
+ |
if (nobjs == 0) |
200 |
+ |
fprintf(stderr, "%s: (%s): warning - empty file\n", |
201 |
+ |
progname, name); |
202 |
|
} |
203 |
|
|
204 |
|
|
407 |
|
m_dielectric(fin) /* transform arguments for dielectric */ |
408 |
|
FILE *fin; |
409 |
|
{ |
404 |
– |
double pow(); |
410 |
|
FUNARGS fa; |
411 |
|
|
412 |
|
if (readfargs(&fa, fin) != 1) |
427 |
|
m_interface(fin) /* transform arguments for interface */ |
428 |
|
FILE *fin; |
429 |
|
{ |
425 |
– |
double pow(); |
430 |
|
FUNARGS fa; |
431 |
|
|
432 |
|
if (readfargs(&fa, fin) != 1) |
642 |
|
|
643 |
|
initotypes() /* initialize ofun[] array */ |
644 |
|
{ |
641 |
– |
extern int o_source(); |
642 |
– |
extern int o_sphere(); |
643 |
– |
extern int o_face(); |
644 |
– |
extern int o_cone(); |
645 |
– |
extern int o_cylinder(); |
646 |
– |
extern int o_ring(); |
647 |
– |
extern int m_glow(); |
648 |
– |
extern int m_spot(); |
649 |
– |
extern int m_dielectric(); |
650 |
– |
extern int m_interface(); |
651 |
– |
extern int text(); |
652 |
– |
extern int alias(); |
653 |
– |
extern int passargs(); |
654 |
– |
extern int addxform(); |
645 |
|
register int i; |
646 |
|
|
647 |
|
if (ofun[OBJ_SOURCE].funp == o_source) |
673 |
|
ofun[MIX_TEXT].funp = text; |
674 |
|
ofun[ALIAS].funp = alias; |
675 |
|
/* surface inverses */ |
676 |
+ |
tinvers[OBJ_FACE] = OBJ_FACE; |
677 |
|
tinvers[OBJ_SOURCE] = OBJ_SOURCE; |
678 |
|
tinvers[OBJ_CONE] = OBJ_CUP; |
679 |
|
tinvers[OBJ_CUP] = OBJ_CONE; |