diff options
| author | yuzu-eva <cafebabe@disroot.org> | 2025-04-12 08:39:13 +0200 |
|---|---|---|
| committer | yuzu-eva <cafebabe@disroot.org> | 2025-04-12 08:39:13 +0200 |
| commit | 5aa349d6229806ad78b083fed3997164bd3721ae (patch) | |
| tree | d32b2063769df0e540ff5164b33c84a7e6493c9a /enum.c | |
| parent | 56c355574d29546bbd5676d94dff48c8631a9fec (diff) | |
combined the enums into one
Diffstat (limited to 'enum.c')
| -rw-r--r-- | enum.c | 16 |
1 files changed, 4 insertions, 12 deletions
@@ -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; -} |
