#include "statio.h"
FUNCTION long c_stput (fd, data_type, ic, is, shape, buf)
long *fd; char *data_type; long *ic; long *is; long shape[9]; unsigned char *buf;
File descriptor of an opened statistics file. The file descriptor is set by c_stopen() and should not be altered.
The data type to write. This is the name of the statistical data item. Some examples are: "NBANDS," "HISTOGRAM," "MEAN_VECTOR," "POLYGON," etc. The data types "CLASSLIST" and "SITELIST" are reserved by the Stat I/O software and should not be used.
The index of the class to be written to. Class numbers have the range 1 - 100. Zero can be given to specify that image level data is to be written. In that case, is must also be zero. If ic is one greater than the number of existing classes and is is zero, then a new class is created.
The index of the site to be written to. Site numbers have the range 1 - 100. If zero is given and ic is also zero, then image level data is written. If ic is a valid class number and is is zero, then class level data for that class is written. If is s one greater than the number of sites for the specified class, then a new site is created for that class.
The shape vector for the data. Shape is an array of nine elements. See c_stget() for a detailed description of the parameter shape.
The buffer to write data from. The data type should be in the shape array.
The c_stput() routine locates the node indicated by ic and is and looks for the data type at that level. If found, the data there is replaced by the new data. If not found, new data is entered at the proper level. To create a new class or new site, specify ic or is to be one greater than the number of classes or number of sites as the case may be. Both operations can be combined by specifying both with a value of one greater than the current value.
c_stput() returns
E_DTOLD (9) --> old data replaced (no message) E_DTNEW (10) --> new data entered (no message) E_NOCL (2) --> no class ic - node (ic, is) created and data entered (no message) E_NOSI (3) --> no site is - node (ic, is) created and data entered (no message) E_INVCL (11) --> class ic not found/invalid class index given (no message) E_INVSI (12) --> site is not found/invalid site index given (no message) E_INVDT (13) --> error in data_type (no message) E_GNLIO (1) --> general I/O error (no message) E_INVNM (14) --> class or site name too long (no message)