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

Comparing ray/src/meta/psplot.c (file contents):
Revision 1.2 by schorsch, Sun Jul 27 22:12:02 2003 UTC vs.
Revision 1.3 by schorsch, Sat Nov 15 02:13:37 2003 UTC

# Line 7 | Line 7 | static const char      RCSid[] = "$Id$";
7   *      9/23/88
8   */
9  
10 #include "meta.h"
11
10   #include <ctype.h>
11  
12 + #include "meta.h"
13 + #include "plot.h"
14 + #include "psplot.h"
15 +
16   #ifdef SMALLAREA
17   #define HMARGIN         (0.2*72)                /* horizontal margin */
18   #define VMARGIN         (0.2*72)                /* vertical margin */
# Line 41 | Line 43 | static char    hexdigit[] = "0123456789ABCDEF";
43  
44   static char     buf[512];
45  
46 + static void endline(void);
47  
48 +
49   static char *
50   convertname(s)                          /* convert to segment name */
51   char    *s;
# Line 65 | Line 69 | char   *s;
69  
70  
71   static char *
72 < convertstring(s)                /* convert to acceptable string */
73 < register char   *s;
72 > convertstring(          /* convert to acceptable string */
73 >        register char   *s
74 > )
75   {
76          register char   *cp;
77          
# Line 87 | Line 92 | register char  *s;
92   }
93  
94  
95 < init(id)                        /* initialize */
96 < char    *id;
95 > void
96 > init(                   /* initialize */
97 >        char    *id
98 > )
99   {
100          printf("%%!PS-Adobe-2.0 EPSF-2.0\n");
101          printf("%%%%BoundingBox: %.0f %.0f %.0f %.0f\n",
# Line 219 | Line 226 | char   *id;
226   }
227  
228  
229 < done()                          /* done with graphics */
229 > void
230 > done(void)                              /* done with graphics */
231   {
232          printf("end\nrestore\ngrestore\n");
233   }
234  
235  
236 < endpage()                       /* done with page */
236 > void
237 > endpage(void)                   /* done with page */
238   {
239          checkline();
240  
# Line 233 | Line 242 | endpage()                      /* done with page */
242   }
243  
244  
245 < segopen(s)                      /* open a segment */
246 < char    *s;
245 > void
246 > segopen(                        /* open a segment */
247 >        char    *s
248 > )
249   {
250          checkline();
251  
# Line 242 | Line 253 | char   *s;
253   }
254  
255  
256 < segclose()                      /* close a segment */
256 > void
257 > segclose(void)                  /* close a segment */
258   {
259          checkline();
260  
# Line 250 | Line 262 | segclose()                     /* close a segment */
262   }
263  
264  
265 < doseg(p)                        /* instance of a segment */
266 < register PRIMITIVE      *p;
265 > void
266 > doseg(                  /* instance of a segment */
267 >        register PRIMITIVE      *p
268 > )
269   {
270          checkline();
271  
# Line 263 | Line 277 | register PRIMITIVE     *p;
277   }
278  
279  
280 < printstr(p)                     /* print a string */
281 < register PRIMITIVE      *p;
280 > extern void
281 > printstr(                       /* print a string */
282 >        register PRIMITIVE      *p
283 > )
284   {
285          checkline();
286          printf("(%s) %d %d %d %d mstr\n", convertstring(p->args),
# Line 273 | Line 289 | register PRIMITIVE     *p;
289   }
290  
291  
292 < plotvstr(p)                     /* print a vector string */
293 < register PRIMITIVE      *p;
292 > void
293 > plotvstr(                       /* print a vector string */
294 >        register PRIMITIVE      *p
295 > )
296   {
297          checkline();
298  
# Line 285 | Line 303 | register PRIMITIVE     *p;
303   }
304  
305  
306 < plotlseg(p)                     /* plot a line segment */
307 < register PRIMITIVE      *p;
306 > void
307 > plotlseg(                       /* plot a line segment */
308 >        register PRIMITIVE      *p
309 > )
310   {
311          static int      right = FALSE;
312          static int      curx, cury;
# Line 330 | Line 350 | register PRIMITIVE     *p;
350   }
351  
352  
353 < endline()                       /* close current line */
353 > void
354 > endline(void)                   /* close current line */
355   {
356          printf("stroke\n");
357          inaline = 0;
358   }
359  
360  
361 < fillrect(p)                     /* fill a rectangle */
362 < register PRIMITIVE      *p;
361 > extern void
362 > fillrect(                       /* fill a rectangle */
363 >        register PRIMITIVE      *p
364 > )
365   {
366          checkline();
367  
# Line 347 | Line 370 | register PRIMITIVE     *p;
370   }
371  
372  
373 < filltri(p)                      /* fill a triangle */
374 < register PRIMITIVE      *p;
373 > extern void
374 > filltri(                        /* fill a triangle */
375 >        register PRIMITIVE      *p
376 > )
377   {
378 <        static short    corn[4][2] = {XMN,YMX,XMN,YMN,XMX,YMN,XMX,YMX};
378 >        static short    corn[4][2] = {{XMN,YMX},{XMN,YMN},{XMX,YMN},{XMX,YMX}};
379          int             orient;
380          register int    i;
381          
# Line 366 | Line 391 | register PRIMITIVE     *p;
391   }
392  
393  
394 < xform(xp, yp, p)                /* transform a point according to p */
395 < register int  *xp, *yp;
396 < register PRIMITIVE  *p;
394 > void
395 > xform(          /* transform a point according to p */
396 >        register int  *xp,
397 >        register int  *yp,
398 >        register PRIMITIVE  *p
399 > )
400   {
401 <    int  x, y;
401 >    int  x = 0, y = 0;
402  
403      switch (p->arg0 & 060) {
404          case 0:                 /* right */
# Line 395 | Line 423 | register PRIMITIVE  *p;
423   }
424  
425  
426 + extern void
427   fillpoly(p)                     /* fill a polygon */
428   register PRIMITIVE      *p;
429   {
401        extern char     *nextscan();
430          register char   *s;
431          int     curx, cury;
432  
# Line 407 | Line 435 | register PRIMITIVE     *p;
435          printf("%s %d %d mark\n", p->arg0 & 0100 ? "false" : "true",
436                          p->arg0>>2 & 03, p->arg0 & 03);
437          s = p->args;
438 <        while ((s = nextscan(nextscan(s, "%d", &curx), "%d", &cury)) != NULL) {
438 >        while ((s = nextscan(nextscan(s, "%d", (char*)&curx), "%d", (char*)&cury)) != NULL) {
439                  xform(&curx, &cury, p);
440                  printf("%d %d ", curx, cury);
441          }
# Line 415 | Line 443 | register PRIMITIVE     *p;
443   }
444  
445  
446 < set(attrib, val)                /* set an attribute or context */
447 < int     attrib;
448 < char    *val;
446 > void
447 > set(            /* set an attribute or context */
448 >        int     attrib,
449 >        char    *val
450 > )
451   {
452          checkline();
453  
# Line 438 | Line 468 | char   *val;
468   }
469  
470  
471 < unset(attrib)                   /* unset an attribute or context */
472 < int     attrib;
471 > void
472 > unset(                  /* unset an attribute or context */
473 >        int     attrib
474 > )
475   {
476          checkline();
477  
# Line 462 | Line 494 | int    attrib;
494   }
495  
496  
497 < reset(attrib)                   /* reset an attribute or context */
498 < int     attrib;
497 > void
498 > reset(                  /* reset an attribute or context */
499 >        int     attrib
500 > )
501   {
502          checkline();
503  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines