aboutsummaryrefslogtreecommitdiff
path: root/sys/imio/iki/fxf/fxfclose.x
diff options
context:
space:
mode:
Diffstat (limited to 'sys/imio/iki/fxf/fxfclose.x')
-rw-r--r--sys/imio/iki/fxf/fxfclose.x42
1 files changed, 42 insertions, 0 deletions
diff --git a/sys/imio/iki/fxf/fxfclose.x b/sys/imio/iki/fxf/fxfclose.x
new file mode 100644
index 00000000..72313316
--- /dev/null
+++ b/sys/imio/iki/fxf/fxfclose.x
@@ -0,0 +1,42 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <imhdr.h>
+include <imio.h>
+include "fxf.h"
+
+# FXF_CLOSE -- Close a FITS format image. There is little for us to do, since
+# IMIO will already have updated the header if necessary and flushed any pixel
+# output. Neither do we have to deallocate the IMIO descriptor, since it was
+# allocated by IMIO.
+
+procedure fxf_close (im, status)
+
+pointer im #I image descriptor
+int status #O status value
+
+pointer fit
+errchk close
+
+begin
+ fit = IM_KDES(im)
+
+ # Reset the IEEE interface to its original state.
+ switch (IM_ACMODE(im)) {
+ case READ_ONLY, READ_WRITE, WRITE_ONLY:
+ call ieesnanr (FIT_SVNANR(fit))
+ call ieesmapr (FIT_SVMAPRIN(fit), FIT_SVMAPROUT(fit))
+ call ieesnand (FIT_SVNAND(fit))
+ call ieesmapd (FIT_SVMAPDIN(fit), FIT_SVMAPDOUT(fit))
+ default:
+ ;
+ }
+
+ # Close the fits file.
+ if (IM_PFD(im) != NULL)
+ call close (IM_PFD(im))
+
+ # Deallocate the FIT descriptor.
+ call mfree (fit, TY_STRUCT)
+
+ status = OK
+end