From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- vo/votools/t_votsize.x | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 vo/votools/t_votsize.x (limited to 'vo/votools/t_votsize.x') 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 +include + + +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 -- cgit