blob: 78893487d44512f0046bef5136bbc07a399449a8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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
|