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/libc/cimdrcur.c | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/libc/cimdrcur.c')
-rw-r--r-- | sys/libc/cimdrcur.c | 39 |
1 files changed, 39 insertions, 0 deletions
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 <iraf.h> + + +/* 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); +} |