diff options
Diffstat (limited to 'pkg/tbtables/tbtflu.x')
-rw-r--r-- | pkg/tbtables/tbtflu.x | 34 |
1 files changed, 34 insertions, 0 deletions
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 <tbset.h> +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 |