aboutsummaryrefslogtreecommitdiff
path: root/pkg/tbtables/tbfclo.x
blob: 1b2abf588b80af082743dfcef1afd6fa2e3623c7 (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
include <tbset.h>
include "tbtables.h"

# tbfclo -- close a table in a FITS file
#
# Phil Hodge,  6-Jul-1995  Subroutine created
# Phil Hodge,  1-Jun-1999  Set both TB_FILE and TB_FILE2 to 0.

procedure tbfclo (tp)

pointer tp		# i: pointer to table descriptor
#--
int	status
errchk	tbferr

begin
	if (TB_FILE(tp) == 0)
	    return

	# Close the file, and free the unit number.
	status = 0
	call fsclos (TB_FILE(tp), status)
	call fsfiou (TB_FILE(tp), status)
	if (status != 0)
	    call tbferr (status)
	TB_FILE(tp) = 0
	TB_FILE2(tp) = 0
end