aboutsummaryrefslogtreecommitdiff
path: root/sys/qpoe/qpctod.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/qpoe/qpctod.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/qpoe/qpctod.x')
-rw-r--r--sys/qpoe/qpctod.x34
1 files changed, 34 insertions, 0 deletions
diff --git a/sys/qpoe/qpctod.x b/sys/qpoe/qpctod.x
new file mode 100644
index 00000000..6487650c
--- /dev/null
+++ b/sys/qpoe/qpctod.x
@@ -0,0 +1,34 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+define SZ_NUMBUF 32 # buffer for extracting numbers
+
+# QP_CTOD -- Return as a double the next numeric token from the input stream.
+# This differs from the standard FMTIO procedures only in that colon is not
+# considered a numeric character (as used in sexagesimal numbers).
+
+int procedure qp_ctod (str, ip, dval)
+
+char str[ARB] #I input string
+int ip #U pointer into input string
+double dval #O double value
+
+int nchars, op, i
+char numbuf[SZ_NUMBUF]
+int ctod()
+
+begin
+ i = ip
+ do op = 1, SZ_NUMBUF
+ if (str[i] != ':' && str[i] != EOS) {
+ numbuf[op] = str[i]
+ i = i + 1
+ } else
+ break
+
+ i = 1
+ numbuf[op] = EOS
+ nchars = ctod (numbuf, i, dval)
+ ip = ip + i - 1
+
+ return (nchars)
+end