1 /* zzgetbff.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 ZZGETBFF ( Private --- Get Binary File Format ) */
zzgetbff_(integer * bffid)9 /* Subroutine */ int zzgetbff_(integer *bffid)
10 {
11 /* Initialized data */
12
13 static integer int1st[4] = { 1075576832,0,16444,16864 };
14 static integer int2nd[4] = { 0,1075576832,0,0 };
15
16 /* System generated locals */
17 integer i__1, i__2;
18 static doublereal equiv_0[1];
19
20 /* Builtin functions */
21 integer s_rnge(char *, integer, char *, integer);
22
23 /* Local variables */
24 integer i__;
25 #define dequiv (equiv_0)
26 #define iequiv ((integer *)equiv_0)
27
28 /* $ Abstract */
29
30 /* SPICE Private routine intended solely for the support of SPICE */
31 /* routines. Users should not call this routine directly due */
32 /* to the volatile nature of this routine. */
33
34 /* Fetch binary file format. */
35
36 /* $ Disclaimer */
37
38 /* THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
39 /* CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
40 /* GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
41 /* ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
42 /* PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
43 /* TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
44 /* WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
45 /* PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
46 /* SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
47 /* SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
48
49 /* IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
50 /* BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
51 /* LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
52 /* INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
53 /* REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
54 /* REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
55
56 /* RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
57 /* THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
58 /* CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
59 /* ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
60
61 /* $ Required_Reading */
62
63 /* None. */
64
65 /* $ Keywords */
66
67 /* PRIVATE */
68
69 /* $ Declarations */
70
71 /* $ Abstract */
72
73 /* Parameter declarations for the DAF/DAS handle manager. */
74
75 /* $ Disclaimer */
76
77 /* THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
78 /* CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
79 /* GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
80 /* ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
81 /* PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
82 /* TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
83 /* WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
84 /* PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
85 /* SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
86 /* SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
87
88 /* IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
89 /* BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
90 /* LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
91 /* INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
92 /* REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
93 /* REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
94
95 /* RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
96 /* THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
97 /* CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
98 /* ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
99
100 /* $ Required_Reading */
101
102 /* DAF, DAS */
103
104 /* $ Keywords */
105
106 /* PRIVATE */
107
108 /* $ Particulars */
109
110 /* This include file contains parameters defining limits and */
111 /* integer codes that are utilized in the DAF/DAS handle manager */
112 /* routines. */
113
114 /* $ Restrictions */
115
116 /* None. */
117
118 /* $ Author_and_Institution */
119
120 /* F.S. Turner (JPL) */
121
122 /* $ Literature_References */
123
124 /* None. */
125
126 /* $ Version */
127
128 /* - SPICELIB Version 2.5.0, 10-MAR-2014 (BVS) */
129
130 /* Updated for SUN-SOLARIS-64BIT-INTEL. */
131
132 /* - SPICELIB Version 2.4.0, 10-MAR-2014 (BVS) */
133
134 /* Updated for PC-LINUX-64BIT-IFORT. */
135
136 /* - SPICELIB Version 2.3.0, 10-MAR-2014 (BVS) */
137
138 /* Updated for PC-CYGWIN-GFORTRAN. */
139
140 /* - SPICELIB Version 2.2.0, 10-MAR-2014 (BVS) */
141
142 /* Updated for PC-CYGWIN-64BIT-GFORTRAN. */
143
144 /* - SPICELIB Version 2.1.0, 10-MAR-2014 (BVS) */
145
146 /* Updated for PC-CYGWIN-64BIT-GCC_C. */
147
148 /* - SPICELIB Version 2.0.0, 12-APR-2012 (BVS) */
149
150 /* Increased FTSIZE (from 1000 to 5000). */
151
152 /* - SPICELIB Version 1.20.0, 13-MAY-2010 (BVS) */
153
154 /* Updated for SUN-SOLARIS-INTEL. */
155
156 /* - SPICELIB Version 1.19.0, 13-MAY-2010 (BVS) */
157
158 /* Updated for SUN-SOLARIS-INTEL-CC_C. */
159
160 /* - SPICELIB Version 1.18.0, 13-MAY-2010 (BVS) */
161
162 /* Updated for SUN-SOLARIS-INTEL-64BIT-CC_C. */
163
164 /* - SPICELIB Version 1.17.0, 13-MAY-2010 (BVS) */
165
166 /* Updated for SUN-SOLARIS-64BIT-NATIVE_C. */
167
168 /* - SPICELIB Version 1.16.0, 13-MAY-2010 (BVS) */
169
170 /* Updated for PC-WINDOWS-64BIT-IFORT. */
171
172 /* - SPICELIB Version 1.15.0, 13-MAY-2010 (BVS) */
173
174 /* Updated for PC-LINUX-64BIT-GFORTRAN. */
175
176 /* - SPICELIB Version 1.14.0, 13-MAY-2010 (BVS) */
177
178 /* Updated for PC-64BIT-MS_C. */
179
180 /* - SPICELIB Version 1.13.0, 13-MAY-2010 (BVS) */
181
182 /* Updated for MAC-OSX-64BIT-INTEL_C. */
183
184 /* - SPICELIB Version 1.12.0, 13-MAY-2010 (BVS) */
185
186 /* Updated for MAC-OSX-64BIT-IFORT. */
187
188 /* - SPICELIB Version 1.11.0, 13-MAY-2010 (BVS) */
189
190 /* Updated for MAC-OSX-64BIT-GFORTRAN. */
191
192 /* - SPICELIB Version 1.10.0, 18-MAR-2009 (BVS) */
193
194 /* Updated for PC-LINUX-GFORTRAN. */
195
196 /* - SPICELIB Version 1.9.0, 18-MAR-2009 (BVS) */
197
198 /* Updated for MAC-OSX-GFORTRAN. */
199
200 /* - SPICELIB Version 1.8.0, 19-FEB-2008 (BVS) */
201
202 /* Updated for PC-LINUX-IFORT. */
203
204 /* - SPICELIB Version 1.7.0, 14-NOV-2006 (BVS) */
205
206 /* Updated for PC-LINUX-64BIT-GCC_C. */
207
208 /* - SPICELIB Version 1.6.0, 14-NOV-2006 (BVS) */
209
210 /* Updated for MAC-OSX-INTEL_C. */
211
212 /* - SPICELIB Version 1.5.0, 14-NOV-2006 (BVS) */
213
214 /* Updated for MAC-OSX-IFORT. */
215
216 /* - SPICELIB Version 1.4.0, 14-NOV-2006 (BVS) */
217
218 /* Updated for PC-WINDOWS-IFORT. */
219
220 /* - SPICELIB Version 1.3.0, 26-OCT-2005 (BVS) */
221
222 /* Updated for SUN-SOLARIS-64BIT-GCC_C. */
223
224 /* - SPICELIB Version 1.2.0, 03-JAN-2005 (BVS) */
225
226 /* Updated for PC-CYGWIN_C. */
227
228 /* - SPICELIB Version 1.1.0, 03-JAN-2005 (BVS) */
229
230 /* Updated for PC-CYGWIN. */
231
232 /* - SPICELIB Version 1.0.1, 17-JUL-2002 */
233
234 /* Added MAC-OSX environments. */
235
236 /* - SPICELIB Version 1.0.0, 07-NOV-2001 */
237
238 /* -& */
239
240 /* Unit and file table size parameters. */
241
242 /* FTSIZE is the maximum number of files (DAS and DAF) that a */
243 /* user may have open simultaneously. */
244
245
246 /* RSVUNT is the number of units protected from being locked */
247 /* to a particular handle by ZZDDHHLU. */
248
249
250 /* SCRUNT is the number of units protected for use by scratch */
251 /* files. */
252
253
254 /* UTSIZE is the maximum number of logical units this manager */
255 /* will utilize at one time. */
256
257
258 /* Access method enumeration. These parameters are used to */
259 /* identify which access method is associated with a particular */
260 /* handle. They need to be synchronized with the STRAMH array */
261 /* defined in ZZDDHGSD in the following fashion: */
262
263 /* STRAMH ( READ ) = 'READ' */
264 /* STRAMH ( WRITE ) = 'WRITE' */
265 /* STRAMH ( SCRTCH ) = 'SCRATCH' */
266 /* STRAMH ( NEW ) = 'NEW' */
267
268 /* These values are used in the file table variable FTAMH. */
269
270
271 /* Binary file format enumeration. These parameters are used to */
272 /* identify which binary file format is associated with a */
273 /* particular handle. They need to be synchronized with the STRBFF */
274 /* array defined in ZZDDHGSD in the following fashion: */
275
276 /* STRBFF ( BIGI3E ) = 'BIG-IEEE' */
277 /* STRBFF ( LTLI3E ) = 'LTL-IEEE' */
278 /* STRBFF ( VAXGFL ) = 'VAX-GFLT' */
279 /* STRBFF ( VAXDFL ) = 'VAX-DFLT' */
280
281 /* These values are used in the file table variable FTBFF. */
282
283
284 /* Some random string lengths... more documentation required. */
285 /* For now this will have to suffice. */
286
287
288 /* Architecture enumeration. These parameters are used to identify */
289 /* which file architecture is associated with a particular handle. */
290 /* They need to be synchronized with the STRARC array defined in */
291 /* ZZDDHGSD in the following fashion: */
292
293 /* STRARC ( DAF ) = 'DAF' */
294 /* STRARC ( DAS ) = 'DAS' */
295
296 /* These values will be used in the file table variable FTARC. */
297
298
299 /* For the following environments, record length is measured in */
300 /* characters (bytes) with eight characters per double precision */
301 /* number. */
302
303 /* Environment: Sun, Sun FORTRAN */
304 /* Source: Sun Fortran Programmer's Guide */
305
306 /* Environment: PC, MS FORTRAN */
307 /* Source: Microsoft Fortran Optimizing Compiler User's Guide */
308
309 /* Environment: Macintosh, Language Systems FORTRAN */
310 /* Source: Language Systems FORTRAN Reference Manual, */
311 /* Version 1.2, page 12-7 */
312
313 /* Environment: PC/Linux, g77 */
314 /* Source: Determined by experiment. */
315
316 /* Environment: PC, Lahey F77 EM/32 Version 4.0 */
317 /* Source: Lahey F77 EM/32 Language Reference Manual, */
318 /* page 144 */
319
320 /* Environment: HP-UX 9000/750, FORTRAN/9000 Series 700 computers */
321 /* Source: FORTRAN/9000 Reference-Series 700 Computers, */
322 /* page 5-110 */
323
324 /* Environment: NeXT Mach OS (Black Hardware), */
325 /* Absoft Fortran Version 3.2 */
326 /* Source: NAIF Program */
327
328
329 /* The following parameter defines the size of a string used */
330 /* to store a filenames on this target platform. */
331
332
333 /* The following parameter controls the size of the character record */
334 /* buffer used to read data from non-native files. */
335
336 /* $ Brief_I/O */
337
338 /* VARIABLE I/O DESCRIPTION */
339 /* -------- --- -------------------------------------------------- */
340 /* BFFID O Binary file format code for this system. */
341
342 /* $ Detailed_Input */
343
344 /* None. */
345
346 /* $ Detailed_Output */
347
348 /* BFFID is an integer code that indicates the binary file */
349 /* format that is determined to be native to this */
350 /* platform. Possible values are: */
351
352 /* BIGI3E */
353 /* LTLI3E */
354 /* VAXGFL */
355 /* VAXDFL */
356
357 /* as defined in the include file 'zzddhman.inc'. */
358
359 /* $ Parameters */
360
361 /* None. */
362
363 /* $ Files */
364
365 /* None. */
366
367 /* $ Exceptions */
368
369 /* Error free. */
370
371 /* 1) If the platform on which this code is compiled does not */
372 /* produce results that match any of the known binary file */
373 /* formats, this routine sets BFFID to 0. */
374
375 /* $ Particulars */
376
377 /* This simple program: */
378
379 /* PROGRAM DPTEST */
380
381 /* DOUBLE PRECISION DPNUM */
382 /* INTEGER INNUM ( 2 ) */
383
384 /* EQUIVALENCE ( DPNUM, INNUM ) */
385
386 /* DPNUM = 7.0D0 */
387
388 /* WRITE (*,*) DPNUM */
389 /* WRITE (*,*) INNUM ( 1 ) */
390 /* WRITE (*,*) INNUM ( 2 ) */
391
392 /* END */
393
394 /* produces the following results on these representative platforms: */
395
396 /* Sun-Solaris (BIGI3E): */
397
398 /* 7.000000000 */
399 /* 1075576832 */
400 /* 0 */
401
402 /* PC-Linux (LTLI3E): */
403
404 /* 7.000000000 */
405 /* 0 */
406 /* 1075576832 */
407
408 /* Alpha-Gfloat (VAXGFL): */
409
410 /* 7.000000000 */
411 /* 16444 */
412 /* 0 */
413
414 /* Alpha-Dfloat (VAXDFL): */
415
416 /* 7.000000000 */
417 /* 16864 */
418 /* 0 */
419
420 /* This routine performs exactly the same decomposition of the */
421 /* double precision number 7.0D0 into two integers. The results */
422 /* are checked against those displayed here, and if a match is */
423 /* found, returned. */
424
425 /* $ Examples */
426
427 /* See ZZDDHOPN for sample usage. */
428
429 /* $ Restrictions */
430
431 /* This routine derives the binary file format ID for a particular */
432 /* platform, but for verification purposes only. ZZPLATFM should */
433 /* be used to obtain the binary file format for the current platform. */
434
435 /* $ Author_and_Institution */
436
437 /* F.S. Turner (JPL) */
438
439 /* $ Literature_References */
440
441 /* None. */
442
443 /* $ Version */
444
445 /* - SPICELIB Version 1.0.0, 06-AUG-2002 (FST) */
446
447
448 /* -& */
449
450 /* Local Parameters */
451
452
453 /* Local Variables */
454
455
456 /* Copy DPVALU into the equivalenced DP, DEQUIV. */
457
458 *dequiv = 7.;
459
460 /* Examine the integer pairs, to identify the binary */
461 /* file format. */
462
463 *bffid = 0;
464 for (i__ = 1; i__ <= 4; ++i__) {
465 if (iequiv[0] == int1st[(i__1 = i__ - 1) < 4 && 0 <= i__1 ? i__1 :
466 s_rnge("int1st", i__1, "zzgetbff_", (ftnlen)215)] && iequiv[1]
467 == int2nd[(i__2 = i__ - 1) < 4 && 0 <= i__2 ? i__2 : s_rnge(
468 "int2nd", i__2, "zzgetbff_", (ftnlen)215)]) {
469 *bffid = i__;
470 }
471 }
472 return 0;
473 } /* zzgetbff_ */
474
475 #undef iequiv
476 #undef dequiv
477
478
479