1 /* ekcls.f -- translated by f2c (version 19980913).
2 You must link the resulting object file with the libraries:
3 -lf2c -lm (in that order)
4 */
5
6 #include "f2c.h"
7
8 /* $Procedure EKCLS ( EK, close file ) */
ekcls_(integer * handle)9 /* Subroutine */ int ekcls_(integer *handle)
10 {
11 extern /* Subroutine */ int chkin_(char *, ftnlen), dascls_(integer *),
12 chkout_(char *, ftnlen);
13 extern logical return_(void);
14
15 /* $ Abstract */
16
17 /* Close an E-kernel. */
18
19 /* $ Disclaimer */
20
21 /* THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
22 /* CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
23 /* GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
24 /* ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
25 /* PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
26 /* TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
27 /* WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
28 /* PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
29 /* SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
30 /* SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
31
32 /* IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
33 /* BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
34 /* LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
35 /* INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
36 /* REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
37 /* REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
38
39 /* RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
40 /* THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
41 /* CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
42 /* ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
43
44 /* $ Required_Reading */
45
46 /* EK */
47
48 /* $ Keywords */
49
50 /* EK */
51 /* FILES */
52 /* UTILITY */
53
54 /* $ Declarations */
55 /* $ Brief_I/O */
56
57 /* Variable I/O Description */
58 /* -------- --- -------------------------------------------------- */
59 /* HANDLE I EK file handle. */
60
61 /* $ Detailed_Input */
62
63 /* HANDLE is the file handle of an EK to be closed. Note */
64 /* that EKs open for writing must be closed by this */
65 /* routine in order by be valid. */
66
67 /* $ Detailed_Output */
68
69 /* None. */
70
71 /* $ Parameters */
72
73 /* None. */
74
75 /* $ Exceptions */
76
77 /* 1) If the indicated file is not recognized, no error is */
78 /* signalled. */
79
80 /* 2) If an I/O error occurs while reading or writing the indicated */
81 /* file, the error will be diagnosed by routines called by this */
82 /* routine. */
83
84 /* $ Files */
85
86 /* See the EK Required Reading for a discussion of the EK file */
87 /* format. */
88
89 /* $ Particulars */
90
91 /* This routine should be used to close open EK files. EK files */
92 /* open for writing *must* be closed by this routine in order to be */
93 /* valid. EK files open for read access should also be closed using */
94 /* this routine. */
95
96 /* EKs open for reading won't be corrupted if closed via a FORTRAN */
97 /* CLOSE statement, but the underlying bookkeeping software will */
98 /* become confused if an EK is closed this way---so we recommend */
99 /* closing EK files with EKCLS exclusively. */
100
101 /* $ Examples */
102
103 /* 1) Add data to an existing EK file, then close the file. */
104
105 /* CALL EKOPW ( 'MY.EK', HANDLE ) */
106
107 /* [add data] */
108
109 /* CALL EKCLS ( HANDLE ) */
110
111
112 /* $ Restrictions */
113
114 /* 1) No more than FTSIZE DAS files may be opened simultaneously. */
115 /* See DASFM for the value of FTSIZE. */
116
117 /* $ Literature_References */
118
119 /* None. */
120
121 /* $ Author_and_Institution */
122
123 /* N.J. Bachman (JPL) */
124
125 /* $ Version */
126
127 /* - SPICELIB Version 1.0.1, 31-MAR-1998 (NJB) */
128
129 /* Corrected Index_Entries section. */
130
131 /* - SPICELIB Version 1.0.0, 26-SEP-1995 (NJB) */
132
133 /* -& */
134 /* $ Index_Entries */
135
136 /* close EK */
137
138 /* -& */
139
140 /* SPICELIB functions */
141
142
143 /* Standard SPICE error handling. */
144
145 if (return_()) {
146 return 0;
147 } else {
148 chkin_("EKCLS", (ftnlen)5);
149 }
150
151 /* Close the file as a DAS file. */
152
153 dascls_(handle);
154 chkout_("EKCLS", (ftnlen)5);
155 return 0;
156 } /* ekcls_ */
157
158