aboutsummaryrefslogtreecommitdiff
path: root/sys/imfort/imclos.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/imfort/imclos.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/imfort/imclos.x')
-rw-r--r--sys/imfort/imclos.x36
1 files changed, 36 insertions, 0 deletions
diff --git a/sys/imfort/imclos.x b/sys/imfort/imclos.x
new file mode 100644
index 00000000..c182877a
--- /dev/null
+++ b/sys/imfort/imclos.x
@@ -0,0 +1,36 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include "imfort.h"
+
+# IMCLOS -- Close an IMFORT image. If the image was opened read only the
+# header file will already have been closed, otherwise it must be updated
+# if it has been modified.
+
+procedure imclos (im, ier)
+
+pointer im # image descriptor
+int ier # receives error status
+
+int status
+
+begin
+ call imflsh (im, ier)
+
+ # Close the pixel file.
+ if (IM_PIXFP(im) != NULL) {
+ call bfclos (IM_PIXFP(im), status)
+ if (status == ERR && ier == OK)
+ ier = IE_CLSPIX
+ }
+
+ # Close the header file.
+ if (IM_HDRFP(im) != NULL) {
+ call bfclos (IM_HDRFP(im), status)
+ if (status == ERR && ier == OK)
+ ier = IE_CLSHDR
+ }
+
+ if (IM_LINEBUFP(im) != NULL)
+ call mfree (IM_LINEBUFP(im), TY_SHORT)
+ call mfree (im, TY_STRUCT)
+end