|
Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.stsci.edu/~sontag/spicedocs/cspice/kinfo_c.html
Дата изменения: Sat Dec 17 06:09:12 2005 Дата индексирования: Sun Apr 10 23:26:13 2016 Кодировка: |
Return information about a loaded kernel specified by name.
None.
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.
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.
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.
None.
This entry point allows you to request information directly for a specific SPICE kernel.
Suppose you wish to determine the type of a loaded kernel
so that you can call the correct summarizing routines
for the kernel. The following bit of pseudo code shows
how you might use this entry point together with summarizing
code to produce a report on the file. (Note that the
routines spk_summry, ck_summry, pck_summry and ek_summry
are simply names to indicate what you might do with the
information returned by kinfo_c. They are not routines that
are part of the SPICE Toolkit.)
#include <stdio.h>
#include "SpiceUsr.h"
#define TYPLEN 32
#define SRCLEN 128
SpiceChar filtyp[TYPLEN];
SpiceChar source[SRCLEN];
SpiceInt handle;
SpiceBoolean found;
.
.
.
file = "<name of the file of interest>";
kinfo_c ( file, TYPLEN, SRCLEN, filtyp, source, &handle, &found );
if ( !found )
{
printf ( "%s is not loaded at this time.\n", file );
}
else
{
/.
Note: eqstr_c is a CSPICE case-insensitive string comparison
function.
./
if ( eqstr_c ( filtyp, "SPK" ) )
{
printf ( "%s is an SPK file.\n", file );
spk_summry ( handle );
}
else if ( eqstr_c ( filtyp, "CK" ) )
{
printf ( "%s is a CK file.\n", file );
ck_summry ( handle );
}
else if ( eqstr_c ( filtyp, "PCK" ) )
{
printf ( "%s is a PCK file.\n", file );
pck_summry ( handle );
}
else if ( eqstr_c ( filtyp, "EK" ) )
{
printf ( "%s is an EK file.\n", file );
ek_summry ( handle );
}
else if ( eqstr_c ( filtyp, "META" ) )
{
printf ( "%s is a meta-text kernel.\n", file );
}
else
{
printf ( "%s is a text kernel.\n", file );
}
}
None.
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.
None.
N.J. Bachman (JPL) W.L. Taber (JPL)
None.
-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)
Fetch information about a loaded SPICE kernel