diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /sys/qpoe/qpctod.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/qpoe/qpctod.x')
-rw-r--r-- | sys/qpoe/qpctod.x | 34 |
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 |