]> git.ipfire.org Git - thirdparty/systemd.git/commit
basic/unit-name: allow unit_name_to_instance() to be used to classify units
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 2 Apr 2019 09:05:44 +0000 (11:05 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 19 Jul 2019 14:49:41 +0000 (16:49 +0200)
commitb124d3f2ce87cc71065fde589caafd5ceb4764b6
tree98b5f4ef4e4b7919afc416647ad12a947cf6aea5
parent69de5c16ff89050bc5b4cc9e02eb8e8d082a641a
basic/unit-name: allow unit_name_to_instance() to be used to classify units

This could already be done by calling unit_name_is_*(), but if we don't know
if the argument is a valid unit name, it is more convenient to have a single
function which returns the type or possibly an error if the unit name is not
valid.

The values in the enum are sorted "by length". Not really important, but it
seems more natural to me.
src/basic/unit-name.c
src/basic/unit-name.h
src/test/test-unit-name.c