From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- sys/ki/kimapchan.x | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 sys/ki/kimapchan.x (limited to 'sys/ki/kimapchan.x') diff --git a/sys/ki/kimapchan.x b/sys/ki/kimapchan.x new file mode 100644 index 00000000..196619d2 --- /dev/null +++ b/sys/ki/kimapchan.x @@ -0,0 +1,44 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include +include +include +include "ki.h" + +# KI_MAPCHAN -- Return the OS channel number or pid and the node name of the +# resource associated with a given KI channel. This procedure may be called +# whether or not networking is enabled. + +int procedure ki_mapchan (chan, nodename, maxch) + +int chan # KI channel (ret. by kopnbf, etc.) +char nodename[maxch] # receives node name +int maxch + +int node +bool netenab +data netenab /KNET/ +include "kichan.com" +include "kinode.com" + +begin + if (netenab) { + # Networking is enabled. Every channel or pid returned to the VOS + # by the kernel is actually a KI channel index. + + node = k_node[chan] + if (node == NULL || n_nnodes == 0) + call strcpy (n_localnode, nodename, maxch) + else + call strcpy (n_alias[1,1,node], nodename, maxch) + + return (k_oschan[chan]) + + } else { + # Networking is disabled. Return the name of the local node + # and return the channel argument unchanged. + + call strcpy (n_localnode, nodename, maxch) + return (chan) + } +end -- cgit