Add DStr sprintf

This commit is contained in:
Nils O. Selåsdal
2013-12-04 21:33:16 +01:00
parent d81e9b760a
commit b5e1d086a4
3 changed files with 80 additions and 2 deletions
+7
View File
@@ -2,6 +2,7 @@
#define UC_DSTR_H_
#include <stddef.h>
#include <stdarg.h>
#ifdef __cplusplus
extern "C" {
@@ -134,6 +135,12 @@ size_t uc_dstr_replace(struct DStr *str, char f, char r);
*/
void uc_dstr_trim(struct DStr *str);
/** Append formatted string (just as sprintf)*/
int uc_dstr_sprintf(struct DStr *str, const char *fmt, ...) __attribute__((format(printf,2,3)));
/** va_list variant */
int uc_dstr_vsprintf(struct DStr *str, const char *fmt, va_list ap_)__attribute__((format(printf,2,0)));
#ifdef __cplusplus
}
#endif