2017-11-18 17:09:20 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1+ */
|
2015-10-27 01:48:17 +01:00
|
|
|
#pragma once
|
|
|
|
|
2017-04-26 05:44:34 +02:00
|
|
|
#include <glob.h>
|
2015-11-30 21:43:37 +01:00
|
|
|
#include <stdbool.h>
|
2015-10-27 01:48:17 +01:00
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "macro.h"
|
2015-11-03 12:25:29 +01:00
|
|
|
#include "string-util.h"
|
2015-10-27 01:48:17 +01:00
|
|
|
|
2017-04-26 05:44:34 +02:00
|
|
|
/* Note: this function modifies pglob to set various functions. */
|
|
|
|
int safe_glob(const char *path, int flags, glob_t *pglob);
|
|
|
|
|
2015-10-27 01:48:17 +01:00
|
|
|
int glob_exists(const char *path);
|
|
|
|
int glob_extend(char ***strv, const char *path);
|
|
|
|
|
|
|
|
#define _cleanup_globfree_ _cleanup_(globfree)
|
|
|
|
|
|
|
|
_pure_ static inline bool string_is_glob(const char *p) {
|
|
|
|
/* Check if a string contains any glob patterns. */
|
|
|
|
return !!strpbrk(p, GLOB_CHARS);
|
|
|
|
}
|