dtm_set_type(3DTM)

NAME
dtm_set_type, dtm_get_type - Set and get the data type tag in the header.

SYNOPSIS
#include <dtm.h>

dtm_set_type(char *header, DTMTYPE data_type)

dtm_get_type(char *header, DTMTYPE *data_type)

DESCRIPTION
dtm_set_type inserts into the character string header the DTM type tag DT immediately followed by another tag identifying the type of the data. The tag type can be one of DTM_CHAR, DTM_SHORT, DTM_INT, DTM_FLOAT, DTM_DOUBLE, DTM_COMPLEX, or DTM_TRIPLET. It is the user's responsibility to ensure that the data type specified matches the data sent.

dtm_get_type examines the character string header, and if the DTM type tag TTL is found, sets the argument data_type to be the suceeding type value. The defined values that can be returned are DTM_CHAR, DTM_SHORT, DTM_INT, DTM_FLOAT, DTM_DOUBLE, DTM_COMPLEX, and DTM_TRIPLET. If the type tag is not found within the header, the data_type argument receives a default value of DTM_FLOAT.

SEE ALSO
DTM

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

BUGS
dtm_set_type has no way of determining if the string 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.