aboutsummaryrefslogtreecommitdiff
path: root/pkg/tbtables/tbyoff.x
blob: c7c335139b1964357bc400fc6a11e4748acc9dd5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
include "tbtables.h"

# tbyoff -- Y column offset
# This function returns the offset in char from the beginning of the
# table data file to a specific element in the table.
# This is for column-ordered tables.

long procedure tbyoff (tp, cp, rownum)

pointer tp			# i: pointer to table descriptor
pointer cp			# i: pointer to column descriptor
int	rownum			# i: the row number

long	offset

begin
	offset = TB_BOD(tp) + COL_OFFSET(cp) * TB_ALLROWS(tp) +
		(rownum-1) * COL_LEN(cp)
	return (offset)
end