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/gio/gim/gimqras.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/gio/gim/gimqras.x')
-rw-r--r-- | sys/gio/gim/gimqras.x | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/sys/gio/gim/gimqras.x b/sys/gio/gim/gimqras.x new file mode 100644 index 00000000..fa8f5909 --- /dev/null +++ b/sys/gio/gim/gimqras.x @@ -0,0 +1,46 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <syserr.h> +include <gescape.h> +include <fset.h> +include <gio.h> + +# GIM_QUERYRASTER -- Query a raster. The function value (YES/NO) indicates +# whether or not the raster exists. If the raster exists, the raster type +# and size are returned as output arguments. + +int procedure gim_queryraster (gp, raster, type, width, height, depth) + +pointer gp #I graphics descriptor +int raster #I raster number (0 is display window) +int type #O raster type (ximage,pixmap) +int width #O raster width in pixels +int height #O raster height in pixels +int depth #O raster depth, bits per pixel + +int nchars, nread +short gim[GIM_QUERYRASTER_LEN] +short retval[GIM_RET_QRAS_LEN] +errchk gescape, flush, read, syserrs +int read() + +begin + call gpl_flush() + gim[GIM_QUERYRASTER_RN] = raster + call gescape (gp, GIM_QUERYRASTER, gim, GIM_QUERYRASTER_LEN) + call flush (GP_FD(gp)) + + # This assumes a normal stream type GKI connection. + nchars = GIM_RET_QRAS_LEN * SZ_SHORT + nread = read (GP_FD(gp), retval, nchars) + call fseti (GP_FD(gp), F_CANCEL, OK) + if (nread != nchars) + call syserrs (SYS_FREAD, "gim_queryraster") + + type = retval[GIM_RET_QRAS_RT] + width = retval[GIM_RET_QRAS_NX] + height = retval[GIM_RET_QRAS_NY] + depth = retval[GIM_RET_QRAS_BP] + + return (retval[GIM_RET_QRAS_EX]) +end |