aboutsummaryrefslogtreecommitdiff
path: root/sys/imfort/imflsh.x
blob: 5ae36b2ff3e8ef11b9bf9c122c54ba37574d6ad9 (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
32
33
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

include	"imfort.h"

# IMFLSH -- Flush any buffered image data, i.e., synchronize the in-core
# version of an image with that on disk.

procedure imflsh (im, ier)

pointer	im			# image descriptor
int	ier

int	status
int	bfflsh()

begin
	ier = OK

	# Flush any buffered output pixel data.
	status = bfflsh (IM_PIXFP(im))
	if (status == ERR)
	    ier = IE_FLUSH

	# Update the image header if it has been modified.
	if (IM_HDRFP(im) != NULL) {
	    if (IM_UPDATE(im) == YES) {
		call imf_updhdr (im, status)
		if (status == ERR && ier == OK)
		    ier = IE_UPDHDR
	    }
	} else if (IM_UPDATE(im) == YES && ier == OK)
	    ier = IE_UPDRO
end