aboutsummaryrefslogtreecommitdiff
path: root/sys/imio/iki/fxf/fxfmkcard.x
diff options
context:
space:
mode:
Diffstat (limited to 'sys/imio/iki/fxf/fxfmkcard.x')
-rw-r--r--sys/imio/iki/fxf/fxfmkcard.x35
1 files changed, 35 insertions, 0 deletions
diff --git a/sys/imio/iki/fxf/fxfmkcard.x b/sys/imio/iki/fxf/fxfmkcard.x
new file mode 100644
index 00000000..81bb3ab7
--- /dev/null
+++ b/sys/imio/iki/fxf/fxfmkcard.x
@@ -0,0 +1,35 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+# FXF_MK_CARD -- Fetch a single line from a string parameter, padding it to
+# a maximum of maxcols characters and trimmimg the delim character.
+
+procedure fxf_make_card (instr, ip, card, col_out, maxcols, delim)
+
+char instr[ARB] #I input string
+int ip #U input string pointer, updated at each call
+char card[ARB] #O FITS card image
+int col_out #I pointer to column in card
+int maxcols #I maximum columns in card
+int delim #I 1 character string delimiter
+
+int op
+
+begin
+ op = col_out
+
+ # Copy string
+ while (op <= maxcols && instr[ip] != EOS && instr[ip] != delim) {
+ card[op] = instr[ip]
+ ip = ip + 1
+ op = op + 1
+ }
+
+ # Fill remainder of card with blanks
+ while (op <= maxcols ) {
+ card[op] = ' '
+ op = op + 1
+ }
+
+ if (instr[ip] == delim)
+ ip = ip + 1
+end