aboutsummaryrefslogtreecommitdiff
path: root/pkg/utilities/nttools/stxtools/od/odunmp.x
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/utilities/nttools/stxtools/od/odunmp.x')
-rw-r--r--pkg/utilities/nttools/stxtools/od/odunmp.x44
1 files changed, 44 insertions, 0 deletions
diff --git a/pkg/utilities/nttools/stxtools/od/odunmp.x b/pkg/utilities/nttools/stxtools/od/odunmp.x
new file mode 100644
index 00000000..e776ecd7
--- /dev/null
+++ b/pkg/utilities/nttools/stxtools/od/odunmp.x
@@ -0,0 +1,44 @@
+include "od.h"
+
+#---------------------------------------------------------------------------
+.help od_unmap Feb93 source
+.ih
+NAME
+od_unmap -- Close the 1D image.
+.ih
+USAGE
+call od_unmap (od)
+.ih
+ARGUMENTS
+.ls od (input/output: pointer)
+The OD I/O descriptor. On return, the value will be NULL.
+.le
+.endhelp
+#---------------------------------------------------------------------------
+procedure od_unmap (od)
+
+pointer od # I: The OD I/O descriptor.
+
+errchk tbtclo, imunmap, mfree
+
+begin
+ if (od != NULL) {
+ switch (OD_TYPE(od)) {
+ case OD_TABLE:
+ call tbtclo (OD_FD(od))
+ call mfree (OD_CD_PTR(od), TY_POINTER)
+ case OD_IMAGE:
+ call mw_ctfree (OD_WL(od))
+ call mw_ctfree (OD_LW(od))
+ call mw_close (OD_MW(od))
+ call imunmap (OD_FD(od))
+ }
+
+ call mfree (OD_WSYS_PTR(od), TY_CHAR)
+ call mfree (OD_NAME_PTR(od), TY_CHAR)
+ call mfree (od, TY_STRUCT)
+ }
+end
+#---------------------------------------------------------------------------
+# End of od_unmap
+#---------------------------------------------------------------------------