void kclear_c ( void )
Clear the KEEPER subsystem: unload all kernels, clear the kernel
pool, and re-initialize the subsystem. Existing watches on kernel
variables are retained.
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
None. This routine operates by side effects. See Particulars
1) Any errors that occur when setting a kernel pool watch
or checking watched variables will be diagnosed by
routines in the call tree of this routine.
This entry point allows you re-initialize the KEEPER system with
a single call. The KEEPER system is the kernel management system
underlying the set of CSPICE APIs
This routine unloads all kernels from their kernel-type-specific
kernel management subsystems (SPKBSR, CKBSR, etc.), clears the
kernel pool, clears KEEPER's internal file database, and re-sets
the watch status for the kernel variables used to load kernels
via meta-kernels. As a side effect of clearing the kernel pool,
all watched variables are marked as updated. Note that clearing
the kernel pool does not delete watchers.
This capability, though implemented in Fortran, is particularly
relevant to SPICE implementations such as Icy, for which the
state of the KEEPER system persists after any Icy-based IDL
script is run. Successive runs of Icy-based scripts may perform
in unexpected ways when scripts access data loaded during runs of
Cleaning up after such programs using explicit unload_c commands is
tedious and error-prone. One call to this routine sets the
KEEPER system to its initial state, preventing unintentional
interaction between scripts via KEEPER's state.
Clear the KEEPER system; check for residual loaded files.
We shouldn't find any.
ktotal_c ( "ALL", &n );
printf ( "Count of loaded kernels after kclear_c call\n", n );
Calling this routine will wipe out any kernel pool data
inserted via the p*pool_c API routines.
N.J. Bachman (JPL)
-CSPICE Version 1.0.1, 01-JUL-2014 (NJB)
The header Particulars section was updated to more
completely describe the effect of this routine on
kernel pool watchers. Header section order was corrected.
-CSPICE Version 1.0.0, 15-NOV-2006 (NJB)
Re-initialize the keeper system
Clear the keeper system
Unload all kernels