aboutsummaryrefslogtreecommitdiff
path: root/sys/imio/imrmbufs.x
diff options
context:
space:
mode:
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