aboutsummaryrefslogtreecommitdiff
path: root/pkg/utilities/nttools/threed/titable/tiupdate.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/utilities/nttools/threed/titable/tiupdate.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/utilities/nttools/threed/titable/tiupdate.x')
-rw-r--r--pkg/utilities/nttools/threed/titable/tiupdate.x39
1 files changed, 39 insertions, 0 deletions
diff --git a/pkg/utilities/nttools/threed/titable/tiupdate.x b/pkg/utilities/nttools/threed/titable/tiupdate.x
new file mode 100644
index 00000000..ebfe9b75
--- /dev/null
+++ b/pkg/utilities/nttools/threed/titable/tiupdate.x
@@ -0,0 +1,39 @@
+include <tbset.h>
+
+# TIUPDATE -- Opens an already existing output table for update.
+#
+#
+#
+# Revision history:
+# ----------------
+# 20-Jan-97 - Task created (I.Busko)
+# 17-Mar-97 - Replaced code by tbcnum call (IB)
+
+
+procedure tiupdate (output, otp, cpo, ncpo)
+
+char output[ARB] # i: table name
+pointer otp # o: table descriptor
+pointer cpo # o: column descriptor
+int ncpo # o: number of columns
+#--
+int i
+
+errchk tbtopn
+
+pointer tbtopn(), tbcnum()
+int tbpsta()
+
+begin
+ # Open table and get its size.
+ otp = tbtopn (output, READ_WRITE, NULL)
+ ncpo = tbpsta (otp, TBL_NCOLS)
+
+ # Alloc column descriptor array. This
+ # must be freed by caller.
+ call malloc (cpo, ncpo, TY_INT)
+
+ # Fill array with column info.
+ do i = 1, ncpo
+ Memi[cpo+i-1] = tbcnum (otp, i)
+end