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.h | |
| parent | b81023a76e479bc417c523905a34266489b55d7f (diff) | |
changed tblName to an enum; refactored enums into their own file
Diffstat (limited to 'enum.h')
| -rw-r--r-- | enum.h | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -0,0 +1,37 @@ +#ifndef _ENUM_ +#define _ENUM_ + +#include <string.h> + +typedef enum { + ANIME, + MANGA, +} target_e; + +typedef enum { + GET, + SET, + ADD, +} mode_e; + +static const struct { + mode_e val; + const char *str; +} conversion_mode [] = { + {GET, "get"}, + {SET, "set"}, + {ADD, "add"}, +}; + +static const struct { + target_e val; + const char *str; +} conversion_target [] = { + {ANIME, "anime"}, + {MANGA, "manga"}, +}; + +mode_e str2enum_mode(const char *str); +target_e str2enum_target(const char *str); + +#endif |
