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

Comparing ray/src/meta/imagew.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 46 | Line 46 | static const char      RCSid[] = "$Id$";
46  
47  
48  
49 <
49 > #include  "rtprocess.h"
50   #include  "meta.h"
51
51   #include  "plot.h"
53
52   #include  "span.h"
53  
54  
55 + static int flipbyte(register int  b);
56 + static void pinit(void);
57 + static void pclear(void);
58 + static void puninit(void);
59  
60  
61   char  *progname;
# Line 95 | Line 97 | static short  condonly = FALSE,
97                conditioned = FALSE;
98  
99  
100 < main(argc, argv)
100 > int
101 > main(
102 > int  argc,
103 > char  **argv
104 > )
105  
100 int  argc;
101 char  **argv;
102
106   {
107   FILE  *fp;
105 #ifdef  UNIX
106 FILE  *popen();
107 #endif
108   char  comargs[200], command[300];
109  
110 #ifdef  CPM
111 fixargs("imagew", &argc, &argv);
112 #endif
113
110   progname = *argv++;
111   argc--;
112  
113   condonly = FALSE;
118 #ifdef  UNIX
114   conditioned = FALSE;
120 #else
121 conditioned = TRUE;
122 #endif
115  
116   while (argc && **argv == '-')  {
117      switch (*(*argv+1))  {
126 #ifdef  UNIX
118         case 'c':
119            condonly = TRUE;
120            break;
121         case 'r':
122            conditioned = TRUE;
123            break;
133 #endif
124         default:
125            error(WARNING, "unknown option");
126            break;
# Line 163 | Line 153 | char  **argv;
153         argc--;
154         }
155      sprintf(command, XCOM, comargs);
166 #ifdef  UNIX
156      if (condonly)
157         return(system(command));
158      else  {
# Line 176 | Line 165 | char  **argv;
165             nextpage();
166         puninit();
167         }
179 #endif
168      }
169  
170   return(0);
171   }
172  
173  
174 <
175 <
188 <
189 <
190 < thispage()              /* rewind and initialize current page */
191 <
174 > void
175 > thispage(void)          /* rewind and initialize current page */
176   {
193
177      if (lineno != 0) {
178          fputs(LFREV, stdout);
179          while (lineno) {
# Line 199 | Line 182 | thispage()             /* rewind and initialize current page */
182          }
183          fputs(LFNORM, stdout);
184      }
202
185   }
186  
187  
188 <
189 <
208 < nextpage()              /* advance to next page */
209 <
188 > void
189 > nextpage(void)          /* advance to next page */
190   {
191  
192      fputs("\f\r", stdout);
# Line 216 | Line 196 | nextpage()             /* advance to next page */
196   }
197  
198  
199 <
200 < contpage()              /* continue on this page */
221 <
199 > void
200 > contpage(void)          /* continue on this page */
201   {
202  
203      while (lineno++ < NLINES)
# Line 229 | Line 208 | contpage()             /* continue on this page */
208   }
209  
210  
211 <
212 < printspan()             /* output span to printer */
234 <
211 > void
212 > printspan(void)         /* output span to printer */
213   {
214      register int  i;
215  
# Line 259 | Line 237 | printspan()            /* output span to printer */
237  
238  
239   int
240 < flipbyte(b)             /* flip an 8-bit byte end-to-end */
241 <
242 < register int  b;
265 <
240 > flipbyte(               /* flip an 8-bit byte end-to-end */
241 >    register int  b
242 > )
243   {
244      register int  i, a = 0;
245  
# Line 277 | Line 254 | register int  b;
254   }
255  
256  
257 + void
258 + printstr(               /* output a string to the printer */
259 +    PRIMITIVE  *p
260 + )
261  
281
282 printstr(p)             /* output a string to the printer */
283
284 PRIMITIVE  *p;
285
262   {
263  
264      fprintf(stdout, "%s%4d", PTAB, CONV(p->xy[XMN], dxsize));
# Line 296 | Line 272 | PRIMITIVE  *p;
272      fputs(p->args, stdout);
273      fputs(PNORM, stdout);
274      putc('\r', stdout);
299
275   }
276  
277  
278 <
279 < pinit()                         /* initialize printer for output */
278 > void
279 > pinit(void)                             /* initialize printer for output */
280   {
281      pclear();
282                                  /* get eighth bit */
# Line 312 | Line 287 | pinit()                                /* initialize printer for output */
287   }
288  
289  
290 < puninit()                       /* uninitialize printer */
290 > void
291 > puninit(void)                   /* uninitialize printer */
292   {
293      pclear();
294   }
295  
296  
297 < pclear()                        /* clear printer and sleep */
298 <
297 > void
298 > pclear(void)                    /* clear printer and sleep */
299   {
300      register int  i, j;
301  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines