diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-05-14 18:40:16 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-05-15 15:50:09 +0200 |
commit | dce719f6c1eedcb378289fc90120bc252556aa61 (patch) | |
tree | c64cb34a8612699cfa63ef2acd42b5eb8ea8b1eb /src/shared/condition.h | |
parent | 7f19247b5e583e508a4eca7d5455cd590cc8e71e (diff) | |
download | systemd-dce719f6c1eedcb378289fc90120bc252556aa61.tar.gz |
condition: introduce generic function type for condition_to_string()-like functions
Let's add a typedef for a function type we use at multiple places.
Diffstat (limited to 'src/shared/condition.h')
-rw-r--r-- | src/shared/condition.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/shared/condition.h b/src/shared/condition.h index 6064ccdaed..fa00f6ea98 100644 --- a/src/shared/condition.h +++ b/src/shared/condition.h @@ -74,11 +74,13 @@ static inline Condition* condition_free_list(Condition *first) { } int condition_test(Condition *c); + typedef int (*condition_test_logger_t)(void *userdata, int level, int error, const char *file, int line, const char *func, const char *format, ...) _printf_(7, 8); -bool condition_test_list(Condition *first, const char *(*to_string)(ConditionType t), condition_test_logger_t logger, void *userdata); +typedef const char* (*condition_to_string_t)(ConditionType t); +bool condition_test_list(Condition *first, condition_to_string_t, condition_test_logger_t logger, void *userdata); -void condition_dump(Condition *c, FILE *f, const char *prefix, const char *(*to_string)(ConditionType t)); -void condition_dump_list(Condition *c, FILE *f, const char *prefix, const char *(*to_string)(ConditionType t)); +void condition_dump(Condition *c, FILE *f, const char *prefix, condition_to_string_t to_string); +void condition_dump_list(Condition *c, FILE *f, const char *prefix, condition_to_string_t to_string); const char* condition_type_to_string(ConditionType t) _const_; ConditionType condition_type_from_string(const char *s) _pure_; |