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.17 by greg, Wed Dec 29 09:48:12 1993 UTC vs.
Revision 2.20 by gwlarson, Tue Oct 27 09:08:25 1998 UTC

# Line 58 | Line 58 | struct {
58  
59   int  nfile;                     /* number of files */
60  
61 + char  ourfmt[LPICFMT+1] = PICFMT;
62   int  wrongformat = 0;
63  
64   FILE  *popen(), *lblopen();
# Line 70 | Line 71 | char  *s;
71   {
72          char  fmt[32];
73  
74 <        if (isformat(s)) {
75 <                formatval(fmt, s);
76 <                wrongformat = strcmp(fmt, COLRFMT);
74 >        if (isheadid(s))
75 >                return(0);
76 >        if (formatval(fmt, s)) {
77 >                if (globmatch(ourfmt, fmt)) {
78 >                        wrongformat = 0;
79 >                        strcpy(ourfmt, fmt);
80 >                } else
81 >                        wrongformat = 1;
82          } else {
83                  putc('\t', stdout);
84                  fputs(s, stdout);
85          }
86 +        return(0);
87   }
88  
89  
# Line 143 | Line 150 | char  *argv[];
150                          goto userr;
151                  }
152   dofiles:
153 +        newheader("RADIANCE", stdout);
154          for (nfile = 0; an < argc; nfile++) {
155                  if (nfile >= MAXFILE)
156                          goto toomany;
# Line 220 | Line 228 | getfile:
228                  printf("%s:\n", input[nfile].name);
229                  getheader(input[nfile].fp, tabputs, NULL);
230                  if (wrongformat) {
231 <                        fprintf(stderr, "%s: not a Radiance picture\n",
231 >                        fprintf(stderr, "%s: bad Radiance input file\n",
232                                          input[nfile].name);
233                          quit(1);
234                  }
# Line 287 | Line 295 | getfile:
295                  ymax = ysiz;
296                                          /* add new header info. */
297          printargs(argc, argv, stdout);
298 <        fputformat(COLRFMT, stdout);
298 >        if (strcmp(ourfmt, PICFMT))
299 >                fputformat(ourfmt, stdout);     /* print format if known */
300          putchar('\n');
301          fprtresolu(xsiz, ysiz, stdout);
302  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines