char *Ns_DStringExport( Ns_DString *src );
The Ns_DStringExport function returns the current Ns_DString string and leaves the Ns_DString in the initialized state. The string returned needs to be freed eventually with Ns_Free.
Ns_DString ds; char *stringdest; Ns_DStringInit(&ds); Ns_DStringAppend(&ds, "foo"); stringdest = Ns_DStringExport(&ds); /* do something with `stringdest' */ Ns_Free(stringdest);