From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- pkg/utilities/nttools/stxtools/od/odget.x | 56 +++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 pkg/utilities/nttools/stxtools/od/odget.x (limited to 'pkg/utilities/nttools/stxtools/od/odget.x') 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 +#--------------------------------------------------------------------------- -- cgit