summaryrefslogtreecommitdiffstats
path: root/StringUtils.h
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2020-09-19 20:22:34 +0200
committerBenny Baumann <BenBE@geshi.org>2020-10-16 20:29:45 +0200
commitc6f04a9c5d33d16623f1c20f0987dd3a992379e7 (patch)
tree9e00e160a1eea3d99ac9348cc5f56b45376e7279 /StringUtils.h
parent7cd093ce95c1f59cfc1ee2786578457ea6fa1559 (diff)
Move xAsprintf, xSnprintf and xStrdup to StringUtils.h
Diffstat (limited to 'StringUtils.h')
-rw-r--r--StringUtils.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/StringUtils.h b/StringUtils.h
index 936617ff..5a1af9ad 100644
--- a/StringUtils.h
+++ b/StringUtils.h
@@ -9,6 +9,9 @@ in the source distribution for its full text.
#include <stdio.h>
+#include "Macros.h"
+
+
#define String_startsWith(s, match) (strncmp((s),(match),strlen(match)) == 0)
#define String_contains_i(s1, s2) (strcasestr(s1, s2) != NULL)
@@ -31,4 +34,12 @@ char* String_getToken(const char* line, const unsigned short int numMatch);
char* String_readLine(FILE* fd);
+ATTR_FORMAT(printf, 2, 3)
+int xAsprintf(char **strp, const char* fmt, ...);
+
+ATTR_FORMAT(printf, 3, 4)
+int xSnprintf(char *buf, int len, const char* fmt, ...);
+
+char* xStrdup(const char* str) ATTR_NONNULL;
+
#endif