strbuf: strbuf_append_va
This commit is contained in:
parent
e67e03aceb
commit
9c73f8f867
3 changed files with 42 additions and 13 deletions
|
|
@ -43,6 +43,26 @@ Functions
|
|||
|
||||
Adds the formated-string 'fmt' to the end of ->buf.
|
||||
|
||||
`strbuf_append_va()`::
|
||||
|
||||
Adds the formated-string 'fmt' (generated by a `va_list`) to the end of ->buf. +
|
||||
Returns the number of characters that should have been written if ->buf was large enough. +
|
||||
Therefor if the function returns zero. all characters has been written. +
|
||||
+
|
||||
Example usage:
|
||||
+
|
||||
----
|
||||
va_start(va, fmt);
|
||||
len = strbuf_append_va(s, fmt, va);
|
||||
va_end(va);
|
||||
|
||||
if (len > 0) {
|
||||
strbuf_expand(s, len);
|
||||
va_start(va, fmt);
|
||||
len = strbuf_append_va(s, fmt, va);
|
||||
va_end(va);
|
||||
}
|
||||
----
|
||||
`strbuf_append_str()`::
|
||||
|
||||
Will add the 'str' C-string to the end of ->buf
|
||||
|
|
|
|||
Reference in a new issue