aboutsummaryrefslogtreecommitdiffstats
path: root/dome_key_map.h
diff options
context:
space:
mode:
authorTeddy Wing2018-08-26 07:28:50 +0200
committerTeddy Wing2018-08-26 07:28:50 +0200
commitf09a074b3e96b960ee42dc484971e3fa192499d0 (patch)
treefa2cbdfd19faa3724d37fc42ebcbdf1ceac52509 /dome_key_map.h
parent9b0e6e4207f5c44bef5d0b28ba036040845f82d8 (diff)
downloaddome-key-map-f09a074b3e96b960ee42dc484971e3fa192499d0.tar.bz2
Make data types more C-like
Add a new `CKeyActionResult` that uses a `char *` instead of an `Option<CString>`. Make our `c_run_key_action()` return this type instead of `KeyActionResult`. Include some code to handle the translation between the two types. Names for now are just temporary so I can get something working. We'll re-think proper names once I've tested this manually and have something somewhat working.
Diffstat (limited to 'dome_key_map.h')
-rw-r--r--dome_key_map.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/dome_key_map.h b/dome_key_map.h
index d128979..1206d1d 100644
--- a/dome_key_map.h
+++ b/dome_key_map.h
@@ -17,8 +17,13 @@ typedef struct MapKind MapKind;
typedef struct Option_CString Option_CString;
typedef struct {
+ const char *action;
+ const MapKind *kind;
+} CKeyActionResult;
+
+typedef struct {
Option_CString action;
MapKind kind;
} KeyActionResult;
-const KeyActionResult *c_run_key_action(const HeadphoneButton *trigger, size_t length);
+const CKeyActionResult *c_run_key_action(const HeadphoneButton *trigger, size_t length);