Index Page
kinfo_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 kinfo_c ( ConstSpiceChar  * file,
                  SpiceInt          typlen,
                  SpiceInt          srclen,
                  SpiceChar       * filtyp,
                  SpiceChar       * source,
                  SpiceInt        * handle,
                  SpiceBoolean    * found  )

Abstract

 
   Return information about a loaded kernel specified by name. 
 

Required_Reading

 
   None. 
 

Keywords

 
   KERNEL 
 

Brief_I/O

 
   VARIABLE  I/O  DESCRIPTION 
   --------  ---  -------------------------------------------------- 
   file       I   Name of a kernel to fetch information for 
   typlen     I   Available space in output kernel type string.
   srclen     I   Available space in output source string.
   filtyp     O   The type of the kernel. 
   source     O   Name of the source file used to load file. 
   handle     O   The handle attached to file. 
   found      O   SPICETRUE if the specified file could be located. 
 

Detailed_Input

 
   file        is the name of a kernel file for which descriptive 
               information is desired. 
 
   typlen      is the amount of available space in the output kernel 
               type string.
               
   srclen      is the amount of available space in the output kernel 
               source string.
               
               

Detailed_Output

 
   filtyp      is the type of the kernel specified by file.  filtyp 
               will be empty if file is not on the list of kernels
               loaded via furnsh_c. 
 
   source      is the name of the source file that was used to 
               specify file as one to load.  If file was loaded 
               directly via a call to furnsh_c, source will be empty. 
               If file is not on the list of kernels loaded via
               furnsh_c, source will be empty.
 
   handle      is the handle attached to file if it is a binary 
               kernel.  If file is a text kernel or meta-text kernel 
               handle will be zero. If file is not on the list of 
               kernels loaded via furnsh_c, handle will be set to zero.
 
   found       is returned SPICETRUE if the specified file exists.
               If there is no such file, found will be set to 
               SPICEFALSE. 
 

Parameters

 
   None. 
 

Exceptions

 
   1) If the specified file is not on the list of files that 
      are currently loaded via the interface furnsh_c, found 
      will be SPICEFALSE, handle will be set to zero and filtyp 
      and source will be set to empty strings. 
 
   2) If any input or output character argument pointer is null, the 
      error SPICE(NULLPOINTER) will be signaled.
      
   3) If either output string length argument is less than 1, the
      error SPICE(STRINGTOOSHORT) will be signaled. 

   4) If either output string has length at least 1 but is too short to
      contain the output string, the corresponding is truncated on the 
      right.  The output string is still null-terminated.
 

Files

 
   None. 
 

Particulars

 
   This routine allows you to request information directly 
   for a specific SPICE kernel. 
 

Examples

 
   Suppose you wish to determine the types of kernels loaded
   by a given meta-kernel. The following program shows 
   how you might use this routine to do this.

      #include <stdio.h>
      #include "SpiceUsr.h"

      #define  FILLEN   256
      #define  TYPLEN   33
      #define  SRCLEN   256

      SpiceInt        which;
      SpiceInt        count;
      SpiceInt        handle;

      SpiceChar       file  [FILLEN];
      SpiceChar       filtyp[TYPLEN];
      SpiceChar       source[SRCLEN];

      SpiceBoolean    found;

      int main()
         { 
         furnsh_c( "standard.tm" );
   
         ktotal_c ( "all", &count );
    
         if ( count == 0 )
            {
            printf ( "No files loaded at this time.\n" );
            }
         else
            {
            printf ( "The loaded files files are: \n\n" );
            }
    
         for ( which = 0;  which < count;  which++ )
            {

            kdata_c ( which,  "all",    FILLEN,   TYPLEN, SRCLEN, 
                     file,   filtyp,  source,  &handle,  &found ); 

            kinfo_c ( file, TYPLEN, SRCLEN, filtyp, source, &handle, &found );

               if (  eqstr_c ( filtyp, "SPK" )  )
                  {
                  printf ( "%s is an SPK file.\n", file );
                  }
               else if (  eqstr_c ( filtyp, "CK" )  )
                  {
                  printf ( "%s is a CK file.\n", file );
                  }
               else if (  eqstr_c ( filtyp, "PCK" )  )
                  {
                  printf ( "%s is a PCK file.\n", file );
                  }
               else if (  eqstr_c ( filtyp, "DSK" )  )
                  {
                  printf ( "%s is a DSK file.\n", file );
                  }
               else if (  eqstr_c ( filtyp, "EK" )  )
                  {
                  printf ( "%s is an EK file.\n", file );
                  }
               else if (  eqstr_c ( filtyp, "META" )  )
                  {
                  printf ( "%s is a meta-text kernel.\n", file );
                  }
               else 
                {
                printf ( "%s is a text kernel.\n", file );
                }                
             }
             return(0);
          }
      
 

Restrictions

 
   None.
 

Literature_References

 
   None. 
 

Author_and_Institution

 
   N.J. Bachman    (JPL)
   W.L. Taber      (JPL) 
   E.D. Wright     (JPL)

Version

   -CSPICE Version 1.2.0, 20-JAN-2016 (NJB)

      Updated header example program to support DSKs.
      Updated description of example program. Removed
      references to the term "entry point." Added
      Ed Wright as an author of this routine.

   -CSPICE Version 1.1.2, 02-MAY-2008 (EDW)

      standard.ker renamed standard.tm

   -CSPICE Version 1.1.1, 05-SEP-2007 (EDW)
 
      Expanded Examples section to a full, compilable program. 
 
   -CSPICE Version 1.1.0, 02-FEB-2003 (EDW)

      Corrected example code to match routine's argument list.

   -CSPICE Version 1.0.0, 01-SEP-1999 (NJB) (WLT)

Index_Entries

 
   Fetch information about a loaded SPICE kernel 
 

Link to routine kinfo_c source file kinfo_c.c

Wed Apr  5 17:54:37 2017