aboutsummaryrefslogtreecommitdiff
path: root/vo/votools/t_votsize.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_votsize.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'vo/votools/t_votsize.x')
-rw-r--r--vo/votools/t_votsize.x32
1 files changed, 32 insertions, 0 deletions
diff --git a/vo/votools/t_votsize.x b/vo/votools/t_votsize.x
new file mode 100644
index 00000000..6fae7049
--- /dev/null
+++ b/vo/votools/t_votsize.x
@@ -0,0 +1,32 @@
+#
+# VOTSIZE -- Simply get the size of a VOTable. We need to work on the
+# VOTable itself since the TABLES tasks don't generally behave well when
+# there are no rows in a table.
+
+include <ctype.h>
+include <votParse_spp.h>
+
+
+procedure t_votsize ()
+
+char in[SZ_LINE]
+char out[SZ_LINE], line[SZ_LINE]
+
+int fd, nchars
+int vx_voinfo(), open(), getline()
+
+begin
+ # Get the table name.
+ call clgstr ("input", in, SZ_LINE)
+
+ call mktemp ("/tmp/sz", out, SZ_LINE)
+ call vx_voinfo (3, "-s", out, in)
+
+ fd = open (out, READ_ONLY, TEXT_FILE)
+ nchars = getline (fd, line)
+ call close (fd)
+
+ call printf ("%s")
+ call pargstr (line)
+ call delete (out)
+end