Index Page dafgsr_c

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

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

       void dafgsr_c  ( SpiceInt        handle,
                        SpiceInt        recno,
                        SpiceInt        begin,
                        SpiceInt        end,
                        SpiceDouble   * data,
                        SpiceBoolean  * found  )

#### Abstract

       Read a portion of the contents of a summary record in a DAF file.

#### Required_Reading

       DAF

#### Keywords

       FILES

#### Brief_I/O

       Variable  I/O  Description
       --------  ---  --------------------------------------------------
       handle     I   Handle of DAF.
       recno      I   Record number.
       begin      I   First word to read from record.
       end        I   Last word to read from record.
       data       O   Contents of record.
       found      O   True if record is found.

#### Detailed_Input

       handle      is the handle associated with a DAF.

       recno       is the record number of a particular double precision
                   record within the DAF, whose contents are to be read.
                   DAF record numbers start at 1.

       begin       is the first word in the specified record to be
                   returned.  For compatibility with SPICELIB, word
                   numbers range from 1 to 128.

       end         is the final word in the specified record to be
                   returned.  For compatibility with SPICELIB, word
                   numbers range from 1 to 128.

#### Detailed_Output

       data        contains the specified portion (from `begin' to `end',
                   inclusive) of the specified record.

       found       is SPICETRUE when the specified record is found, and is
                   SPICEFALSE otherwise.

#### Parameters

       None.

#### Exceptions

       1) Bad values for `begin' and `end' (begin < 1, end < begin,
          etc.) are not signaled as errors, but result in the actions
          implied by the pseudo-code:

             for ( j = 0, i = max(1,begin);  i <= max(128,end);  i++, j++ )
             {
                data[j] =  buffered_DAF_record[i];
             }

       2) If `handle' is invalid, the error will be diagnosed by
          routines called by this routine.

#### Files

       The input handle must refer to a DAF that is open for read or write
       access.

#### Particulars

       dafgsr_c checks the DAF record buffer to see if the requested
       record can be returned without actually reading it from
       external storage. If not, it reads the record and stores
       it in the buffer, typically removing another record from
       the buffer as a result.

       Once in the buffer, the specified portion of the record is
       returned.

#### Examples

       The following code fragment illustrates one way that dafgsr_c
       and dafwdr_ can be used to update part of a summary record.
       If the record does not yet exist, we can assume that it is
       filled with zeros.

          #include "SpiceUsr.h"
          #include "SpiceZfc.h"

          SpiceInt    size   = 128;
          SpiceInt    recno;
          SpiceInt    handle;
              .
              .
              .
          dafgsr_c ( handle, recno, 1, 128, drec, &found );

          if ( !found )
          {
              cleard_ ( &size, drec );
          }

          for ( i = first;  i <= last;  i++ )
          {
              drec[i] = new_value[i];
          }

          dafwdr_ ( &handle, &recno, drec );

       Note that since only entire records may be written using dafwdr_,
       the entire record needs to be read also.

#### Restrictions

       None.

#### Literature_References

       None.

#### Author_and_Institution

       N.J. Bachman    (JPL)
       F.S. Turner     (JPL)

#### Version

       -CSPICE Version 1.0.0, 17-JUN-2009 (NJB) (FST)

#### Index_Entries

       read daf summary record

#### Link to routine dafgsr_c source file dafgsr_c.c

    Wed Apr  5 17:54:31 2017