aboutsummaryrefslogtreecommitdiff
path: root/sys/plio/tf/plrpri.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/plio/tf/plrpri.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/plio/tf/plrpri.x')
-rw-r--r--sys/plio/tf/plrpri.x56
1 files changed, 56 insertions, 0 deletions
diff --git a/sys/plio/tf/plrpri.x b/sys/plio/tf/plrpri.x
new file mode 100644
index 00000000..a74e7791
--- /dev/null
+++ b/sys/plio/tf/plrpri.x
@@ -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_printi (rl, fd, label, firstcol, maxcol)
+
+int 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