summaryrefslogtreecommitdiff
path: root/enum.h
diff options
context:
space:
mode:
authoryuzu-eva <cafebabe@disroot.org>2025-04-11 20:21:00 +0200
committeryuzu-eva <cafebabe@disroot.org>2025-04-11 20:21:00 +0200
commit85549c89b0241ad22d102aaf19f037a7c0ebce5b (patch)
treefe58dffd0a97bfdf924c3bfcfadd2eef3d6614fa /enum.h
parentb81023a76e479bc417c523905a34266489b55d7f (diff)
changed tblName to an enum; refactored enums into their own file
Diffstat (limited to 'enum.h')
-rw-r--r--enum.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/enum.h b/enum.h
new file mode 100644
index 0000000..68bbc99
--- /dev/null
+++ b/enum.h
@@ -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