Add string_contains_word_strv()
I had to move STRV_MAKE to macro.h. There is a circular dependency between extract-word.h, strv.h, and string-util.h that makes it hard to define the inline function otherwise.
This commit is contained in:
@@ -280,4 +280,8 @@ char* string_erase(char *x);
|
||||
|
||||
int string_truncate_lines(const char *s, size_t n_lines, char **ret);
|
||||
int string_extract_line(const char *s, size_t i, char **ret);
|
||||
int string_contains_word(const char *string, const char *separators, const char *word);
|
||||
|
||||
int string_contains_word_strv(const char *string, const char *separators, char **words, const char **ret_word);
|
||||
static inline int string_contains_word(const char *string, const char *separators, const char *word) {
|
||||
return string_contains_word_strv(string, separators, STRV_MAKE(word), NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user