1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-13 17:18:18 +03:00

strv: introduce strv_print_full()

This commit is contained in:
Yu Watanabe 2023-03-19 23:32:43 +09:00 committed by Daan De Meyer
parent 7af15421e3
commit 00546c18fd
2 changed files with 6 additions and 3 deletions

View File

@ -668,9 +668,9 @@ int strv_compare(char * const *a, char * const *b) {
return 0;
}
void strv_print(char * const *l) {
void strv_print_full(char * const *l, const char *prefix) {
STRV_FOREACH(s, l)
puts(*s);
printf("%s%s\n", strempty(prefix), *s);
}
int strv_extendf(char ***l, const char *format, ...) {

View File

@ -149,7 +149,10 @@ bool strv_overlap(char * const *a, char * const *b) _pure_;
_STRV_FOREACH_PAIR(x, y, l, UNIQ_T(i, UNIQ))
char** strv_sort(char **l);
void strv_print(char * const *l);
void strv_print_full(char * const *l, const char *prefix);
static inline void strv_print(char * const *l) {
strv_print_full(l, NULL);
}
#define strv_from_stdarg_alloca(first) \
({ \