dtm_set_address(3DTM)

NAME
dtm_set_address, dtm_get_address - Set and retrieve the supplied address in the header.

SYNOPSIS
#include <dtm.h>

dtm_set_address(char *header, char *address)

dtm_get_address(char *header, char *address, int size)

DESCRIPTION
dtm_set_address inserts the DTM address tag PORT followed by the null-terminated character string address into the character string header. There is no restriction as what the address string may contain, but it is highly recommended that the form header:portnumber as returned by DTMgetPortAddr be used.

dtm_get_address examines the character string header and upon locating the DTM address tag PORT, stores the succeeding delimited string in the variable address. Memory for the address string must be allocated by the user before attempting to extract the address contained in the header. Size indicates the number of characters available for storing the address. If there is an insufficient amount of space for the entire address as contained in the header, the address is truncated.

SEE ALSO
DTM

DIAGNOSTICS
dtm_get_address returns the error DTMERROR if the DTM address tag PORT is not contained within the character string header, or if following the tag there is no delimited address string. Otherwise, dtm_get_address returns a 0 value.

BUGS
dtm_set_address has no way of determining if the string header contains sufficient space to hold the DTM address tag PORT and the address string itself. The results of attempting to store this information beyond the end of the allocated space are undefined.