void dlafns_c ( SpiceInt handle,
ConstSpiceDLADescr * descr,
SpiceDLADescr * nxtdsc,
SpiceBoolean * found )
Find the segment following a specified segment in a DLA file.
Variable I/O Description
-------- --- --------------------------------------------------
handle I Handle of open DLA file.
descr I Descriptor of a DLA segment.
nxtdsc O Descriptor of next segment in DLA file.
found O Flag indicating whether a segment was found.
handle is the DAS integer handle associated with the file to be
searched. This handle is used to identify the file in
subsequent calls to other DLA or DAS routines.
descr is the descriptor of the a DLA segment in the file
associated with `handle'.
nxtdsc is the descriptor of the next DLA segment following the
segment associated with the input argument `descr'.
`nxtdsc' is valid only if the output argument `found' is
found is a logical flag indicating whether the next segment was
found. `found' has the value SPICETRUE if the segment was
found; otherwise `found' is SPICEFALSE.
1) If the input file handle is invalid, the error will be
diagnosed by routines in the call tree of this routine.
2) If an error occurs while reading the DLA file, the error
will be diagnosed by routines in the call tree of this
3) If the input descriptor is invalid, this routine will
fail in an unpredictable manner.
See description of input argument `handle'.
DLA files are built using the DAS low-level format; DLA files are
a specialized type of DAS file in which data are organized as a
doubly linked list of segments. Each segment's data belong to
contiguous components of character, double precision, and integer
This routine supports forward traversal of a DLA file's segment
list. A forward traversal may be started from any segment in
the file; it is not necessary to call dlabfs_c first. The role
of dlabfs_c is simply to return the descriptor of the first
segment in the file.
1) Open a DLA file for read access, traverse the segment
list from front to back, and display segment address
and size attributes.
#define FILSIZ 256
SpiceChar fname [ FILSIZ ];
Prompt for the name of the file to search.
prompt_c ( "Name of DLA file > ", FILSIZ, fname );
Open the DLA file for read access. Since DLA
files use the DAS architecture, we can use DAS
routines to open and close the file.
dasopr_c ( fname, &handle );
Begin a forward search. Let `descr' contain
the descriptor of the first segment.
segno = 0;
dlabfs_c ( handle, &descr, &found );
while ( found )
Display the contents of the current segment
printf ( "\n"
"Segment number = %d\n"
" Backward segment pointer = %d\n"
" Forward segment pointer = %d\n"
" Integer component base address = %d\n"
" Integer component size = %d\n"
" D.p. component base address = %d\n"
" D.p. component size = %d\n"
" Character component base address = %d\n"
" Character component size = %d\n",
Find the next segment.
current = descr;
dlafns_c ( handle, ¤t, &descr, &found );
Close the file using the DAS close routine.
dascls_c ( handle );
return ( 0 );
The program outputs:
Name of DLA file > /kernels/gen/dsk/phobos_3_3.bds
Segment number = 1
Backward segment pointer = -1
Forward segment pointer = -1
Integer component base address = 11
Integer component size = 3311271
D.p. component base address = 0
D.p. component size = 494554
Character component base address = 0
Character component size = 0
N.J. Bachman (JPL)
-CSPICE Version 1.0.0, 09-JAN-2017 (NJB)(EDW)
Removed unnecessary include statements.
Updated header example.
DSKLIB Version 1.0.1, 23-JAN-2013 (NJB)
Added third exception description to the Exceptions
DSKLIB Version 1.0.0, 17-NOV-2009 (NJB)
find next segment in dla file