]>
Commit | Line | Data |
---|---|---|
db9ecf05 | 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
7d50b32a LP |
2 | #pragma once |
3 | ||
0c15577a | 4 | #include <glob.h> /* IWYU pragma: export */ |
7d50b32a | 5 | |
0c15577a | 6 | #include "forward.h" |
7d50b32a | 7 | |
2a5f950e YW |
8 | typedef DIR* (*opendir_t)(const char *); |
9 | ||
10 | int safe_glob_full(const char *path, int flags, opendir_t opendir_func, char ***ret); | |
11 | static inline int safe_glob(const char *path, int flags, char ***ret) { | |
12 | return safe_glob_full(path, flags, NULL, ret); | |
13 | } | |
48d7c648 | 14 | |
f52faaf9 | 15 | /* Note: which match is returned depends on the implementation/system and not guaranteed to be stable */ |
2a5f950e | 16 | int glob_first(const char *path, char **ret); |
f52faaf9 | 17 | #define glob_exists(path) glob_first(path, NULL) |
544e146b | 18 | int glob_extend(char ***strv, const char *path, int flags); |
7d50b32a | 19 | |
1e472a6c ZJS |
20 | int glob_non_glob_prefix(const char *path, char **ret); |
21 | ||
0c15577a | 22 | bool string_is_glob(const char *p) _pure_; |