From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- noao/digiphot/daophot/daolib/dpapheader.x | 56 +++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 noao/digiphot/daophot/daolib/dpapheader.x (limited to 'noao/digiphot/daophot/daolib/dpapheader.x') diff --git a/noao/digiphot/daophot/daolib/dpapheader.x b/noao/digiphot/daophot/daolib/dpapheader.x new file mode 100644 index 00000000..898f9dab --- /dev/null +++ b/noao/digiphot/daophot/daolib/dpapheader.x @@ -0,0 +1,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 -- cgit