--- ray/src/px/pcompos.c 1991/05/31 10:21:31 1.9 +++ ray/src/px/pcompos.c 1992/06/16 16:48:41 2.5 @@ -14,6 +14,7 @@ static char SCCSid[] = "$SunId$ LBL"; #include "color.h" +#include "resolu.h" #define MAXFILE 32 @@ -69,7 +70,6 @@ main(argc, argv) int argc; char *argv[]; { - double atof(); int ncolumns = 0; int autolabel = 0; int curcol = 0, curx = 0, cury = 0; @@ -146,7 +146,8 @@ dofiles: case 'l': if (strcmp(argv[an], "-l")) goto userr; - thislabel = argv[++an]; + thislabel = argv[an+1]; + an += 2; break; case '\0': if (argv[an][0] == '-') @@ -162,10 +163,14 @@ getfile: input[nfile].name = ""; input[nfile].fp = stdin; } else { - input[nfile].name = argv[an]; - if ((input[nfile].fp = argv[an][0] == '!' ? - popen(argv[an]+1, "r") : - fopen(argv[an], "r")) == NULL) { + if (argv[an][0] == '!') { + input[nfile].name = ""; + input[nfile].fp = popen(argv[an]+1, "r"); + } else { + input[nfile].name = argv[an]; + input[nfile].fp = fopen(argv[an], "r"); + } + if (input[nfile].fp == NULL) { perror(argv[an]); quit(1); } @@ -181,7 +186,7 @@ getfile: } /* get picture size */ if (fgetresolu(&input[nfile].xres, &input[nfile].yres, - input[nfile].fp) != (YMAJOR|YDECR)) { + input[nfile].fp) < 0) { fprintf(stderr, "%s: bad picture size\n", input[nfile].name); quit(1); @@ -229,7 +234,8 @@ getfile: /* add new header info. */ printargs(argc, argv, stdout); fputformat(COLRFMT, stdout); - printf("\n-Y %d +X %d\n", ysiz, xsiz); + putchar('\n'); + fprtresolu(xsiz, ysiz, stdout); compos(); @@ -332,13 +338,12 @@ int *xp, *yp; char com[128]; FILE *fp; - sprintf(com, "psign -h %d '%.30s' | pfilt -1 -x /2 -y /2", - 2*labelht, s); + sprintf(com, "psign -s -.2 -h %d '%.30s'", labelht, s); if ((fp = popen(com, "r")) == NULL) return(NULL); if (checkheader(fp, COLRFMT, NULL) < 0) goto err; - if (fgetresolu(xp, yp, fp) != (YMAJOR|YDECR)) + if (fgetresolu(xp, yp, fp) < 0) goto err; return(fp); err: