1 |
< |
/* Copyright (c) 1995 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1996 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
63 |
|
|
64 |
|
static int e_any_toss(), /* discard unneeded entity */ |
65 |
|
e_ies(), /* IES luminaire file */ |
66 |
– |
e_include(), /* include file */ |
67 |
– |
e_sph(), /* sphere */ |
66 |
|
e_cct(), /* color temperature */ |
67 |
|
e_cmix(), /* color mixtures */ |
68 |
< |
e_cspec(), /* color spectra */ |
68 |
> |
e_cspec(); /* color spectra */ |
69 |
> |
|
70 |
> |
int e_include(), /* include file */ |
71 |
> |
e_sph(), /* sphere */ |
72 |
|
e_cyl(), /* cylinder */ |
73 |
|
e_cone(), /* cone */ |
74 |
|
e_prism(), /* prism */ |
261 |
|
register MG_FCTXT *ctx = mg_file; |
262 |
|
|
263 |
|
mg_file = ctx->prev; /* restore enclosing context */ |
264 |
< |
if (ctx->fp == stdin) |
265 |
< |
return; /* don't close standard input */ |
265 |
< |
fclose(ctx->fp); |
264 |
> |
if (ctx->fp != stdin) /* close file if it's a file */ |
265 |
> |
fclose(ctx->fp); |
266 |
|
} |
267 |
|
|
268 |
|
|
392 |
|
mg_clear() /* clear parser history */ |
393 |
|
{ |
394 |
|
c_clearall(); /* clear context tables */ |
395 |
< |
mg_file = NULL; /* reset our context */ |
395 |
> |
while (mg_file != NULL) /* reset our file context */ |
396 |
> |
mg_close(); |
397 |
|
} |
398 |
|
|
399 |
|
|
411 |
|
} |
412 |
|
|
413 |
|
|
414 |
< |
static int |
414 |
> |
int |
415 |
|
e_include(ac, av) /* include file */ |
416 |
|
int ac; |
417 |
|
char **av; |
481 |
|
} |
482 |
|
|
483 |
|
|
484 |
< |
static int |
484 |
> |
int |
485 |
|
e_sph(ac, av) /* expand a sphere into cones */ |
486 |
|
int ac; |
487 |
|
char **av; |
533 |
|
} |
534 |
|
|
535 |
|
|
536 |
< |
static int |
536 |
> |
int |
537 |
|
e_torus(ac, av) /* expand a torus into cones */ |
538 |
|
int ac; |
539 |
|
char **av; |
625 |
|
} |
626 |
|
|
627 |
|
|
628 |
< |
static int |
628 |
> |
int |
629 |
|
e_cyl(ac, av) /* replace a cylinder with equivalent cone */ |
630 |
|
int ac; |
631 |
|
char **av; |
642 |
|
} |
643 |
|
|
644 |
|
|
645 |
< |
static int |
645 |
> |
int |
646 |
|
e_ring(ac, av) /* turn a ring into polygons */ |
647 |
|
int ac; |
648 |
|
char **av; |
740 |
|
} |
741 |
|
|
742 |
|
|
743 |
< |
static int |
743 |
> |
int |
744 |
|
e_cone(ac, av) /* turn a cone into polygons */ |
745 |
|
int ac; |
746 |
|
char **av; |
910 |
|
} |
911 |
|
|
912 |
|
|
913 |
< |
static int |
913 |
> |
int |
914 |
|
e_prism(ac, av) /* turn a prism into polygons */ |
915 |
|
int ac; |
916 |
|
char **av; |
1022 |
|
{ |
1023 |
|
static char xbuf[24], ybuf[24]; |
1024 |
|
static char *ccom[4] = {mg_ename[MG_E_CXY], xbuf, ybuf}; |
1024 |
– |
int rv; |
1025 |
|
|
1026 |
|
sprintf(xbuf, "%.4f", c_ccolor->cx); |
1027 |
|
sprintf(ybuf, "%.4f", c_ccolor->cy); |
1028 |
< |
if ((rv = mg_handle(MG_E_CXY, 3, ccom)) != MG_OK) |
1029 |
< |
return(rv); |
1030 |
< |
return(MG_OK); |
1028 |
> |
return(mg_handle(MG_E_CXY, 3, ccom)); |
1029 |
|
} |
1030 |
|
|
1031 |
|
|