From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- pkg/tbtables/tbfchp.x | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 pkg/tbtables/tbfchp.x (limited to 'pkg/tbtables/tbfchp.x') diff --git a/pkg/tbtables/tbfchp.x b/pkg/tbtables/tbfchp.x new file mode 100644 index 00000000..b88153d4 --- /dev/null +++ b/pkg/tbtables/tbfchp.x @@ -0,0 +1,27 @@ +include "tbtables.h" + +# tbfchp -- chop rows off the end of a FITS table +# This routine deletes rows at the end of a table. +# +# Phil Hodge, 6-Mar-1998 Subroutine created. + +procedure tbfchp (tp, ndel) + +pointer tp # i: pointer to table descriptor +int ndel # i: number of rows to be deleted +#-- +int nrows # number of rows in the table before deleting +int status +errchk tbferr + +begin + nrows = TB_NROWS(tp) + + status = 0 + call fsdrow (TB_FILE(tp), max (1, nrows-ndel+1), ndel, status) + if (status > 0) + call tbferr (status) + + # Change the value of TB_NROWS. + TB_NROWS(tp) = max (0, nrows - ndel) +end -- cgit