Dynamic strings provide a mechanism for building up
arbitrarily long strings by gradually appending information.
If the dynamic string is short then there will be no memory
allocation overhead; as the string gets larger, additional
space will be allocated as needed.
TTTTccccllll____DDDDSSSSttttrrrriiiinnnnggggIIIInnnniiiitttt initializes a dynamic string to zero length.
The Tcl_DString structure must have been allocated by the
caller. No assumptions are made about the current state of
the structure; anything already in it is discarded. If the
structure has been used previously, TTTTccccllll____DDDDSSSSttttrrrriiiinnnnggggFFFFrrrreeeeeeee should
be called first to free up any memory allocated for the old
string.
TTTTccccllll____DDDDSSSSttttrrrriiiinnnnggggAAAAppppppppeeeennnndddd adds new information to a dynamic string,
allocating more memory for the string if needed. If _l_e_n_g_t_h
is less than zero then everything in _s_t_r_i_n_g is appended to
the dynamic string; otherwise _l_e_n_g_t_h specifies the number
of bytes to append. TTTTccccllll____DDDDSSSSttttrrrriiiinnnnggggAAAAppppppppeeeennnndddd returns a pointer to
the characters of the new string. The string can also be
retrieved from the _s_t_r_i_n_g field of the Tcl_DString
structure.
TTTTccccllll____DDDDSSSSttttrrrriiiinnnnggggAAAAppppppppeeeennnnddddEEEElllleeeemmmmeeeennnntttt is similar to TTTTccccllll____DDDDSSSSttttrrrriiiinnnnggggAAAAppppppppeeeennnndddd
except that it doesn't take a _l_e_n_g_t_h argument (it appends
all of _s_t_r_i_n_g) and it converts the string to a proper list
element before appending. TTTTccccllll____DDDDSSSSttttrrrriiiinnnnggggAAAAppppppppeeeennnnddddEEEElllleeeemmmmeeeennnntttt adds a
separator space before the new list element unless the new
list element is the first in a list or sub-list (i.e. either
the current string is empty, or it contains the single
character ``{'', or the last two characters of the current
string are `` {''). TTTTccccllll____DDDDSSSSttttrrrriiiinnnnggggAAAAppppppppeeeennnnddddEEEElllleeeemmmmeeeennnntttt returns a
pointer to the characters of the new string.
TTTTccccllll____DDDDSSSSttttrrrriiiinnnnggggSSSSttttaaaarrrrttttSSSSuuuubbbblllliiiisssstttt and TTTTccccllll____DDDDSSSSttttrrrriiiinnnnggggEEEEnnnnddddSSSSuuuubbbblllliiiisssstttt can be
used to create nested lists. To append a list element that
is itself a sublist, first call TTTTccccllll____DDDDSSSSttttrrrriiiinnnnggggSSSSttttaaaarrrrttttSSSSuuuubbbblllliiiisssstttt,
then call TTTTccccllll____DDDDSSSSttttrrrriiiinnnnggggAAAAppppppppeeeennnnddddEEEElllleeeemmmmeeeennnntttt for each of the elements
in the sublist, then call TTTTccccllll____DDDDSSSSttttrrrriiiinnnnggggEEEEnnnnddddSSSSuuuubbbblllliiiisssstttt to end the
sublist. TTTTccccllll____DDDDSSSSttttrrrriiiinnnnggggSSSSttttaaaarrrrttttSSSSuuuubbbblllliiiisssstttt appends a space character
if needed, followed by an open brace; TTTTccccllll____DDDDSSSSttttrrrriiiinnnnggggEEEEnnnnddddSSSSuuuubbbblllliiiisssstttt
appends a close brace. Lists can be nested to any depth.
TTTTccccllll____DDDDSSSSttttrrrriiiinnnnggggLLLLeeeennnnggggtttthhhh is a macro that returns the current length
of a dynamic string (not including the terminating null