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
daslla_c

Table of contents
Procedure
Abstract
Required_Reading
Keywords
Brief_I/O
Detailed_Input
Detailed_Output
Parameters
Exceptions
Files
Particulars
Examples
Restrictions
Literature_References
Author_and_Institution
Version
Index_Entries

Procedure

   daslla_c ( DAS, last logical addresses ) 

   void daslla_c ( SpiceInt            handle,
                   SpiceInt          * lastc,
                   SpiceInt          * lastd,
                   SpiceInt          * lasti  )

Abstract

   Return last DAS logical addresses of character, double precision
   and integer type that are currently in use in a specified DAS
   file.

Required_Reading

   DAS

Keywords

   ARRAY
   DAS
   UTILITY


Brief_I/O

   VARIABLE  I/O  DESCRIPTION
   --------  ---  --------------------------------------------------
   handle     I   DAS file handle.
   lastc      O   Last character address in use.
   lastd      O   Last double precision address in use.
   lasti      O   Last integer address in use.

Detailed_Input

   handle      is the file handle of a DAS file whose active
               logical address ranges are desired.

Detailed_Output

   lastc,
   lastd,
   lasti       are, respectively, the last 1-based logical addresses of
               character, double precision, and integer type in use in
               the specified DAS file.

Parameters

   None.

Exceptions

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

Files

   None.

Particulars

   This routine is a utility that allows a calling program to
   find the range of logical addresses currently in use in any
   DAS file.

Examples

   The numerical results shown for this example may differ across
   platforms. The results depend on the SPICE kernels used as
   input, the compiler and supporting libraries, and the machine
   specific arithmetic implementation.

   1) Create a DAS file containing 10 integers, 5 double precision
      numbers, and 4 characters, then use daslla_c to find the logical
      address ranges in use.


      Example code begins here.


      /.
         Program daslla_ex1
      ./
      #include <stdio.h>
      #include <string.h>
      #include "SpiceUsr.h"

      int main( )
      {

         /.
         Local parameters.
         ./
         #define FNAME        "daslla_ex1.das"

         /.
         Local variables.
         ./
         ConstSpiceChar     * ifname;
         ConstSpiceChar     * type;

         SpiceDouble          dbli;

         SpiceInt             handle;
         SpiceInt             i;
         SpiceInt             lastc;
         SpiceInt             lastd;
         SpiceInt             lasti;

         /.
         Open a new DAS file. Use the file name as the internal
         file name, and reserve no records for comments.
         ./
         type   = "TEST";
         ifname = "TEST.DAS/NAIF/NJB/11-NOV-1992-20:12:20";

         dasonw_c ( FNAME, type, ifname, 0, &handle );

         for ( i = 1; i <= 10; i++ )
         {
            dasadi_c ( handle, 1, &i );
         }

         for ( i = 1; i <= 5; i++ )
         {
            dbli = (double)i;
            dasadd_c ( handle, 1, &dbli );
         }

         dasadc_c ( handle, 4, 0, 3, 5, "SPUD" );

         /.
         Now check the logical address ranges.
         ./
         daslla_c ( handle, &lastc, &lastd, &lasti );

         printf( "Last character address in use: %d\n", lastc );
         printf( "Last d.p. address in use     : %d\n", lastd );
         printf( "Last integer address in use  : %d\n", lasti );

         /.
         Close the DAS file.
         ./
         dascls_c ( handle );

         return ( 0 );
      }


      When this program was executed on a Mac/Intel/cc/64-bit
      platform, the output was:


      Last character address in use: 4
      Last d.p. address in use     : 5
      Last integer address in use  : 10


      Note that after run completion, a new DAS file exists in the
      output directory.

Restrictions

   None.

Literature_References

   None.

Author_and_Institution

   J. Diaz del Rio     (ODC Space)

Version

   -CSPICE Version 1.0.0, 30-JUN-2021 (JDR)

Index_Entries

   return last logical addresses in DAS file
   return logical address range of DAS file
Fri Dec 31 18:41:03 2021