diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /sys/qpoe/qpioclose.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/qpoe/qpioclose.x')
-rw-r--r-- | sys/qpoe/qpioclose.x | 49 |
1 files changed, 49 insertions, 0 deletions
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 |