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 /vo/votools/t_dispname.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'vo/votools/t_dispname.x')
-rw-r--r-- | vo/votools/t_dispname.x | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/vo/votools/t_dispname.x b/vo/votools/t_dispname.x new file mode 100644 index 00000000..fbf7f37d --- /dev/null +++ b/vo/votools/t_dispname.x @@ -0,0 +1,49 @@ +include <fset.h> +include <gset.h> +include <imhdr.h> +include <imset.h> + +define TV_NLINES 128 + + +# T_DISPNAME -- Get the displayed image name. + +procedure t_dispname () + +pointer image # pointer to name of the image + +pointer sp, im, iw, tmpname +int frame, wcs_status +bool verbose + +int clgeti(), imstati() +bool clgetb() +pointer imd_mapframe(), iw_open() + +begin + # Set standard output to flush on newline. + call fseti (STDOUT, F_FLUSHNL, YES) + + # Allocate working space. + call smark (sp) + call salloc (image, SZ_FNAME, TY_CHAR) + call salloc (tmpname, SZ_FNAME, TY_CHAR) + + frame = clgeti ("frame") + verbose = clgetb ("verbose") + + + # Open the frame as an image. + im = imd_mapframe (frame, READ_WRITE, YES) + iw = iw_open (im, frame, Memc[image], SZ_FNAME, wcs_status) + + call clpstr ("name", Memc[image]) + if (verbose) { + call printf ("%s\n") + call pargstr (Memc[image]) + } + + call iw_close (iw) + call imunmap (im) + call sfree (sp) +end |