dtm_set_char(3DTM)

NAME
dtm_set_char, dtm_get_char - Low level string insertion and retrieval functions.

dtm_set_float, dtm_get_float - Low level floating point insertion and retrieval functions.

dtm_set_int, dtm_get_int - Low level integer insertion and retrieval functions.

SYNOPSIS
#include <dtm.h>

void dtm_set_char(char *header, char *tag, char *string)

int dtm_get_char(char *header, char *tag, char *string)

void dtm_set_float(char *header, char *tag, float fval)

int dtm_get_float(char *header, char *tag, float *fval)

void dtm_set_int(char *header, char *tag, int ival)

int dtm_get_int(char *header, char *tag, int *ival)

DESCRIPTION
These functions all append a tag value and a particular type of data to the end of the character string header. The tag value must be a null-terminated character string. In general, this function is reused by subclasses to ensure a particular subclass's uniqueness. Therefore, the tag value should be considered private data that is unique to that particular class.

dtm_set_char appends the string string onto the end of the character string header imediately following the tag. The string value must be a null-terminated character string. The value of string is surrounded by the delimiter "'" to ensure that the string does not cause conflicts with other information already present in the header.

dtm_set_float appends the string representation of the floating point value fval onto the end of the character string header imediately following the tag.

dtm_set_int appends the string representation of the integer value ival onto the end of the character string header, imediately following the tag.

dtm_get_char examines the character string header for the string tag. If the tag is present, the string following the tag is placed in the previously allocated character string string. If the tag value is absent from the header or if no strings exist following the tag, dtm_get_char returns the value DTMERROR.

dtm_get_int examines the character string header for the string tag. If the tag is present, the string following the tag is converted to an integer and is returned in ival. If the tag value is absent from the header or if no integers exist following the tag, dtm_get_int returns the value DTMERROR.

dtm_get_float examines the character string header for the string tag. If the tag is present, the string following the tag is converted to a floating point value and is returned in the argument fval. If the tag value is absent from the header or if no strings exist following the tag, dtm_get_char returns the value DTMERROR.

For examples of how these macros are used in the creation of new subclasses, examine the header files of the classes supplied, e.g. sds.h.

SEE ALSO
DTM

DIAGNOSTICS

The functions that get values from the header return the value DTMERROR is the specified tag to find is non-existant, or if there are no values of the desired type following the tag.

BUGS
The functions that set values in the header have no way of determining if the header contains sufficient space to hold the tag and the supplied value. The results of attempting to store this information beyond the end of the allocated space are undefined.