diff options
| -rw-r--r-- | cbindgen.toml | 3 | ||||
| -rw-r--r-- | dome_key_map.h | 10 | ||||
| -rw-r--r-- | includer.c | 2 |
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 { @@ -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); |
