ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/meta/impress.c
(Generate patch)

Comparing ray/src/meta/impress.c (file contents):
Revision 1.1 by greg, Sat Feb 22 02:07:26 2003 UTC vs.
Revision 1.4 by schorsch, Sat Nov 15 02:13:37 2003 UTC

# Line 9 | Line 9 | static const char      RCSid[] = "$Id$";
9   */
10  
11  
12 + #include  "rtprocess.h"
13   #include  "meta.h"
13
14   #include  "imPcodes.h"
15
15   #include  "imPfuncs.h"
16 + #include  "plot.h"
17  
18  
19   #define  XCOM  "pexpand +OCIsv -P %s"
# Line 25 | Line 25 | FILE  *imout;
25  
26   static short  newpage = TRUE;
27  
28 + static void doprim(register PRIMITIVE  *p);
29 + static void doglobal(register PRIMITIVE  *g);
30  
31  
30 main(argc, argv)
32  
33 < int  argc;
34 < char  **argv;
33 > int
34 > main(
35 >        int  argc,
36 >        char  **argv
37 > )
38  
39   {
40   FILE  *fp;
37 #ifdef  UNIX
38 FILE  *popen();
39 #endif
41   short  condonly, conditioned;
42   char  comargs[200], command[300];
43  
43 #ifdef  CPM
44 fixargs("impress", &argc, &argv);
45 #endif
46
44   progname = *argv++;
45   argc--;
46  
47   condonly = FALSE;
51 #ifdef  UNIX
48   conditioned = FALSE;
53 #else
54 conditioned = TRUE;
55 #endif
49  
50   while (argc && **argv == '-')  {
51      switch (*(*argv+1))  {
59 #ifdef  UNIX
52         case 'c':
53            condonly = TRUE;
54            break;
55         case 'r':
56            conditioned = TRUE;
57            break;
66 #endif
58         default:
59            error(WARNING, "unknown option");
60            break;
# Line 94 | Line 85 | char  **argv;
85         argc--;
86         }
87      sprintf(command, XCOM, comargs);
97 #ifdef  UNIX
88      if (condonly)
89         return(system(command));
90      else  {
# Line 103 | Line 93 | char  **argv;
93         plot(fp);
94         pclose(fp);
95         }
106 #endif
96      }
97  
98   if (!newpage)
# Line 114 | Line 103 | char  **argv;
103   }
104  
105  
106 + void
107 + plot(           /* plot meta-file */
108 +        register FILE  *infp
109 + )
110  
118 plot(infp)              /* plot meta-file */
119
120 register FILE  *infp;
121
111   {
112      PRIMITIVE  nextp;
113  
# Line 137 | Line 126 | register FILE  *infp;
126  
127  
128  
129 + void
130 + doglobal(                       /* execute a global command */
131 +        register PRIMITIVE  *g
132 + )
133  
141
142
143 doglobal(g)                     /* execute a global command */
144
145 register PRIMITIVE  *g;
146
134   {
148    char  c;
149
135      switch (g->com) {
136  
137          case PEOF:
# Line 184 | Line 169 | register PRIMITIVE  *g;
169  
170  
171  
172 <
173 < doprim(p)               /* plot primitive */
174 <
175 < register PRIMITIVE  *p;
172 > void
173 > doprim(         /* plot primitive */
174 >        register PRIMITIVE  *p
175 > )
176  
177   {
178  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines