Copy the contents of a SpiceCell of any data type to another cell of the same type.
VARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- cell I Cell to be copied. copy O New cell.
cell is a cell of character, double precision, or integer data type.
copy is a cell which contains the same elements as the input cell, in the same order.
This routine is used primarily to manipulate working cells, since many routines that use cells (binary set routines, for instance) do not allow cells to be combined or manipulated in place.
In the following example, copy_c is used to copy the result of the union of two character CSICE sets from a temporary working set back into the one of the original set. #include "SpiceUsr.h" . . . /. Declare the cell names with string length LNSIZE and maximum number of strings SIZE. ./ SPICECHAR_CELL ( bodies, SIZE, LNSIZE ); SPICECHAR_CELL ( planets, SIZE, LNSIZE ); SPICECHAR_CELL ( temp, SIZE, LNSIZE ); . . . union_c ( &bodies, &planets, &temp ); copy_c ( &temp, &bodies ); If the size of the temporary cell is greater than the size of the original set, the function failed_c should be checked to be sure that no overflow occurred. If bodies is at least as large as temp, no such check is necessary.
1) If the cell arguments don't have matching data types, the error SPICE(TYPEMISMATCH) is signaled. 2) If the output cell in not large enough to hold the elements of the input cell, the error SPICE(CELLTOOSMALL) is signaled. 3) If the cell arguments have character type and the length of the elements of the output cell is less than the length of the elements of the input cell, the error SPICE(INSUFFLEN) is signaled.
N.J. Bachman (JPL) C.A. Curzon (JPL) W.L. Taber (JPL) I.M. Underwood (JPL)
-CSPICE Version 1.0.0, 08-AUG-2002 (NJB) (CAC) (WLT) (IMU)
copy a character cell