aboutsummaryrefslogtreecommitdiff
path: root/sys/imio/iki/stf/stfhextn.x
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /sys/imio/iki/stf/stfhextn.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/imio/iki/stf/stfhextn.x')
-rw-r--r--sys/imio/iki/stf/stfhextn.x39
1 files changed, 39 insertions, 0 deletions
diff --git a/sys/imio/iki/stf/stfhextn.x b/sys/imio/iki/stf/stfhextn.x
new file mode 100644
index 00000000..45e89f7a
--- /dev/null
+++ b/sys/imio/iki/stf/stfhextn.x
@@ -0,0 +1,39 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <imhdr.h>
+include <imio.h>
+include "stf.h"
+
+
+# STF_GETHDREXTN -- Get the default header file extension.
+
+procedure stf_gethdrextn (im, o_im, acmode, outstr, maxch)
+
+pointer im, o_im #I image descriptors
+int acmode #I access mode
+char outstr[maxch] #O receives header extension
+int maxch #I max chars out
+
+bool inherit
+int kernel, old_kernel
+int fnextn(), iki_getextn(), iki_getpar()
+
+begin
+ # Use the same extension as the input file if this is a new copy
+ # image of the same type as the input and inherit is enabled.
+ # If we have to get the extension using iki_getextn, the default
+ # extension for a new image is the first extension defined (index=1).
+
+ kernel = IM_KERNEL(im)
+
+ old_kernel = 0
+ if (acmode == NEW_COPY && o_im != NULL)
+ old_kernel = IM_KERNEL(o_im)
+
+ inherit = (iki_getpar ("inherit") == YES)
+ if (inherit && acmode == NEW_COPY && kernel == old_kernel) {
+ if (fnextn (IM_HDRFILE(im), outstr, maxch) <= 0)
+ call strcpy (STF_DEFHDREXTN, outstr, maxch)
+ } else if (iki_getextn (kernel, 1, outstr, maxch) < 0)
+ call strcpy (STF_DEFHDREXTN, outstr, maxch)
+end