void dafgh_c ( SpiceInt * handle )
Return (get) the handle of the DAF currently being searched.
DAF
FILES
Variable I/O Description
-------- --- --------------------------------------------------
handle O Handle for current DAF.
None.
handle is the handle for the current DAF (the handle
connected to the DAF that is currently being
actively searched).
None.
1) If this routine is called when no search is in progress in the
the current DAF, the error SPICE(DAFNOSEARCH) is signaled.
2) If the DAF whose handle is to be returned has actually been
closed, the error will be diagnosed by routines called by
this routine.
This function returns the handle of a DAF that is currently
being searched.
Under rare circumstances, it may be necessary to identify
the particular DAF that is being searched (such as when
the search is begun by one module and continued by another).
Consider a program like the following, which examines the
individual arrays in a DAF and examines the contents of those
meeting certain criteria.
#include "SpiceUsr.h"
...
dafopw_c ( fname, &handle );
dafbfs_c ( handle );
daffna_c ( &found );
while ( found )
{
check_segment ( status );
if ( eqstr_c( status, "EXAMINE" ) )
{
examine_segment();
}
daffna_c ( &found );
}
The function check_segment, which assumes that a search is in
progress, gets the summary and name for the current array, and
uses them to decide whether the data in the array merit further
consideration.
void check_segment ( status )
...
dafgs_c ( sum );
dafgn_c ( name );
dafus_c ( sum, nd, ni, dc, ic );
...
[ set status ]
...
The function examine_segment examines the data in
the array itself. In order to do do, it needs to have access
not only to the summary, but to the handle of the file
containing the array. This is provided by dafgh_c.
void examine_segment()
...
dafgs_c ( sum );
dafus_c ( sum, nd, ni, dc, ic );
dafgh_c ( &handle );
dafgda_c ( handle, begin, end, data );
...
None.
NAIF Document 167.0, "Double Precision Array Files (DAF)
Specification and User's Guide"
N.J. Bachman (JPL)
W.L. Taber (JPL)
I.M. Underwood (JPL)
-CSPICE Version 1.0.0, 19-JUL-2011 (NJB)
get daf handle
Link to routine dafgh_c source file dafgh_c.c
|