-
Notifications
You must be signed in to change notification settings - Fork 1
/
hdsStop.c
121 lines (99 loc) · 3.86 KB
/
hdsStop.c
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include "ems.h" /* EMS error reporting routines */
#include "hds.h" /* HDS function definitions */
#include "hds1.h" /* Global definitions for HDS */
#include "rec.h" /* Public rec_ definitions */
#include "str.h" /* Character string import/export macros */
#include "dat1.h" /* Internal dat_ definitions */
#include "dat_err.h" /* DAT__ error code definitions */
int
hdsStop( int *status)
{
/*
*+
* Name:
* HDS_STOP
* Purpose:
* Close down HDS.
* Language:
* ANSI C
* Invocation:
* CALL HDS_STOP( STATUS )
* Description:
* This routine closes down HDS, annulling all active locators,
* closing all container files and releasing all associated
* resources. It returns without action if HDS is not active.
* Arguments:
* STATUS = INTEGER (Given and Returned)
* The global status.
* Notes:
* This routine attempts to execute even if STATUS is set on entry,
* although no further error report will be made if it subsequently
* fails under these circumstances.
* Copyright:
* Copyright (C) 1992 Science & Engineering Research Council
* Copyright (C) 2006 Particle Physics and Astronomy Research Council.
* All Rights Reserved.
* Licence:
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA
* Authors:
* RFWS: R.F. Warren-Smith (STARLINK, RAL)
* BKM: B.K. McIlwrath (STARLINK, RAL)
* TIMJ: Tim Jenness (JAC, Hawaii)
* BC: Brad Cavanagh (JAC, Hawaii)
* {enter_new_authors_here}
* History:
* 4-APR-1991 (RFWS):
* Added prologue and error handling and made portable.
* 13-DEC-2001 (BKM):
* Convert to a C function with FORTRAN wrapper.
* 01-FEB-2005 (TIMJ):
* Free memory associated with the locator control queue
* 28-NOV-2006 (BC):
* Replace non-EMS code with call to hds1_cleanup.
* {enter_changes_here}
* Bugs:
* {note_any_bugs_here}
*-
*/
/* Local Variables: */
struct LCP *lcp; /* Pointer to Locator Control Packet */
/*. */
/* Begin a new error reporting context. */
emsBegin( status );
hds_gl_status = *status;
/* Check that HDS is active. There is nothing to do if it is not. */
if ( hds_gl_active )
{
/* Clean up HDS. */
hds1_cleanup( status );
/* If an error occurred, then report contextual information. */
if ( !_ok( hds_gl_status ) )
{
emsRep( "HDS_STOP_ERR",
"HDS_STOP: Error deactivating the Hierarchical Data \
System (HDS).",
&hds_gl_status );
}
}
/* End the error reporting context. */
*status = hds_gl_status;
emsEnd( status );
/* Exit the routine. */
return *status;
}