aboutsummaryrefslogtreecommitdiff
path: root/noao/twodspec/apextract/apdelete.x
blob: 1956a33162ed3dcc0a1d0ab1f395cf38f3a968bc (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
# AP_DELETE -- Delete the specified aperture and return a new current aperture.

procedure ap_delete (current, aps, naps)

int	current			# Return current aperture index
pointer	aps[ARB]		# Aperture data
int	naps			# Number of apertures

int	i

begin
	if (current < 1)
	    return

	call ap_free (aps[current])
	for (i = current; i < naps; i = i + 1)
	    aps[i] = aps[i+1]

	aps[naps] = NULL

	naps = naps - 1
	current = min (naps, current)
end