aboutsummaryrefslogtreecommitdiff
path: root/pkg/utilities/nttools/threed/txtable/txthv.gx
blob: d965f704ca4c5699c6931396304feb5afab6f06c (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#
# TXTHV  --  Write scalar value into header.
#
#
#
#
#  Revision history:
#  ----------------
#
#  22-Nov-96  -  Task created (I.Busko)

$if (datatype == c)
procedure txthvt (otp, col, buf)
$else
procedure txthv$t (otp, col, buf)
$endif

pointer	otp		# i: table descriptor
int	col		# i: column number in input table
$if (datatype == c)
char	buf[ARB]	# i: value to be written
$else
PIXEL	buf
$endif
#--
pointer	keyword

begin
	# Use original column number to build keyword name.
	call malloc (keyword, SZ_LINE, TY_CHAR)
	call sprintf (Memc[keyword], SZ_LINE, "TCV_%03d")
	    call pargi (col)

	$if (datatype == c)
	call tbhadt (otp, Memc[keyword], buf)
	$endif
	$if (datatype == i)
	call tbhadi (otp, Memc[keyword], buf)
	$endif
	$if (datatype == s)
	call tbhadi (otp, Memc[keyword], int(buf))
	$endif
	$if (datatype == b)
	call tbhadb (otp, Memc[keyword], buf)
	$endif
	$if (datatype == r)
	call tbhadr (otp, Memc[keyword], buf)
	$endif
	$if (datatype == d)
	call tbhadd (otp, Memc[keyword], buf)
	$endif

	call mfree (keyword, TY_CHAR)
end