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.3 by greg, Tue Feb 11 08:51:50 1992 UTC vs.
Revision 2.10 by greg, Tue Aug 11 18:40:57 1992 UTC

# Line 16 | Line 16 | static char SCCSid[] = "$SunId$ LBL";
16  
17   #include  "resolu.h"
18  
19 < #define  MAXFILE        32
19 > #define  MAXFILE        64
20  
21                                          /* output picture size */
22   int  xsiz = 0;
# Line 116 | Line 116 | char  *argv[];
116                          goto userr;
117                  }
118   dofiles:
119 +        if (ysiz > 0 & ncolumns > 0) {
120 +                fprintf(stderr, "%s: -a option incompatible with -y\n",
121 +                                progname);
122 +                quit(1);
123 +        }
124          for (nfile = 0; an < argc; nfile++) {
125                  if (nfile >= MAXFILE)
126                          goto toomany;
127 <                if (autolabel)
123 <                        thislabel = argv[an];
124 <                else
125 <                        thislabel = NULL;
127 >                thislabel = NULL;
128                  input[nfile].hasmin = input[nfile].hasmax = 0;
129                  while (an < argc && (argv[an][0] == '-' || argv[an][0] == '+'))
130                          switch (argv[an][1]) {
# Line 159 | Line 161 | dofiles:
161   getfile:
162                  if (argc-an < (ncolumns ? 1 : 3))
163                          goto userr;
164 +                if (autolabel && thislabel == NULL)
165 +                        thislabel = argv[an];
166                  if (!strcmp(argv[an], "-")) {
167                          input[nfile].name = "<stdin>";
168                          input[nfile].fp = stdin;
169                  } else {
170 <                        input[nfile].name = argv[an];
171 <                        if ((input[nfile].fp = argv[an][0] == '!' ?
172 <                                        popen(argv[an]+1, "r") :
173 <                                        fopen(argv[an], "r")) == NULL) {
170 >                        if (argv[an][0] == '!') {
171 >                                input[nfile].name = "<Command>";
172 >                                input[nfile].fp = popen(argv[an]+1, "r");
173 >                        } else {
174 >                                input[nfile].name = argv[an];
175 >                                input[nfile].fp = fopen(argv[an], "r");
176 >                        }
177 >                        if (input[nfile].fp == NULL) {
178                                  perror(argv[an]);
179                                  quit(1);
180                          }
# Line 214 | Line 222 | getfile:
222                                  goto toomany;
223                          input[nfile].name = "<Label>";
224                          input[nfile].hasmin = input[nfile].hasmax = 0;
225 +                        input[nfile].xres = input[nfile-1].xres;
226 +                        input[nfile].yres = labelht;
227                          if ((input[nfile].fp = lblopen(thislabel,
228                                          &input[nfile].xres,
229                                          &input[nfile].yres)) == NULL)
# Line 334 | Line 344 | int  *xp, *yp;
344          char  com[128];
345          FILE  *fp;
346  
347 <        sprintf(com, "psign -h %d '%.30s' | pfilt -1 -x /2 -y /2",
338 <                        2*labelht, s);
347 >        sprintf(com, "psign -s -.15 -a 2 -x %d -y %d '%.90s'", *xp, *yp, s);
348          if ((fp = popen(com, "r")) == NULL)
349                  return(NULL);
350          if (checkheader(fp, COLRFMT, NULL) < 0)
# Line 352 | Line 361 | err:
361   quit(code)              /* exit gracefully */
362   int  code;
363   {
364 +        int  status;
365 +
366 +        if (code == 0)                  /* reap any children */
367 +                while (wait(&status) != -1)
368 +                        if (code == 0)
369 +                                code = status>>8 & 0xff;
370          exit(code);
371   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines