strv: Reduce transitive includes
This commit is contained in:
committed by
Yu Watanabe
parent
d9ccf6b349
commit
6553db6063
+6
-21
@@ -1,17 +1,16 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include <fnmatch.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "extract-word.h"
|
||||
#include "hashmap.h"
|
||||
#include "macro.h"
|
||||
#include "string-util.h"
|
||||
#include "memory-util.h"
|
||||
|
||||
typedef enum ExtractFlags ExtractFlags;
|
||||
|
||||
char* strv_find(char * const *l, const char *name) _pure_;
|
||||
char* strv_find_case(char * const *l, const char *name) _pure_;
|
||||
@@ -113,27 +112,13 @@ static inline bool strv_isempty(char * const *l) {
|
||||
}
|
||||
|
||||
int strv_split_full(char ***t, const char *s, const char *separators, ExtractFlags flags);
|
||||
static inline char** strv_split(const char *s, const char *separators) {
|
||||
char **ret;
|
||||
|
||||
if (strv_split_full(&ret, s, separators, EXTRACT_RETAIN_ESCAPE) < 0)
|
||||
return NULL;
|
||||
|
||||
return ret;
|
||||
}
|
||||
char** strv_split(const char *s, const char *separators);
|
||||
|
||||
int strv_split_and_extend_full(char ***t, const char *s, const char *separators, bool filter_duplicates, ExtractFlags flags);
|
||||
#define strv_split_and_extend(t, s, sep, dup) strv_split_and_extend_full(t, s, sep, dup, 0)
|
||||
int strv_split_and_extend(char ***t, const char *s, const char *separators, bool filter_duplicates);
|
||||
|
||||
int strv_split_newlines_full(char ***ret, const char *s, ExtractFlags flags);
|
||||
static inline char** strv_split_newlines(const char *s) {
|
||||
char **ret;
|
||||
|
||||
if (strv_split_newlines_full(&ret, s, 0) < 0)
|
||||
return NULL;
|
||||
|
||||
return ret;
|
||||
}
|
||||
char** strv_split_newlines(const char *s);
|
||||
|
||||
/* Given a string containing white-space separated tuples of words themselves separated by ':',
|
||||
* returns a vector of strings. If the second element in a tuple is missing, the corresponding
|
||||
|
||||
Reference in New Issue
Block a user