From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/imio/imrmbufs.x | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 sys/imio/imrmbufs.x (limited to 'sys/imio/imrmbufs.x') 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 + +# 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 -- cgit