aboutsummaryrefslogtreecommitdiff
path: root/pkg/utilities/nttools/stxtools/od/odget.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /pkg/utilities/nttools/stxtools/od/odget.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'pkg/utilities/nttools/stxtools/od/odget.x')
-rw-r--r--pkg/utilities/nttools/stxtools/od/odget.x56
1 files changed, 56 insertions, 0 deletions
diff --git a/pkg/utilities/nttools/stxtools/od/odget.x b/pkg/utilities/nttools/stxtools/od/odget.x
new file mode 100644
index 00000000..013acc67
--- /dev/null
+++ b/pkg/utilities/nttools/stxtools/od/odget.x
@@ -0,0 +1,56 @@
+include "od.h"
+
+#---------------------------------------------------------------------------
+.help od_get Feb93 source
+.ih
+NAME
+od_get -- Retrieve data from file.
+.ih
+USAGE
+.nf
+call od_getd (od, data)
+.fi
+.ih
+ARGUMENTS
+.ls od (pointer :input)
+The OD I/O descriptor.
+.le
+.ls data (double[ARB] :output)
+The data from the OD file.
+.le
+.endhelp
+#---------------------------------------------------------------------------
+procedure od_get (od, data)
+
+pointer od # I: The OD I/O descriptor.
+double data[ARB] # O: The data.
+
+pointer null # Null flag array for table IO.
+
+# Functions
+pointer imgl1d()
+
+errchk gf_opengr, imgl1d, malloc, mfree, tbcgtd
+
+begin
+ # Check if a file is actually opened. If not, do nothing.
+ if (od != NULL) {
+
+ # Get data depending on file type.
+ switch (OD_TYPE(od)) {
+ case OD_TABLE:
+ call malloc (null, OD_LEN(od), TY_BOOL)
+ call tbcgtd (OD_FD(od), OD_CD(od,OD_GRP(od)), data, Memb[null],
+ 1, OD_LEN(od))
+ call mfree (null, TY_BOOL)
+
+ case OD_IMAGE:
+
+ # Retrieve the data.
+ call amovd (Memd[imgl1d(OD_FD(od))], data, OD_LEN(od))
+ }
+ }
+end
+#---------------------------------------------------------------------------
+# End of od_get
+#---------------------------------------------------------------------------