aboutsummaryrefslogtreecommitdiff
path: root/noao/digiphot/daophot/daolib/dpapheader.x
blob: 898f9dabbb1f682ddc013041ba516c1e11662585 (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
56
# DP_APHEADER -- Copy the text database column headers to another file.
# Consider placing this simple routine in the pttables library at some point.

procedure dp_apheader (in, out)

int	in		# input file descriptor
int	out		# output file descriptor

pointer	sp, line
int	getline()

begin
	call smark (sp)
	call salloc (line, SZ_LINE, TY_CHAR)

	while (getline (in, Memc[line]) != EOF) {
	    if (Memc[line] != '#')
		break
	    if (Memc[line+1] == 'N')
		break
	    call putline (out, Memc[line])
	}

	call seek (in, BOF)

	call sfree (sp)
end


# DP_APBANNER -- Copy the text database keyword definitions to another file.
# Consider placing this simple routine in the pttables library at some point.


procedure dp_apbanner (in, out)

int	in		# input file descriptor
int	out		# output file descriptor

pointer	sp, line
int	getline()

begin
	call smark (sp)
	call salloc (line, SZ_LINE, TY_CHAR)

	while (getline (in, Memc[line]) != EOF) {
	    if (Memc[line] != '#')
		break
	    if (Memc[line+1] == 'K')
		next
	    call putline (out, Memc[line])
	}
	call seek (in, BOF)

	call sfree (sp)
end