char *Ns_DStringPrintf( Ns_DString *dsPtr, char *fmt, ... );
The Ns_DStringPrintf function appends a string that has been created by calling the sprintf function with the given format and optional arguments. This function currently uses a fixed length buffer of 1024 characters to sprintf() the data before appending to the Ns_DString.
Ns_DString ds; Ns_DStringInit(&ds); Ns_DStringPrintf(&ds, "/path%d", getpid()); /* do something with dstring */ printf ("%s\n", ds.string); Ns_DStringFree(&ds); /* finished with dstring */