diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /vo/votools/t_dispname.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
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 |