1 /* daslla.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 DASLLA ( DAS, last logical addresses ) */
daslla_(integer * handle,integer * lastc,integer * lastd,integer * lasti)9 /* Subroutine */ int daslla_(integer *handle, integer *lastc, integer *lastd,
10 integer *lasti)
11 {
12 integer free;
13 extern /* Subroutine */ int chkin_(char *, ftnlen);
14 integer ncomc, ncomr;
15 extern /* Subroutine */ int dashfs_(integer *, integer *, integer *,
16 integer *, integer *, integer *, integer *, integer *, integer *);
17 integer lastla[3], lastrc[3];
18 extern /* Subroutine */ int chkout_(char *, ftnlen);
19 integer lastwd[3], nresvc;
20 extern logical return_(void);
21 integer nresvr;
22
23 /* $ Abstract */
24
25 /* Return last DAS logical addresses of character, double precision */
26 /* and integer type that are currently in use in a specified DAS */
27 /* file. */
28
29 /* $ Disclaimer */
30
31 /* THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
32 /* CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
33 /* GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
34 /* ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
35 /* PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
36 /* TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
37 /* WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
38 /* PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
39 /* SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
40 /* SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
41
42 /* IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
43 /* BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
44 /* LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
45 /* INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
46 /* REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
47 /* REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
48
49 /* RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
50 /* THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
51 /* CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
52 /* ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
53
54 /* $ Required_Reading */
55
56 /* DAS */
57
58 /* $ Keywords */
59
60 /* ARRAY */
61 /* DAS */
62 /* UTILITY */
63
64 /* $ Declarations */
65 /* $ Brief_I/O */
66
67 /* Variable I/O Description */
68 /* -------- --- -------------------------------------------------- */
69 /* HANDLE I DAS file handle. */
70 /* LASTC O Last character address in use. */
71 /* LASTD O Last double precision address in use. */
72 /* LASTI O Last integer address in use. */
73 /* CHR P Parameter indicating character data type. */
74 /* DP P Parameter indicating double precision data type. */
75 /* INT P Parameter indicating integerer data type. */
76
77 /* $ Detailed_Input */
78
79 /* HANDLE is the file handle of a DAS file whose active */
80 /* logical address ranges are desired. */
81
82 /* $ Detailed_Output */
83
84 /* LASTC, */
85 /* LASTD, */
86 /* LASTI are, respectively, the last logical addresses of */
87 /* character, double precision, and integer type in */
88 /* use in the specified DAS file. */
89
90 /* $ Parameters */
91
92 /* CHR, */
93 /* DP, */
94 /* INT are data type specifiers which indicate */
95 /* `character', `double precision', and `integer' */
96 /* respectively. These parameters are used in */
97 /* all DAS routines that require a data type */
98 /* specifier as input. */
99
100 /* $ Exceptions */
101
102 /* 1) If the input file handle is invalid, the error will be */
103 /* diagnosed by routines called by this routine. */
104
105 /* $ Files */
106
107 /* None. */
108
109 /* $ Particulars */
110
111 /* This routine is a utility that allows a calling program to */
112 /* find the range of logical addresses currently in use in any */
113 /* DAS file. */
114
115 /* $ Examples */
116
117 /* 1) Create a DAS file containing 10 integers, 5 double precision */
118 /* numbers, and 4 characters, then use DASLLA to find the logical */
119 /* address ranges in use. */
120
121 /* C */
122 /* C Use a scratch file, since there's no reason to keep */
123 /* C the file. */
124 /* C */
125 /* C */
126 /* CALL DASOPS ( HANDLE ) */
127
128 /* DO I = 1, 10 */
129 /* CALL DASADI ( HANDLE, 1, I ) */
130 /* END DO */
131
132 /* DO I = 1, 5 */
133 /* CALL DASADD ( HANDLE, 1, DBLE(I) ) */
134 /* END DO */
135
136 /* CALL DASADC ( HANDLE, 1, 'SPUD' ) */
137
138 /* C */
139 /* C Now check the logical address ranges. */
140 /* C */
141 /* CALL DASLLA ( HANDLE, LASTC, LASTD, LASTI ) */
142
143 /* WRITE (*,*) 'Last character address in use: ', LASTC */
144 /* WRITE (*,*) 'Last d.p. address in use: ', LASTD */
145 /* WRITE (*,*) 'Last integer address in use: ', LASTI */
146
147
148 /* The output of this code fragment should be: */
149
150 /* Last character address in use: 4 */
151 /* Last d.p. address in use: 5 */
152 /* Last integer address in use: 10 */
153
154
155 /* $ Restrictions */
156
157 /* None. */
158
159 /* $ Literature_References */
160
161 /* None. */
162
163 /* $ Author_and_Institution */
164
165 /* N.J. Bachman (JPL) */
166 /* W.L. Taber (JPL) */
167
168 /* $ Version */
169
170 /* - SPICELIB Version 1.0.0, 11-NOV-1992 (NJB) (WLT) */
171
172 /* -& */
173 /* $ Index_Entries */
174
175 /* return last logical addresses in DAS file */
176 /* return logical address range of DAS file */
177 /* -& */
178
179 /* SPICELIB functions */
180
181
182 /* Local variables */
183
184
185 /* Standard SPICE error handling. */
186
187 if (return_()) {
188 return 0;
189 } else {
190 chkin_("DASLLA", (ftnlen)6);
191 }
192
193 /* The file summary for the indicated DAS file contains all of the */
194 /* information we need. */
195
196 dashfs_(handle, &nresvr, &nresvc, &ncomr, &ncomc, &free, lastla, lastrc,
197 lastwd);
198 *lastc = lastla[0];
199 *lastd = lastla[1];
200 *lasti = lastla[2];
201 chkout_("DASLLA", (ftnlen)6);
202 return 0;
203 } /* daslla_ */
204
205