aboutsummaryrefslogtreecommitdiff
path: root/sys/imio/imrmbufs.x
blob: 1e0d7c5ad68136be52440c19e35df5f8ea942c50 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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