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/ki/ktzsek.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/ki/ktzsek.x')
-rw-r--r-- | sys/ki/ktzsek.x | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/sys/ki/ktzsek.x b/sys/ki/ktzsek.x new file mode 100644 index 00000000..f8b20829 --- /dev/null +++ b/sys/ki/ktzsek.x @@ -0,0 +1,50 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <mach.h> +include <config.h> +include "ki.h" + +# KT_ZSEK -- Seek on a text device. We are called only if the device does not +# reside on the local node. + +procedure kt_zsek (device, chan, loffset, status) + +int device # device driver code +int chan # channel assigned device +long loffset # znottx offset to seek to +int status # receives nchars written or ERR + +pointer bd +int server +int ki_sendrcv() +include "kichan.com" +include "kii.com" + +begin + call ki_flushtx (device, chan, status) + if (status == ERR) + return + + # Discard any cached input text to force a buffer refill at the new + # offset. + + bd = k_bufp[chan] + B_RP(bd) = B_ITOP(bd) + + # Transmit the seek request to the server. + + server = k_node[chan] + p_arg[1] = k_oschan[chan] + + # The long integer seek offset is passed as an encoded char sequence + # rather than as an integer p_arg value to avoid possible loss of + # precision. + + call ki_encode (loffset, p_sbuf, NCHARS_LONG) + p_sbuflen = NCHARS_LONG + + if (ki_sendrcv (server, device, TX_SEK) == ERR) + status = ERR + else + status = p_arg[1] +end |