aboutsummaryrefslogtreecommitdiff
path: root/sys/imfort/imtypk.x
diff options
context:
space:
mode:
Diffstat (limited to 'sys/imfort/imtypk.x')
-rw-r--r--sys/imfort/imtypk.x33
1 files changed, 33 insertions, 0 deletions
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