aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cbindgen.toml3
-rw-r--r--dome_key_map.h10
-rw-r--r--includer.c2
3 files changed, 9 insertions, 6 deletions
diff --git a/cbindgen.toml b/cbindgen.toml
index e2a124a..e6404bd 100644
--- a/cbindgen.toml
+++ b/cbindgen.toml
@@ -12,3 +12,6 @@ item_types = ["constants", "globals", "enums", "structs", "unions", "typedefs",
[export.rename]
"run_key_action" = "hello_run"
+
+[enum]
+prefix_with_name = true
diff --git a/dome_key_map.h b/dome_key_map.h
index 647c6e5..6066da0 100644
--- a/dome_key_map.h
+++ b/dome_key_map.h
@@ -7,14 +7,14 @@
#include <stdbool.h>
typedef enum {
- Play,
- Up,
- Down,
+ HeadphoneButton_Play,
+ HeadphoneButton_Up,
+ HeadphoneButton_Down,
} HeadphoneButton;
typedef enum {
- Map,
- Command,
+ MapKind_Map,
+ MapKind_Command,
} MapKind;
typedef struct {
diff --git a/includer.c b/includer.c
index 9a02d22..92a48cd 100644
--- a/includer.c
+++ b/includer.c
@@ -4,7 +4,7 @@
#define SIZE 2
int main() {
- HeadphoneButton trigger[SIZE] = {Play, Down};
+ HeadphoneButton trigger[SIZE] = {HeadphoneButton_Play, HeadphoneButton_Down};
const CKeyActionResult *result = c_run_key_action(trigger, SIZE);
printf("%s", result->action);