aboutsummaryrefslogtreecommitdiff
path: root/pkg/tbtables/tbfchp.x
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /pkg/tbtables/tbfchp.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/tbtables/tbfchp.x')
-rw-r--r--pkg/tbtables/tbfchp.x27
1 files changed, 27 insertions, 0 deletions
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