summaryrefslogtreecommitdiffstats
path: root/src/basic/unit-name.h
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-02-08 11:31:37 +0100
committerMike Yuan <me@yhndnzj.com>2024-02-09 09:17:59 +0100
commit8749b09390959232f847aceee4efe76f45bf4174 (patch)
tree55aba942fee935643546da15d3e1024177604bfd /src/basic/unit-name.h
parentsystemctl-util: some modernizations (diff)
downloadsystemd-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.h9
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);