index 54a2ed2d0d703bec5e227dfaafa53ad136753781..230c1c9f887cd434b7c34bd74edf72ec12b88a5d 100644 (file)
--- a/src/include/core/data.h
+++ b/src/include/core/data.h
#define SDB_CORE_DATA_H 1
#include "core/time.h"
-#include "utils/strbuf.h"
#include <inttypes.h>
#include <stddef.h>
/*
* sdb_data_format:
- * Append the specified datum to the specified string buffer using a default
- * format.
+ * Output the specified datum to the specified string using a default format.
+ * If the buffer size is less than the return value of sdb_data_strlen, the
+ * datum may be truncated. The buffer will always be nul-terminated after
+ * calling this function.
*
* Returns:
- * - 0 on success
+ * - the number of characters written to the buffer (excluding the terminated
+ * null byte) or the number of characters which would have been written in
+ * case the output was truncated
* - a negative value else
*/
int
-sdb_data_format(sdb_data_t *datum, sdb_strbuf_t *buf);
+sdb_data_format(sdb_data_t *datum, char *buf, size_t buflen);
#ifdef __cplusplus
} /* extern "C" */