From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/plio/tf/plrpri.x | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 sys/plio/tf/plrpri.x (limited to 'sys/plio/tf/plrpri.x') 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 +include + +# 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 -- cgit