summaryrefslogtreecommitdiff
path: root/src/shared/unit-name.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-12-26 15:30:22 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-12-26 15:49:54 -0500
commitf78e6385dc4cee0a1f399c4c89ebf823c108d447 (patch)
treee1baf230750ddd221b8bdd71ac4d62f5b3472968 /src/shared/unit-name.h
parente3e0314b56012f7febc279d268f2cadc1fcc0f25 (diff)
Use enums to make it obvious what boolean params mean
Suggested-by: Russ Allbery <rra@debian.org>
Diffstat (limited to 'src/shared/unit-name.h')
-rw-r--r--src/shared/unit-name.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/shared/unit-name.h b/src/shared/unit-name.h
index 362ff0c00c..d06d2b2353 100644
--- a/src/shared/unit-name.h
+++ b/src/shared/unit-name.h
@@ -69,7 +69,12 @@ int unit_name_to_instance(const char *n, char **instance);
char* unit_name_to_prefix(const char *n);
char* unit_name_to_prefix_and_instance(const char *n);
-bool unit_name_is_valid(const char *n, bool template_ok) _pure_;
+enum template_valid {
+ TEMPLATE_INVALID,
+ TEMPLATE_VALID,
+};
+
+bool unit_name_is_valid(const char *n, enum template_valid template_ok) _pure_;
bool unit_prefix_is_valid(const char *p) _pure_;
bool unit_instance_is_valid(const char *i) _pure_;
@@ -98,7 +103,12 @@ char *unit_name_to_path(const char *name);
char *unit_dbus_path_from_name(const char *name);
int unit_name_from_dbus_path(const char *path, char **name);
-char *unit_name_mangle(const char *name, bool allow_globs);
-char *unit_name_mangle_with_suffix(const char *name, bool allow_globs, const char *suffix);
+enum unit_name_mangle {
+ MANGLE_NOGLOB,
+ MANGLE_GLOB,
+};
+
+char *unit_name_mangle(const char *name, enum unit_name_mangle allow_globs);
+char *unit_name_mangle_with_suffix(const char *name, enum unit_name_mangle allow_globs, const char *suffix);
int build_subslice(const char *slice, const char*name, char **subslice);