From d8f37c89a26b2b57757b9757c7f64f63ec3af45d Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 29 Dec 2017 17:04:23 +0900 Subject: [PATCH] condition: introduce condition_takes_path() The function will be used in later commits. --- src/shared/condition.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/shared/condition.h b/src/shared/condition.h index 98af2daaeee..a84d993370a 100644 --- a/src/shared/condition.h +++ b/src/shared/condition.h @@ -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); +} -- 2.47.3