aboutsummaryrefslogtreecommitdiffstats
path: root/dome_key_map.h
diff options
context:
space:
mode:
authorTeddy Wing2018-10-05 19:40:53 +0200
committerTeddy Wing2018-10-05 21:37:36 +0200
commit9ec2632bb036defc9f5706c1f38981dc4eb55afe (patch)
treecb6de899fd4eb3047155ce930827fb9115357d5a /dome_key_map.h
parent961b3b0b2d33a2c632fbc093b61e2c2d4dc07f70 (diff)
downloaddome-key-map-9ec2632bb036defc9f5706c1f38981dc4eb55afe.tar.bz2
Turn `Config` into a C struct instead of an opaque struct
We want to be able to access the fields in `Config`, so make them accessible across the FFI boundary. * Return a regular, not boxed, `Config` from `parse_args()`. * Add `repr(C)`s on our structs (had forgotten how this worked in 961b3b0b2d33a2c632fbc093b61e2c2d4dc07f70). * Delete the `config_free()` function as I think the stuct doesn't need to be freed being a POD struct. Hopefully that's the case.
Diffstat (limited to 'dome_key_map.h')
-rw-r--r--dome_key_map.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/dome_key_map.h b/dome_key_map.h
index 39ba298..74369b7 100644
--- a/dome_key_map.h
+++ b/dome_key_map.h
@@ -17,8 +17,6 @@ typedef enum {
MapKind_Command,
} MapKind;
-typedef struct Config Config;
-
typedef struct State State;
typedef struct {
@@ -26,9 +24,16 @@ typedef struct {
size_t length;
} Trigger;
-void c_run_key_action(State *state, Trigger trigger, const Trigger *mode);
+typedef struct {
+ bool reload;
+ bool daemon;
+} Args;
-void config_free(Config *ptr);
+typedef struct {
+ Args args;
+} Config;
+
+void c_run_key_action(State *state, Trigger trigger, const Trigger *mode);
void logger_init(void);