aboutsummaryrefslogtreecommitdiff
path: root/sys/psio/psjustify.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/psio/psjustify.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/psio/psjustify.x')
-rw-r--r--sys/psio/psjustify.x48
1 files changed, 48 insertions, 0 deletions
diff --git a/sys/psio/psjustify.x b/sys/psio/psjustify.x
new file mode 100644
index 00000000..367cc6fe
--- /dev/null
+++ b/sys/psio/psjustify.x
@@ -0,0 +1,48 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include "psio.h"
+
+
+# PS_RIGHTJUSTIFY -- Right justfify text on the given string and break.
+
+procedure ps_rightjustify (ps, str)
+
+pointer ps #I PSIO descriptor
+char str[ARB] #I text line
+
+int mtemp, ps_rjPos()
+errchk ps_output
+
+begin
+ mtemp = PS_CLMARGIN(ps)
+ PS_CLMARGIN(ps) = ps_rjpos (ps, str)
+ call ps_output (ps, str, NO)
+ PS_CLMARGIN(ps) = mtemp
+end
+
+
+# PS_RJPOS -- Get the X position of the right-justified string.
+
+int procedure ps_rjpos (ps, str)
+
+pointer ps #I PSIO descriptor
+char str[ARB] #I text to justify
+
+int ps_textwidth()
+errchk ps_textwidth
+
+begin
+ return (PS_CRMPOS(ps) - ps_textwidth (ps, str))
+end
+
+
+# PS_SET_JUSTIFY -- Set the justification flag.
+
+procedure ps_setjustify (ps, justify)
+
+pointer ps #I PSIO descriptor
+int justify #I justificaton flag
+
+begin
+ PS_JUSTIFY(ps) = justify
+end