ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cv/mgflib/mgfilt.c
Revision: 1.1
Committed: Tue Jun 21 14:45:45 1994 UTC (29 years, 10 months ago) by greg
Content type: text/plain
Branch: MAIN
Log Message:
Initial revision

File Contents

# User Rev Content
1 greg 1.1 /* Copyright (c) 1994 Regents of the University of California */
2    
3     #ifndef lint
4     static char SCCSid[] = "$SunId$ LBL";
5     #endif
6    
7     /*
8     * Filter MGF stream, removing entities that won't be understood
9     */
10    
11     #include <stdio.h>
12     #include "parser.h"
13    
14    
15     int
16     put_entity(ac, av) /* general output routine */
17     register int ac;
18     register char **av;
19     {
20     while (ac-- > 0) {
21     fputs(*av++, stdout);
22     putchar(ac ? ' ' : '\n');
23     }
24     return(MG_OK);
25     }
26    
27    
28     main(argc, argv) /* arguments are understood entities */
29     int argc;
30     char **argv;
31     {
32     int i, en;
33    
34     for (i = 1; i < argc; i++) {
35     en = mg_entity(argv[i]);
36     if (en < 0) {
37     fprintf(stderr, "%s: %s: no such entity\n",
38     argv[0], argv[i]);
39     exit(1);
40     }
41     mg_ehand[en] = put_entity;
42     }
43     mg_init();
44     en = mg_load((char *)NULL);
45     exit(en != MG_OK);
46     }