SDSsetType(3DTM)

NAME
SDSsetType, SDSgetType - Scientific data set typing macros.

SYNOPSIS
#include <sds.h>

SDSsetType(char *header, DTMTYPE data_type)

SDSgetType(char *header, DTMTYPE *data_type)

DESCRIPTION
SDSsetType inserts into the character string header the DTM type tag immediately followed by a tag identifying the data_type of the image. The tag type can be one of DTM_CHAR, DTM_SHORT, DTM_INT, DTM_FLOAT, DTM_DOUBLE, DTM_COMPLEX, or DTM_TRIPLET. See DTMclass for more information about these types. It is up to the user to ensure that the data type specified matches the data sent.

SDSgetType examines the character string header, and if the DTM type tag if found, sets the argument data_type to be the following value. The defined values that can be returned are DTM_CHAR, DTM_SHORT, DTM_INT, DTM_FLOAT, DTM_DOUBLE, DTM_COMPLEX, and DTM_TRIPLET. See DTMclass for more information about these types. If the DTM type tag was not found within the header, the data_type argument receives a default value of DTM_FLOAT.

SEE ALSO
DTM, SDSclass

DIAGNOSTICS
SDSgetType returns the error DTMERROR if the header does not contain the DTM type tag or if no value follows the tag. In either case, the value of data_type still defaults to DTM_FLOAT.

BUGS
SDSsetType has no way of determining if the header contains sufficient space to hold the DTM type tag and the data_type value. The results of attempting to store this information beyond the end of the allocated space are undefined.