SDS_SET_DATATYPE(3)
NAME
sds_set_data sds_set_datatype sds_set_fillval
sds_set_fillvalue sds_set_numbytes sds_set_stream
-a set of functions to set the data array, data type, and
fill value.
SYNOPSIS
#include <soi_sds.h>
int sds_set_data(SDS *sds, void *data)
int sds_set_datatype(SDS *sds, int datatype)
int sds_set_fillval(SDS *sds, void *fillvalue)
int sds_set_fillvalue(SDS *sds, void *fillvalue)
int sds_fill_data(SDS *sds, void *fillvalue)
int sds_set_numbytes(SDS *sds, int numbytes)
int sds_set_stream(SDS *sds, FILE *fp)
DESCRIPTION
sds_set_data associates a previously allocated data array
with the sds->data member. Any space previously pointed to
by this member is freed.
sds_set_datatype sets the data type of a sds. It can only
be used if the sds->data pointer is NULL.
sds_set_fillval and sds_set_fillvalue set the fill value of
an sds. The fill value is used to represent invalid (miss-
ing) data, and is only considered meaningful if the data are
of fixed-point (integer) type. If the fill value is already
set, sds_set_fillval will first convert any missing data to
the new fill value. If any valid data happen to be equal to
the new fill value they will be marked as invalid. If
called with a NULL pointer to fillvalue, sds_set_fillval
will null the fillvalue member of the sds, effectively mak-
ing all data valid. If the data are of a floating-point
type other than type SDS_TIME, sds_set_fillval is a noop.
sds_set_fillvalue is obsolete; it should not be used.
sds_fill_data fills the data array of an sds with values
equal to the datum pointed to by the valid fillvalue
pointer. If the fillvalue pointer is null, the data array
is filled with the default fill value for the corresponding
data type. If the data type is fixed-point, sds->fillvalue
is set to the fillvalue pointer. The data array is created
if necessary, but its type and size must already be known.
sds_set_numbytes sets the number of bytes in a data word of
a sds
sds_set_stream sets the filepointer into an SDS
DIAGNOSTICS
These functions set and return an error status, zero if all
is well and an appropriate value if not. sds_set_datatype()
returns the error code MAKES_NO_SENSE if the sds data
pointer is non-NULL and does not change anything.
FILES
SEE ALSO
sds_free()
BUGS
sds_set_datatype does not check for consistency of the
numeric argument with a supported data type.
sds_set_fillvalue does not handle existing invalid data in a
graceful way. if called with a NULL pointer,
sds_set_fillvalue sets the fill value to a default for the
data type.
sds_set_numbytes lacks consistency checks; it should never
be used.
HISTORY
1998-01-27 SOI Version 2.8