]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/basic/glob-util.h
basic/stat-util: introduce is_dir_fd()
[thirdparty/systemd.git] / src / basic / glob-util.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
7d50b32a
LP
2#pragma once
3
48d7c648 4#include <glob.h>
11c3a366 5#include <stdbool.h>
7d50b32a
LP
6#include <string.h>
7
8#include "macro.h"
b11d6a7b 9#include "string-util.h"
7d50b32a 10
48d7c648
ZJS
11/* Note: this function modifies pglob to set various functions. */
12int safe_glob(const char *path, int flags, glob_t *pglob);
13
7d50b32a
LP
14int glob_exists(const char *path);
15int glob_extend(char ***strv, const char *path);
16
17#define _cleanup_globfree_ _cleanup_(globfree)
18
19_pure_ static inline bool string_is_glob(const char *p) {
20 /* Check if a string contains any glob patterns. */
21 return !!strpbrk(p, GLOB_CHARS);
22}