From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/imfort/imtypk.x | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 sys/imfort/imtypk.x (limited to 'sys/imfort/imtypk.x') diff --git a/sys/imfort/imtypk.x b/sys/imfort/imtypk.x new file mode 100644 index 00000000..03c71d21 --- /dev/null +++ b/sys/imfort/imtypk.x @@ -0,0 +1,33 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include "imfort.h" + +# IMTYPK -- Get the datatype and comment string for a keyword. + +procedure imtypk (im, keyw, dtype, comm, ier) + +pointer im # image descriptor +% character*(*) keyw +int dtype # receives datatype code +% character*(*) comm +int ier + +pointer sp, kp, cp +int errcode() + +begin + call smark (sp) + call salloc (kp, SZ_KEYWORD, TY_CHAR) + call salloc (cp, SZ_VALSTR, TY_CHAR) + + call f77upk (keyw, Memc[kp], SZ_KEYWORD) + iferr (call imgatr (im, Memc[kp], dtype, Memc[cp], len(comm))) { + ier = errcode() + call im_seterrop (ier, Memc[kp]) + } else { + call f77pak (Memc[cp], comm, len(comm)) + ier = OK + } + + call sfree (sp) +end -- cgit