--- ray/src/px/pcompos.c 1991/05/30 10:33:30 1.8 +++ ray/src/px/pcompos.c 1991/05/31 10:21:31 1.9 @@ -17,10 +17,6 @@ static char SCCSid[] = "$SunId$ LBL"; #define MAXFILE 32 -#define SIGNHT 24 -#define setpscom(b,n) sprintf(b, "psign -h %d '%.30s'|pfilt -1 -x /2 -y /2",\ - 2*SIGNHT, n) - /* output picture size */ int xsiz = 0; int ysiz = 0; @@ -32,6 +28,8 @@ int ymax = 0; COLR bgcolr = BLKCOLR; /* background color */ +int labelht = 24; /* label height */ + int checkthresh = 0; /* check threshold value */ char *progname; @@ -49,11 +47,9 @@ int nfile; /* number of files */ int wrongformat = 0; -char tmpbuf[128]; +FILE *popen(), *lblopen(); -FILE *popen(); - tabputs(s) /* print line preceded by a tab */ char *s; { @@ -75,8 +71,9 @@ char *argv[]; { double atof(); int ncolumns = 0; - int dolabels = 0; + int autolabel = 0; int curcol = 0, curx = 0, cury = 0; + char *thislabel; int an; progname = argv[0]; @@ -99,7 +96,18 @@ char *argv[]; ncolumns = atoi(argv[++an]); break; case 'l': - dolabels++; + switch (argv[an][2]) { + case 'a': + autolabel++; + break; + case 'h': + labelht = atoi(argv[++an]); + break; + case '\0': + goto dofiles; + default: + goto userr; + } break; case '\0': case 't': @@ -109,20 +117,12 @@ char *argv[]; } dofiles: for (nfile = 0; an < argc; nfile++) { - if (dolabels) { - if (nfile >= MAXFILE-1) { - fprintf(stderr, - "%s: only %d files allowed with labels\n", - progname, MAXFILE/2); - quit(1); - } - } else { - if (nfile >= MAXFILE) { - fprintf(stderr, "%s: only %d files allowed\n", - progname, MAXFILE); - quit(1); - } - } + if (nfile >= MAXFILE) + goto toomany; + if (autolabel) + thislabel = argv[an]; + else + thislabel = NULL; input[nfile].hasmin = input[nfile].hasmax = 0; while (an < argc && (argv[an][0] == '-' || argv[an][0] == '+')) switch (argv[an][1]) { @@ -143,10 +143,15 @@ dofiles: } an += 2; break; + case 'l': + if (strcmp(argv[an], "-l")) + goto userr; + thislabel = argv[++an]; + break; case '\0': if (argv[an][0] == '-') goto getfile; - /* fall through */ + goto userr; default: goto userr; } @@ -203,20 +208,18 @@ getfile: xmax = input[nfile].xloc+input[nfile].xres; if (input[nfile].yloc+input[nfile].yres > ymax) ymax = input[nfile].yloc+input[nfile].yres; - if (dolabels) { - input[++nfile].name = "