aboutsummaryrefslogtreecommitdiff
path: root/vo/votools/t_votcopy.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 /vo/votools/t_votcopy.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'vo/votools/t_votcopy.x')
-rw-r--r--vo/votools/t_votcopy.x45
1 files changed, 45 insertions, 0 deletions
diff --git a/vo/votools/t_votcopy.x b/vo/votools/t_votcopy.x
new file mode 100644
index 00000000..8a115227
--- /dev/null
+++ b/vo/votools/t_votcopy.x
@@ -0,0 +1,45 @@
+#
+# VOTCOPY -- Copy a VOTable from one format to another.
+
+
+procedure t_votcopy ()
+
+char in[SZ_LINE], out[SZ_LINE], format[SZ_LINE]
+int inlist, outlist
+bool header, verbose
+
+int clpopni(), clplen(), clgfil(), vot_convert()
+bool clgetb()
+
+begin
+ # Get the task parameters.
+ inlist = clpopni ("input")
+ outlist = clpopni ("output")
+
+ call clgstr ("format", format, SZ_LINE)
+ header = clgetb ("header")
+ verbose = clgetb ("verbose")
+
+ if (clplen (inlist) != clplen (outlist)) {
+ call eprintf ("Number of input and output files not the same.\n")
+ call clpcls (inlist)
+ call clpcls (outlist)
+ return
+ }
+
+ # Loop over the files,
+ while (clgfil (inlist, in, SZ_LINE) != EOF &&
+ (clgfil (outlist, out, SZ_LINE) != EOF)) {
+
+ if (vot_convert (in, out, format) == ERR)
+ break
+ }
+
+ call clpcls (inlist)
+ call clpcls (outlist)
+
+ # Don't save the calling parameters.
+ call clpstr ("input", "")
+ call clpstr ("output", "")
+ call clpstr ("format", "")
+end