|
|
char *Ns_DStringAppend(
Ns_DString *dsPtr,
char *string
);
The Ns_DStringAppend macro appends the specified string plus a terminating null character to the end of the Ns_DString. The string may overflow from static space to the heap as a result of calling this function. It returns the string associated with the current Ns_DString.
Ns_DString ds;
Ns_DStringInit(&ds);
Ns_DStringAppend(&ds, "foo");
/* do something with the dstring */
printf("%s\n", ds.string);
Ns_DStringFree(&ds); /* finished with dstring */
The resulting Ns_DString, ds, would contain "foo\0" and have a length of 3.