aboutsummaryrefslogtreecommitdiff
path: root/sys/imfort/imaddk.x
diff options
context:
space:
mode:
Diffstat (limited to 'sys/imfort/imaddk.x')
-rw-r--r--sys/imfort/imaddk.x35
1 files changed, 35 insertions, 0 deletions
diff --git a/sys/imfort/imaddk.x b/sys/imfort/imaddk.x
new file mode 100644
index 00000000..0e6054dc
--- /dev/null
+++ b/sys/imfort/imaddk.x
@@ -0,0 +1,35 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include "imfort.h"
+
+# IMADDK -- Add a new keyword to the image header.
+
+procedure imaddk (im, keyw, dtype, comm, ier)
+
+pointer im # imfort image descriptor
+% character*(*) keyw
+int dtype
+% 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_LINE, TY_CHAR)
+
+ call f77upk (keyw, Memc[kp], SZ_KEYWORD)
+ call f77upk (comm, Memc[cp], SZ_LINE)
+
+ iferr (call imaddf (im, Memc[kp], dtype, Memc[cp])) {
+ ier = errcode()
+ call im_seterrop (ier, Memc[kp])
+ } else {
+ ier = OK
+ IM_UPDATE(im) = YES
+ }
+
+ call sfree (sp)
+end