unit-name: add new unit_name_build_from_type() helper

The new helper is much like unit_name_build() but expects a UnitType
value instead of a suffix.
This commit is contained in:
Lennart Poettering
2018-04-13 11:34:48 +02:00
parent 812724c14b
commit 72406c2f7d
3 changed files with 47 additions and 5 deletions
+1
View File
@@ -40,6 +40,7 @@ UnitType unit_name_to_type(const char *n) _pure_;
int unit_name_change_suffix(const char *n, const char *suffix, char **ret);
int unit_name_build(const char *prefix, const char *instance, const char *suffix, char **ret);
int unit_name_build_from_type(const char *prefix, const char *instance, UnitType, char **ret);
char *unit_name_escape(const char *f);
int unit_name_unescape(const char *f, char **ret);