diff options
| author | yuzu-eva <cafebabe@disroot.org> | 2025-04-11 20:21:00 +0200 |
|---|---|---|
| committer | yuzu-eva <cafebabe@disroot.org> | 2025-04-11 20:21:00 +0200 |
| commit | 85549c89b0241ad22d102aaf19f037a7c0ebce5b (patch) | |
| tree | fe58dffd0a97bfdf924c3bfcfadd2eef3d6614fa /enum.c | |
| parent | b81023a76e479bc417c523905a34266489b55d7f (diff) | |
changed tblName to an enum; refactored enums into their own file
Diffstat (limited to 'enum.c')
| -rw-r--r-- | enum.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -0,0 +1,19 @@ +#include "enum.h" + +mode_e str2enum_mode(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; + } + 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; +} |
