diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/plio/plrpr.gx | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/plio/plrpr.gx')
-rw-r--r-- | sys/plio/plrpr.gx | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/sys/plio/plrpr.gx b/sys/plio/plrpr.gx new file mode 100644 index 00000000..f0004515 --- /dev/null +++ b/sys/plio/plrpr.gx @@ -0,0 +1,56 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <plset.h> +include <plio.h> + +# PLR_PRINT -- Print a range list on the given output stream. + +procedure plr_print$t (rl, fd, label, firstcol, maxcol) + +PIXEL rl[3,ARB] #I range list +int fd #I output file +char label[ARB] #I line label +int firstcol #I first column for output +int maxcol #I width of formatted output + +pointer sp, buf +int col, rn, r_len, x, n, pv +int strlen() + +begin + call smark (sp) + call salloc (buf, SZ_LINE, TY_CHAR) + + # Output the line label and advance to the first column. If the label + # extends beyond the first column, start a new line. + + call putline (fd, label) + col = strlen (label) + 1 + if (col > firstcol) + call pl_debugout (fd, "", col, firstcol, maxcol) + + r_len = RL_LEN(rl) + + # Decode the range list proper. + do rn = RL_FIRST, r_len { + x = RL_X(rl,rn) + n = RL_N(rl,rn) + pv = RL_V(rl,rn) + + if (n == 1) { + call sprintf (Memc[buf], SZ_LINE, "%d(%d)") + call pargi (x) + call pargi (pv) + } else { + call sprintf (Memc[buf], SZ_LINE, "%d-%d(%d)") + call pargi (x) + call pargi (x+n-1) + call pargi (pv) + } + + call pl_debugout (fd, Memc[buf], col, firstcol, maxcol) + } + + call pl_debugout (fd, "", col, firstcol, maxcol) + call sfree (sp) +end |