aboutsummaryrefslogtreecommitdiff
path: root/sys/imio/imrmbufs.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/imio/imrmbufs.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/imio/imrmbufs.x')
-rw-r--r--sys/imio/imrmbufs.x31
1 files changed, 31 insertions, 0 deletions
diff --git a/sys/imio/imrmbufs.x b/sys/imio/imrmbufs.x
new file mode 100644
index 00000000..1e0d7c5a
--- /dev/null
+++ b/sys/imio/imrmbufs.x
@@ -0,0 +1,31 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <imio.h>
+
+# IMRMBUFS -- Free any pixel data buffers currently allocated to an image.
+
+procedure imrmbufs (im)
+
+pointer im # image descriptor
+
+int i
+pointer ibdes, obdes
+
+begin
+ ibdes = IM_IBDES(im)
+ obdes = IM_OBDES(im)
+
+ if (ibdes != NULL) {
+ for (i=0; i < IM_VNBUFS(im); i=i+1)
+ call mfree (BD_BUFPTR(ibdes + LEN_BDES * i), TY_CHAR)
+ call mfree (ibdes, TY_STRUCT)
+ }
+
+ if (obdes != NULL) {
+ call mfree (BD_BUFPTR(obdes), TY_CHAR)
+ call mfree (obdes, TY_STRUCT)
+ }
+
+ IM_IBDES(im) = NULL
+ IM_OBDES(im) = NULL
+end