SUBSYSTEM OVERVIEW

Dynamic String (DST) Subsystem

The dynamic string subsystem implements a c-string with a dynamic array. This array automatically increases in size and enjoys an amortized constant time insertion at end.

USAGE

First declare a DST_STRING and initialize it with {0}. No memory will be used until the data has been entered. There is a default minimum for the array that is unspecified and may change in the future. Using any of the dst_PrependC and dst_Append* functions will allow you to add data. Only the append functions enjoy an amortized constant time insertion. The function dst_DeleteFirstn will remove characters. Deletion does currently resize the array, but this should be anticipated in the future. dst_GetLength will return the length of the string, while dst_getCapacity will return the length of the array. dst_GetCString will return the underlying array. dst_Compact will return an dynamically allocated c-string perfectly fit to the length of the dynamic string plus a null terminator. dst_Free should be used to clean up a dynamic string.