Index of Functions: A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 
Index Page
cspice_dlabbs

Table of contents
Abstract
I/O
Parameters
Examples
Particulars
Exceptions
Files
Restrictions
Required_Reading
Literature_References
Author_and_Institution
Version
Index_Entries


Abstract


   CSPICE_DLABBS begins a backward segment search in a DLA file.

I/O


   Given:

      handle   the integer handle associated with the file to be searched.

               help, handle
                  LONG = Scalar

               This handle is used to identify the file in subsequent calls
               to other DLA or DAS routines.

   the call:

      cspice_dlabbs, handle, dladsc, found

   returns:

      dladsc   the descriptor of the last DLA segment in the file associated
               with `handle'.

               help, dladsc
                  LONG = Array[SPICE_DLA_DSCSIZ]

               The segment descriptor layout is:

                  +---------------+
                  | BACKWARD PTR  | Linked list backward pointer
                  +---------------+
                  | FORWARD PTR   | Linked list forward pointer
                  +---------------+
                  | BASE INT ADDR | Base DAS integer address
                  +---------------+
                  | INT COMP SIZE | Size of integer segment component
                  +---------------+
                  | BASE DP ADDR  | Base DAS d.p. address
                  +---------------+
                  | DP COMP SIZE  | Size of d.p. segment component
                  +---------------+
                  | BASE CHR ADDR | Base DAS character address
                  +---------------+
                  | CHR COMP SIZE | Size of character segment component
                  +---------------+

               `dladsc' is valid only if the output argument `found' is
               True

      found    a logical flag indicating whether a segment was found.

               help, found
                  BOOLEAN = Scalar

               `found' has the value True if the file contains at least one
               segment; otherwise `found' is False.

Parameters


   SPICE_DLA_DSCSIZ

               is the size of a SPICELIB DLA descriptor, defined in
               IcyDLA.pro.

Examples


   Any numerical results shown for this example may differ between
   platforms as the results depend on the SPICE kernels used as input
   and the machine specific arithmetic implementation.

   1) Open a DLA file for read access, traverse the segment
      list from back to front, and display segment address
      and size attributes.

      Example code begins here.


      PRO dlabbs_ex1

         ;;
         ;; IcyUser is a file that makes certain variables global.
         ;; You must call IcyUser to have access to the parameters used
         ;; in this example.
         ;;
         ;; To use the variables in IcyUser, add the 'src/icy' directory
         ;; to your IDL path by doing the following in which /path/to is the
         ;; local path to Icy.
         ;;
         ;;    pref_set, 'IDL_PATH', '/path/to/icy/src/icy:<IDL_DEFAULT>', $
         ;;                           /COMMIT
         ;;
         @IcyUser

         ;;
         ;; Prompt for the name of the file to search.
         ;;
         fname = ' '
         read, fname, PROMPT = 'Name of DLA file > '

         ;;
         ;; 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.
         ;;
         cspice_dasopr, fname, handle

         ;;
         ;; Count the segments in the file; this allows us
         ;; to label the segments in our display.
         ;;
         nsegs = 0L
         cspice_dlabbs, handle, dladsc, found

         while ( found ) do begin

            nsegs = nsegs + 1L
            currnt = dladsc
            cspice_dlafps, handle, currnt, dladsc, found

         endwhile

         ;;
         ;; Begin a backward search.  Let `dladsc' contain
         ;; the descriptor of the last segment.
         ;;
         segno = nsegs + 1L

         cspice_dlabbs, handle, dladsc, found

         while ( found ) do begin

            ;;
            ;; Display the contents of the current segment
            ;; descriptor.
            ;;
            segno = segno - 1L

            print, ' '
            print, ' '
            print, 'Segment number = ', segno
            print, ' '
            print, 'Backward segment pointer         = ',                    $
                                dladsc[SPICE_DLA_BWDIDX]
            print, 'Forward segment pointer          = ',                    $
                                dladsc[SPICE_DLA_FWDIDX]
            print, 'Character component base address = ',                    $
                                dladsc[SPICE_DLA_CBSIDX]
            print, 'Character component size         = ',                    $
                                dladsc[SPICE_DLA_CSZIDX]
            print, 'D.p. base address                = ',                    $
                                dladsc[SPICE_DLA_DBSIDX]
            print, 'D.p. component size              = ',                    $
                                dladsc[SPICE_DLA_DSZIDX]
            print, 'Integer base address             = ',                    $
                                dladsc[SPICE_DLA_IBSIDX]
            print, 'Integer component size           = ',                    $
                                dladsc[SPICE_DLA_ISZIDX]
            print, ' '

            ;;
            ;; Find the previous segment.
            ;;
            ;; To avoid using `dladsc' as both input and output
            ;; in the following call, we copy `dladsc'
            ;; into the variable `currnt'.  We then find the
            ;; segment preceding `currnt'.
            ;;
            currnt = dladsc
            cspice_dlafps, handle, currnt, dladsc, found

         endwhile

         ;;
         ;; Close the file using the DAS close routine.
         ;;
         cspice_dascls, handle

      END


      When this program was executed on a Mac/Intel/IDL8.x/64-bit
      platform, using the DSK file named phobos512.bds, the output
      was:


      Name of DLA file > phobos512.bds


      Segment number =            1

      Backward segment pointer         =           -1
      Forward segment pointer          =           -1
      Character component base address =            0
      Character component size         =            0
      D.p. base address                =            0
      D.p. component size              =      4737076
      Integer base address             =           11
      Integer component size           =     29692614


Particulars


   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
   type.

   This routine supports backward traversal of a DLA file's segment
   list. Note that it is not necessary to call this routine to
   conduct a backward traversal; all that is necessary is to have
   access to the last descriptor in the file, which this routine
   provides.

Exceptions


   1)  If the input file handle is invalid, an error is
       signaled by a routine in the call tree of this routine.

   2)  If an error occurs while reading the DLA file, the error
       is signaled by a routine in the call tree of this routine.

   3)  If the input descriptor is invalid, this routine will
       fail in an unpredictable manner.

   4)  If the input argument `handle' is undefined, an error is
       signaled by the IDL error handling system.

   5)  If the input argument `handle' is not of the expected type, or
       it does not have the expected dimensions and size, an error is
       signaled by the Icy interface.

   6)  If any of the output arguments, `dladsc' or `found', is not a
       named variable, an error is signaled by the Icy interface.

Files


   See description of input argument `handle'.

Restrictions


   None.

Required_Reading


   DAS.REQ
   DLA.REQ
   ICY.REQ

Literature_References


   None.

Author_and_Institution


   J. Diaz del Rio     (ODC Space)

Version


   -Icy Version 1.0.0, 16-JUL-2021 (JDR)

Index_Entries


   begin backward search in DLA file



Fri Dec 31 18:43:03 2021