--- ray/src/px/pcompos.c 1991/12/19 14:51:50 2.2 +++ ray/src/px/pcompos.c 1992/08/12 12:39:52 2.11 @@ -16,7 +16,7 @@ static char SCCSid[] = "$SunId$ LBL"; #include "resolu.h" -#define MAXFILE 32 +#define MAXFILE 64 /* output picture size */ int xsiz = 0; @@ -72,7 +72,7 @@ char *argv[]; { int ncolumns = 0; int autolabel = 0; - int curcol = 0, curx = 0, cury = 0; + int curcol = 0, x0 = 0, curx = 0, cury = 0, spacing = 0; char *thislabel; int an; @@ -81,10 +81,10 @@ char *argv[]; for (an = 1; an < argc && argv[an][0] == '-'; an++) switch (argv[an][1]) { case 'x': - xmax = xsiz = atoi(argv[++an]); + xsiz = atoi(argv[++an]); break; case 'y': - ymax = ysiz = atoi(argv[++an]); + ysiz = atoi(argv[++an]); break; case 'b': setcolr(bgcolr, atof(argv[an+1]), @@ -95,6 +95,13 @@ char *argv[]; case 'a': ncolumns = atoi(argv[++an]); break; + case 's': + spacing = atoi(argv[++an]); + break; + case 'o': + curx = x0 = atoi(argv[++an]); + cury = atoi(argv[++an]); + break; case 'l': switch (argv[an][2]) { case 'a': @@ -119,10 +126,7 @@ dofiles: for (nfile = 0; an < argc; nfile++) { if (nfile >= MAXFILE) goto toomany; - if (autolabel) - thislabel = argv[an]; - else - thislabel = NULL; + thislabel = NULL; input[nfile].hasmin = input[nfile].hasmax = 0; while (an < argc && (argv[an][0] == '-' || argv[an][0] == '+')) switch (argv[an][1]) { @@ -146,7 +150,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] == '-') @@ -158,14 +163,20 @@ dofiles: getfile: if (argc-an < (ncolumns ? 1 : 3)) goto userr; + if (autolabel && thislabel == NULL) + thislabel = argv[an]; if (!strcmp(argv[an], "-")) { 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); } @@ -188,13 +199,13 @@ getfile: } if (ncolumns > 0) { if (curcol >= ncolumns) { - cury = ymax; - curx = 0; + cury = ymax + spacing; + curx = x0; curcol = 0; } input[nfile].xloc = curx; input[nfile].yloc = cury; - curx += input[nfile].xres; + curx += input[nfile].xres + spacing; curcol++; } else { input[nfile].xloc = atoi(argv[an++]); @@ -213,6 +224,8 @@ getfile: goto toomany; input[nfile].name = "