From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- pkg/tbtables/tbtflu.x | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 pkg/tbtables/tbtflu.x (limited to 'pkg/tbtables/tbtflu.x') diff --git a/pkg/tbtables/tbtflu.x b/pkg/tbtables/tbtflu.x new file mode 100644 index 00000000..145c6930 --- /dev/null +++ b/pkg/tbtables/tbtflu.x @@ -0,0 +1,34 @@ +include +include "tbtables.h" +include "tblerr.h" + +# tbtflu -- call flush +# This routine writes the size-information record (in case the number of +# rows or columns has changed) and then flushes the fio buffer for the table. +# +# Phil Hodge, 2-Nov-1988 Subroutine created. +# Phil Hodge, 14-Jan-1992 Add option for text table type. +# Phil Hodge, 20-Jun-1995 Add option for FITS tables. + +procedure tbtflu (tp) + +pointer tp # i: pointer to table descriptor +#-- + +begin + if (TB_TYPE(tp) == TBL_TYPE_TEXT) + return # don't do anything for text file + + if (TB_TYPE(tp) == TBL_TYPE_FITS) + return # don't do anything for FITS file + + if (TB_FILE(tp) == NULL) + call error (ER_TBNOTOPEN, "tbtflu: table is not open") + + if (TB_READONLY(tp)) + call error (ER_TBREADONLY, "tbtflu: table is readonly") + + call tbtwsi (tp) # write size-info record + + call flush (TB_FILE(tp)) +end -- cgit