aboutsummaryrefslogtreecommitdiff
path: root/noao/digiphot/daophot/daolib/dpapheader.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /noao/digiphot/daophot/daolib/dpapheader.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'noao/digiphot/daophot/daolib/dpapheader.x')
-rw-r--r--noao/digiphot/daophot/daolib/dpapheader.x56
1 files changed, 56 insertions, 0 deletions
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