aboutsummaryrefslogtreecommitdiff
path: root/pkg/images/tv/display/iisopn.x
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /pkg/images/tv/display/iisopn.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/images/tv/display/iisopn.x')
-rw-r--r--pkg/images/tv/display/iisopn.x76
1 files changed, 76 insertions, 0 deletions
diff --git a/pkg/images/tv/display/iisopn.x b/pkg/images/tv/display/iisopn.x
new file mode 100644
index 00000000..a310e168
--- /dev/null
+++ b/pkg/images/tv/display/iisopn.x
@@ -0,0 +1,76 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <mach.h>
+include <knet.h>
+include "zdisplay.h"
+include "iis.h"
+
+# ----------------------------------------------------------------------
+# MODIFIED VERSION OF IISOPN.X FOR IMTOOL -- DO NOT DELETE.
+# Referenced by the Sun/IRAF special file list: see hlib$mkpkg.sf.
+# ----------------------------------------------------------------------
+
+# IISOPN -- Open IIS display.
+
+procedure iisopn (devinfo, mode, chan)
+
+char devinfo[ARB] # device info for zopen (packed)
+int mode # access mode
+int chan[ARB] # receives IIS descriptor
+
+int delim
+char resource[SZ_FNAME]
+char node[SZ_FNAME]
+bool first_time
+data first_time /true/
+int ki_gnode(), strncmp()
+include "iis.com"
+include "imd.com"
+define quit_ 91
+
+begin
+ if (first_time) {
+ iisnopen = 0
+ iis_version = 0
+ first_time = false
+ }
+
+ # We permit multiple opens but only open the physical device once.
+ if (iisnopen == 0) {
+ call zopngd (devinfo, mode, iischan)
+
+ # Initialize imd_gcur.
+ call strcpy (devinfo, imd_devinfo, SZ_LINE)
+ imd_mode = mode
+ imd_magic = -1
+ }
+
+ if (iischan != ERR) {
+ iisnopen = iisnopen + 1
+ chan[1] = FRTOCHAN(iisframe)
+
+ # The following code is DEVICE DEPENDENT (horrible kludge, but
+ # it simplifies things and this is throw away code).
+
+ # Byte pack i/o if the device is on a remote node since the i/o
+ # bandwidth is the limiting factor; do not bytepack if on local
+ # node since cpu time is the limiting factor.
+
+ call strupk (devinfo, resource, SZ_FNAME)
+ packit = (ki_gnode (resource, node, delim) != 0)
+ if (!packit)
+ packit = (strncmp (resource[delim+1], "imt", 3) == 0)
+
+ # Enable byte swapping if the device is byte swapped but the
+ # local host is not (assumes that if there is an IIS it is on
+ # a byte swapped VAX - this should be done in graphcap instead).
+
+ swap_bytes = (strncmp (resource[delim+1], "iis", 3) == 0 &&
+ BYTE_SWAP2 == NO)
+
+ # Initialize zoom.
+ call iiszm (1, 0, 0)
+
+ } else
+ chan[1] = ERR
+end