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/libc/cimdrcur.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 sys/libc/cimdrcur.c (limited to 'sys/libc/cimdrcur.c') diff --git a/sys/libc/cimdrcur.c b/sys/libc/cimdrcur.c new file mode 100644 index 00000000..1ac9f85b --- /dev/null +++ b/sys/libc/cimdrcur.c @@ -0,0 +1,39 @@ +/* Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. +*/ + +#define import_spp +#define import_libc +#define import_xnames +#include + + +/* C_IMDRCUR -- Read the logical image cursor (temporary routine, will be +** phased out in a later release). +*/ +int +c_imdrcur ( + char *device, /* logical device name or "stdimage" */ + float *x, /* cursor X coordinate (out) */ + float *y, /* cursor Y coordinate (out) */ + int *wcs, /* wcs of coords (out, = frame*100+d_wcs) */ + int *key, /* keystroke which triggered read (out) */ + char *strval, /* string value, if key=':' */ + int maxch, /* max chars out */ + int d_wcs, /* 0 for frame coords, 1 for image coords */ + int pause /* true to pause for key to terminate read */ +) +{ + PKCHAR x_strval[SZ_LINE+1]; + XINT x_maxch = maxch, x_d_wcs = d_wcs, x_pause = pause; + XINT x_wcs, x_key; + + + if (IMDRCUR (c_sppstr(device), x, y, &x_wcs, &x_key, x_strval, &x_maxch, + &x_d_wcs, &x_pause) >= 0) + c_strpak (x_strval, strval, maxch); + + *wcs = x_wcs; + *key = x_key; + + return (*key = (*key == XEOF) ? EOF : *key); +} -- cgit