aboutsummaryrefslogtreecommitdiff
path: root/pkg/tbtables/selector/tcsaddcol.x
blob: c17f2cb9d7bea90e2ad7fb4c9b74e9b957b84b7f (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
# TCS_ADDCOL -- Add a single column to the list of descriptors

procedure tcs_addcol (tp, cp, descrip, ndescrip, maxdescrip)

pointer	tp		# i: table descriptor
pointer	cp		# i: column descriptor
pointer	descrip[ARB]	# u: list of column array selectors
int	ndescrip	# u: number of column array selectors
int	maxdescrip	# i: length of descrip array
#--
string	toomany  "Overflow in descriptor array"

begin
	# Check for descriptor array overflow

	if (ndescrip >= maxdescrip)
	    call error (1, toomany)

	# Convert the column pointer to a table column descriptor
	# Function tcs_fillstruct can be found in tcs_open

	ndescrip = ndescrip + 1
	call tcs_fillstruct (tp, cp, "", descrip[ndescrip])

end