1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-07 01:27:11 +03:00

condition: introduce condition_takes_path()

The function will be used in later commits.
This commit is contained in:
Yu Watanabe 2017-12-29 17:04:23 +09:00
parent 33d12153da
commit d8f37c89a2

View File

@ -99,3 +99,17 @@ ConditionType assert_type_from_string(const char *s) _pure_;
const char* condition_result_to_string(ConditionResult r) _const_;
ConditionResult condition_result_from_string(const char *s) _pure_;
static inline bool condition_takes_path(ConditionType t) {
return IN_SET(t,
CONDITION_PATH_EXISTS,
CONDITION_PATH_EXISTS_GLOB,
CONDITION_PATH_IS_DIRECTORY,
CONDITION_PATH_IS_SYMBOLIC_LINK,
CONDITION_PATH_IS_MOUNT_POINT,
CONDITION_PATH_IS_READ_WRITE,
CONDITION_DIRECTORY_NOT_EMPTY,
CONDITION_FILE_NOT_EMPTY,
CONDITION_FILE_IS_EXECUTABLE,
CONDITION_NEEDS_UPDATE);
}