return 0;
}
-int unit_name_printf(Unit *u, const char* format, char **ret) {
+int unit_name_printf(const Unit *u, const char* format, char **ret) {
/*
* This will use the passed string as format string and replace the following specifiers (which should all be
* %u: the username of the running user
*
* %m: the machine ID of the running system
- * %H: the host name of the running system
+ * %H: the hostname of the running system
* %b: the boot ID of the running system
*/
return specifier_printf(format, table, u, ret);
}
-int unit_full_printf(Unit *u, const char *format, char **ret) {
-
+int unit_full_printf(const Unit *u, const char *format, char **ret) {
/* This is similar to unit_name_printf() but also supports unescaping. Also, adds a couple of additional codes
* (which are likely not suitable for unescaped inclusion in unit names):
*
* before or after the relevant configuration setting. Hence: don't add them.
*/
+ assert(u);
+ assert(format);
+ assert(ret);
+
const Specifier table[] = {
{ 'n', specifier_string, u->id },
{ 'N', specifier_prefix_and_instance, NULL },
{}
};
- assert(u);
- assert(format);
- assert(ret);
-
return specifier_printf(format, table, u, ret);
}