Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.stsci.edu/~sontag/spicedocs/cspice/kdata_c.html
Дата изменения: Sat Dec 17 06:09:12 2005 Дата индексирования: Sun Apr 10 23:26:11 2016 Кодировка: Поисковые слова: iapetus |
Return data for the nth kernel that is among a list of specified kernel types.
None.
VARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- which I Index of kernel to fetch from the list of kernels. kind I The kind of kernel to which fetches are limited. fillen I Available space in output file string. typlen I Available space in output kernel type string. srclen I Available space in output source string. file O The name of the kernel file. 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.
which is the number of the kernel to fetch (matching the type specified by kind) from the list of kernels that have been loaded through the entry point furnsh_c but that have not been unloaded through the entry point unload_c. The range of which is 0 to count-1, where count is the number of kernels loaded via furnsh_c. This count may be obtained by calling ktotal_c. See the Examples section for an illustrative code fragment. kind is a list of types of kernels to be considered when fetching kernels from the list of loaded kernels. KIND should consist of a list of words of kernels to examine. Recognized types are SPK --- All SPK files are counted in the total. CK --- All CK files are counted in the total. PCK --- All binary PCK files are counted in the total. EK --- All EK files are counted in the total. TEXT --- All text kernels that are not meta-text kernels are included in the total. META --- All meta-text kernels are counted in the total. ALL --- Every type of kernel is counted in the total. kind is case insensitive. If a word appears in kind that is not one of those listed above it is ignored. See the entry point ktotal_c for examples of the use of kind. fillen is the amount of available space in the output file string, including room for the terminating null. Normally, this is the declared length of the output string. 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.
file is the name of the file having index which in the sequence of files of type kind currently loaded via furnsh_c. file will be blank if there is no such kernel is loaded. filtyp is the type of the kernel specified by file. filtyp will be empty if there is no file matching the specification of which and kind. 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 there is no file matching the specification of which and kind, 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 there is no file matching the specification of which and kind, handle will be set to zero. found is returned SPICETRUE if a file matching the specification of which and kind exists. If there is no such file, found will be set to SPICEFALSE.
None.
This entry point allows you to determine which kernels have been loaded via furnsh_c and to obtain information sufficient to directly query those files.
The following example shows how you could print a summary of SPK files that have been loaded through the interface furnsh_c. #include <stdio.h> #include "SpiceUsr.h" #define FILLEN 128 #define TYPLEN 32 #define SRCLEN 128 SpiceInt which; SpiceInt handle; SpiceChar file [FILLEN]; SpiceChar filtyp[TYPLEN]; SpiceChar source[SRCLEN]; SpiceBoolean found; . . . ktotal_c ( "spk", &count ); if ( count == 0 ) { printf ( "No SPK files loaded at this time.\n" ); } else { printf ( "The loaded SPK files are: \n\n" ); } for ( which = 0; which < count; which++ ) { kdata_c ( which, "spk", FILLEN, TYPLEN, SRCLEN, file, filtyp, &source, &handle, &found ); printf ( "%s\n", file ); }
None.
1) If a file is not loaded matching the specification of which and kind, found will be SPICEFALSE; file, filtyp, and source will be empty and handle will be set to zero. 2) If any input or output character argument pointer is null, the error SPICE(NULLPOINTER) will be signaled. 3) If any of the output string length arguments are less than 1, the error SPICE(STRINGTOOSHORT) will be signaled. 4) If any 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.
None.
N.J. Bachman (JPL) W.L. Taber (JPL)
None.
-CSPICE Version 1.1.1, 29-DEC-2004 (LSE) Corrected example code to match routine's argument list. (2 arguments reversed) -CSPICE Version 1.1.0, 02-FEB-2003 (EDW) Corrected example code to match routine's argument list. -CSPICE Version 1.0.0, 12-SEP-1999 (NJB) (WLT)
Retrieve information on loaded SPICE kernels