summaryrefslogtreecommitdiffstats
path: root/src/hardware/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/hardware/utils.h')
-rw-r--r--src/hardware/utils.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/hardware/utils.h b/src/hardware/utils.h
index 933c042..2a1a690 100644
--- a/src/hardware/utils.h
+++ b/src/hardware/utils.h
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
+#include <stdarg.h>
#include "globals.h"
#define LONG_INT_LEN 21 /* 64 bit unsigned int can has 20 decimals + \0 */
@@ -109,5 +110,15 @@ char *trim(const char *str, const char *delims);
*/
short explode(const char *str, const char *delims, char ***buffer, unsigned *buffer_size);
+/*
+ * Append strings to the first string parameter.
+ * @param str string where the rest of params will be appended. Can be NULL.
+ * When appending, str will be reallocated to the correct size.
+ * Last parameter must be NULL.
+ * @return pointer to the final string (same as str, if it wasn't NULL). In case
+ * of any problem, NULL is returned.
+ */
+char *append_str(char *str, ...);
+
#endif /* UTILS_H_ */