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

Comparing ray/src/px/pcomb.c (file contents):
Revision 1.21 by greg, Wed Aug 14 15:00:34 1991 UTC vs.
Revision 2.3 by greg, Mon Aug 10 12:10:26 1992 UTC

# Line 16 | Line 16 | static char SCCSid[] = "$SunId$ LBL";
16  
17   #include "color.h"
18  
19 + #include  "resolu.h"
20 +
21   #include "calcomp.h"
22  
23   #define MAXINP          32              /* maximum number of input files */
# Line 108 | Line 110 | char   *argv[];
110                                  break;
111                          case 'o':
112                                  original++;
113 <                                break;
113 >                                continue;
114                          case 's':
115                                  f = atof(argv[++a]);
116                                  scalecolor(input[nfiles].coef, f);
# Line 122 | Line 124 | char   *argv[];
124                                  goto usage;
125                          }
126                  else {
127 <                        input[nfiles].name = argv[a];
128 <                        input[nfiles].fp = argv[a][0]=='!' ?
129 <                                        popen(argv[a]+1, "r") :
130 <                                        fopen(argv[a], "r");
127 >                        if (argv[a][0] == '!') {
128 >                                input[nfiles].name = "<Command>";
129 >                                input[nfiles].fp = popen(argv[a]+1, "r");
130 >                        } else {
131 >                                input[nfiles].name = argv[a];
132 >                                input[nfiles].fp = fopen(argv[a], "r");
133 >                        }
134                          if (input[nfiles].fp == NULL) {
135                                  perror(argv[a]);
136                                  quit(1);
# Line 181 | Line 186 | char   *argv[];
186          printargs(argc, argv, stdout);
187          fputformat(COLRFMT, stdout);
188          putchar('\n');
189 <        fputresolu(YMAJOR|YDECR, xres, yres, stdout);
189 >        fprtresolu(xres, yres, stdout);
190                                                  /* combine pictures */
191          combine();
192          quit(0);
# Line 232 | Line 237 | checkfile()                    /* ready a file */
237                  eputs(": not in Radiance picture format\n");
238                  quit(1);
239          }
240 <        if (fgetresolu(&xinp, &yinp, input[nfiles].fp) != (YMAJOR|YDECR)) {
240 >        if (fgetresolu(&xinp, &yinp, input[nfiles].fp) < 0) {
241                  eputs(input[nfiles].name);
242                  eputs(": bad picture size\n");
243                  quit(1);
# Line 447 | Line 452 | char   *msg;
452   quit(code)
453   int     code;
454   {
455 +        int  status;
456 +
457 +        if (code == 0)                  /* reap any children */
458 +                while (wait(&status) != -1)
459 +                        if (code == 0)
460 +                                code = status>>8 & 0xff;
461          exit(code);
462   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines