aboutsummaryrefslogtreecommitdiff
path: root/pkg/utilities/nttools/threed/titable/tiupdate.x
blob: ebfe9b756bce8e0891d07515030e497cf9fb94b0 (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
34
35
36
37
38
39
include	<tbset.h>

#  TIUPDATE  --  Opens an already existing output table for update.
#
#
#
#  Revision history:
#  ----------------
#  20-Jan-97  -  Task created (I.Busko)
#  17-Mar-97  -  Replaced code by tbcnum call (IB)


procedure tiupdate (output, otp, cpo, ncpo)

char	output[ARB]	# i: table name
pointer	otp		# o: table descriptor
pointer	cpo		# o: column descriptor
int	ncpo		# o: number of columns
#--
int	i

errchk	tbtopn

pointer	tbtopn(), tbcnum()
int	tbpsta()

begin
	# Open table and get its size.
	otp  = tbtopn (output, READ_WRITE, NULL)
	ncpo = tbpsta (otp, TBL_NCOLS)

	# Alloc column descriptor array. This
	# must be freed by caller.
	call malloc (cpo, ncpo, TY_INT)

	# Fill array with column info.
	do i = 1, ncpo
	    Memi[cpo+i-1] = tbcnum (otp, i)
end