From 5aa349d6229806ad78b083fed3997164bd3721ae Mon Sep 17 00:00:00 2001 From: yuzu-eva Date: Sat, 12 Apr 2025 08:39:13 +0200 Subject: combined the enums into one --- enum.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'enum.c') diff --git a/enum.c b/enum.c index 34eeead..ba0828f 100644 --- a/enum.c +++ b/enum.c @@ -1,19 +1,11 @@ #include "enum.h" -mode_e str2enum_mode(const char *str) +args_e str2enum(const char *str) { - for (size_t i = 0; i < sizeof(conversion_mode) / sizeof(conversion_mode[0]); ++i) { - if (!strcmp(str, conversion_mode[i].str)) - return conversion_mode[i].val; + for (size_t i = 0; i < sizeof(conversion_args) / sizeof(conversion_args[0]); ++i) { + if (!strcmp(str, conversion_args[i].str)) + return conversion_args[i].val; } return -1; } -target_e str2enum_target(const char *str) -{ - for (size_t i = 0; i < sizeof(conversion_target) / sizeof(conversion_target[0]); ++i) { - if (!strcmp(str, conversion_target[i].str)) - return conversion_target[i].val; - } - return -1; -} -- cgit v1.2.3