From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/qpoe/qpioclose.x | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 sys/qpoe/qpioclose.x (limited to 'sys/qpoe/qpioclose.x') diff --git a/sys/qpoe/qpioclose.x b/sys/qpoe/qpioclose.x new file mode 100644 index 00000000..78893487 --- /dev/null +++ b/sys/qpoe/qpioclose.x @@ -0,0 +1,49 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include "qpio.h" + +# QPIO_CLOSE -- Close the QPIO descriptor. If writing to the event list, +# the output bucket is automatically flushed and the event list header updated. + +procedure qpio_close (io) + +pointer io #I QPIO descriptor + +begin + if (IO_DEBUG(io) > 1) { + call eprintf ("qpio_close (%xX)\n") + call pargi (io) + } + + call qpio_sync (io) + + if (IO_EX(io) != NULL && IO_EXCLOSE(io) == YES) + call qpex_close (IO_EX(io)) + if (IO_PL(io) != NULL && IO_PLCLOSE(io) == YES) + call pl_close (IO_PL(io)) + if (IO_FD(io) != NULL) + call close (IO_FD(io)) + + if (IO_BP(io) != NULL) + call mfree (IO_BP(io), TY_SHORT) + if (IO_RL(io) != NULL) + call mfree (IO_RL(io), TY_INT) + if (IO_MINEVL(io) != NULL) + call mfree (IO_MINEVL(io), TY_SHORT) + if (IO_MAXEVL(io) != NULL) + call mfree (IO_MAXEVL(io), TY_SHORT) + if (IO_YLENVP(io) != NULL) + call mfree (IO_YLENVP(io), TY_INT) + if (IO_YOFFVP(io) != NULL) + call mfree (IO_YOFFVP(io), TY_INT) + if (IO_DD(io) != NULL) + call mfree (IO_DD(io), TY_STRUCT) + if (IO_BBMASK(io) != NULL) + call plr_close (IO_BBMASK(io)) + if (IO_PARAM(io) != NULL) + call mfree (IO_PARAM(io), TY_CHAR) + if (IO_MASK(io) != NULL) + call mfree (IO_MASK(io), TY_CHAR) + + call mfree (io, TY_STRUCT) +end -- cgit