aboutsummaryrefslogtreecommitdiff
path: root/pkg/tbtables/tbfdel.x
blob: 822590d85956186beb062197e2a3048ca05ef937 (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
include "tbtables.h"

# tbfdel -- delete FITS table
# This routine deletes the current HDU in a FITS file, closes the FITS
# file, and frees the memory allocated by the table I/O routines.
#
# Phil Hodge,  6-Jul-1995  Subroutine created

procedure tbfdel (tp)

pointer tp		# io: pointer to table descriptor
#--
int	status		# zero is OK
int	hdutype		# type of next HDU (ignored)
errchk	tbferr

begin
	status = 0

	# Delete the current HDU.
	call fsdhdu (TB_FILE(tp), hdutype, status)

	if (status != 0)
	    call tbferr (status)

	# Close the FITS file.  This sets TB_FILE to NULL.
	call tbfclo (tp)

	# Free memory.
	call tbtclo (tp)
end