]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/glob-util.h
tree-wide: drop license boilerplate
[thirdparty/systemd.git] / src / basic / glob-util.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5 This file is part of systemd.
6
7 Copyright 2010 Lennart Poettering
8 ***/
9
10 #include <glob.h>
11 #include <stdbool.h>
12 #include <string.h>
13
14 #include "macro.h"
15 #include "string-util.h"
16
17 /* Note: this function modifies pglob to set various functions. */
18 int safe_glob(const char *path, int flags, glob_t *pglob);
19
20 int glob_exists(const char *path);
21 int glob_extend(char ***strv, const char *path);
22
23 #define _cleanup_globfree_ _cleanup_(globfree)
24
25 _pure_ static inline bool string_is_glob(const char *p) {
26 /* Check if a string contains any glob patterns. */
27 return !!strpbrk(p, GLOB_CHARS);
28 }