string-util: introduce strprepend() helper

This commit is contained in:
Mike Yuan
2025-02-10 19:03:08 +01:00
parent fd2a114061
commit b40694f5fc
3 changed files with 29 additions and 0 deletions

View File

@@ -106,6 +106,8 @@ static inline const char* empty_or_dash_to_null(const char *p) {
char* first_word(const char *s, const char *word) _pure_;
char* strprepend(char **x, const char *s);
char* strnappend(const char *s, const char *suffix, size_t length);
#define strjoin(a, ...) strextend_with_separator_internal(NULL, NULL, a, __VA_ARGS__, NULL)