Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.stsci.edu/~sontag/spicedocs/cspice/appndc_c.html
Дата изменения: Sat Dec 17 06:08:28 2005 Дата индексирования: Sun Apr 10 23:56:44 2016 Кодировка: Поисковые слова: http astrokuban.info astrokuban |
Append an item to a character cell.
CELLS
VARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- item I The item to append. cell I/O The cell to which item will be appended.
item is a character string which is to be appended to cell. cell is a character SpiceCell to which item will be appended.
cell is the input SpiceCell with item appended. item is the last member of cell. If cell is actually a CSPICE set on input and ceases to qualify as a set as result of the append operation, the isSet member of cell will be set to SPICEFALSE.
None.
None.
1) In the following example, the item "PLUTO" is appended to the character cell planets. planets is declared with string length NAMLEN. #include "SpiceUsr.h" . . . /. Declare the cell with string length NAMLEN and with maximum number of elements MAXSIZ. ./ SPICECHAR_CELL ( planets, MAXSIZ, NAMLEN ); . . . /. Before appending "PLUTO", suppose the cell planets' data array contains: Element 0: == "MERCURY" Element 1: == "VENUS" Element 2: == "EARTH" Element 3: == "MARS" Element 4: == "JUPITER" Element 5: == "SATURN" Element 6: == "URANUS" Element 7: == "NEPTUNE" Append the string "PLUTO" at index 8, and update the cell's cardinality. ./ appndc_c ( "PLUTO", &planets ); /. The cell's data array now has the contents Element 0: == "MERCURY" Element 1: == "VENUS" Element 2: == "EARTH" Element 3: == "MARS" Element 4: == "JUPITER" Element 5: == "SATURN" Element 6: == "URANUS" Element 7: == "NEPTUNE" Element 8: == "PLUTO" ./
1) String comparisons performed by this routine are Fortran-style: trailing blanks in the input array or key value are ignored. This gives consistent behavior with CSPICE code generated by the f2c translator, as well as with the Fortran SPICE Toolkit. Note that this behavior is not identical to that of the ANSI C library functions strcmp and strncmp.
1) If the input cell argument is a SpiceCell of type other than character, the error SPICE(TYPEMISMATCH) is signaled. 2) If the cell is not large enough to accommodate the addition of a new element, the error SPICE(CELLTOOSMALL) is signaled. 3) If the length of the item is longer than the length of the cell, ITEM is truncated on the right. 4) If on input cell is actually a CSPICE set, that is, it contains sorted elements with no duplicates, and if item is not strictly greater than the last element, on output the isSet member of cell will be set to SPICEFALSE. This case is not considered an error. 5) If the input string pointer is null, the error SPICE(NULLPOINTER) is signaled.
None.
N.J. Bachman (JPL) H.A. Neilan (JPL)
None.
-CSPICE Version 1.0.0, 21-AUG-2002 (NJB) (HAN)
append an item to a character cell