diff options
author | Mike Yuan <me@yhndnzj.com> | 2024-02-08 11:31:37 +0100 |
---|---|---|
committer | Mike Yuan <me@yhndnzj.com> | 2024-02-09 09:17:59 +0100 |
commit | 8749b09390959232f847aceee4efe76f45bf4174 (patch) | |
tree | 55aba942fee935643546da15d3e1024177604bfd /src/basic/unit-name.h | |
parent | systemctl-util: some modernizations (diff) | |
download | systemd-8749b09390959232f847aceee4efe76f45bf4174.tar.xz systemd-8749b09390959232f847aceee4efe76f45bf4174.zip |
basic/unit-name: introduce unit_name_replace_instance_full
that optionally accepts a globbed instance
Diffstat (limited to 'src/basic/unit-name.h')
-rw-r--r-- | src/basic/unit-name.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/basic/unit-name.h b/src/basic/unit-name.h index d22d824fbe..fa7295e250 100644 --- a/src/basic/unit-name.h +++ b/src/basic/unit-name.h @@ -40,7 +40,14 @@ int unit_name_unescape(const char *f, char **ret); int unit_name_path_escape(const char *f, char **ret); int unit_name_path_unescape(const char *f, char **ret); -int unit_name_replace_instance(const char *f, const char *i, char **ret); +int unit_name_replace_instance_full( + const char *original, + const char *instance, + bool accept_glob, + char **ret); +static inline int unit_name_replace_instance(const char *original, const char *instance, char **ret) { + return unit_name_replace_instance_full(original, instance, false, ret); +} int unit_name_template(const char *f, char **ret); |