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

Comparing ray/src/px/pcompos.c (file contents):
Revision 2.31 by greg, Tue Jun 6 19:13:00 2006 UTC vs.
Revision 2.32 by greg, Fri Sep 8 21:38:25 2006 UTC

# Line 57 | Line 57 | struct {
57  
58   int  nfile;                     /* number of files */
59  
60 + int  echoheader = 1;
61   char  ourfmt[LPICFMT+1] = PICFMT;
62   int  wrongformat = 0;
63  
64  
65 < static gethfunc tabputs;
65 > static gethfunc headline;
66   static void compos(void);
67   static int cmpcolr(COLR  c1, double lv2);
68   static FILE * lblopen(char  *s, int  *xp, int  *yp);
# Line 69 | Line 70 | static FILE * lblopen(char  *s, int  *xp, int  *yp);
70  
71  
72   static int
73 < tabputs(                        /* print line preceded by a tab */
73 > headline(                       /* print line preceded by a tab */
74          char    *s,
75          void    *p
76   )
# Line 84 | Line 85 | tabputs(                       /* print line preceded by a tab */
85                          strcpy(ourfmt, fmt);
86                  } else
87                          wrongformat = 1;
88 <        } else {
88 >        } else if (echoheader) {
89                  putc('\t', stdout);
90                  fputs(s, stdout);
91          }
# Line 111 | Line 112 | main(
112  
113          for (an = 1; an < argc && argv[an][0] == '-'; an++)
114                  switch (argv[an][1]) {
115 +                case 'h':
116 +                        echoheader = !echoheader;
117 +                        break;
118                  case 'x':
119                          xsiz = atoi(argv[++an]);
120                          break;
# Line 224 | Line 228 | getfile:
228                  }
229                  an++;
230                                                  /* get header */
231 <                printf("%s:\n", input[nfile].name);
232 <                getheader(input[nfile].fp, tabputs, NULL);
231 >                if (echoheader)
232 >                        printf("%s:\n", input[nfile].name);
233 >                getheader(input[nfile].fp, headline, NULL);
234                  if (wrongformat) {
235                          fprintf(stderr, "%s: incompatible input format\n",
236                                          input[nfile].name);
# Line 304 | Line 309 | getfile:
309          quit(0);
310   userr:
311          fprintf(stderr,
312 <        "Usage: %s [-x xr][-y yr][-b r g b][-a n][-s p][-o x0 y0][-la][-lh h] ",
312 >        "Usage: %s [-h][-x xr][-y yr][-b r g b][-a n][-s p][-o x0 y0][-la][-lh h] ",
313                          progname);
314          fprintf(stderr, "[-t min1][+t max1][-l lab][=SS] pic1 x1 y1 ..\n");
315          quit(1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines