From 4b31eb9b8412e429949aca73ef475787910e4b0b Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 2 Sep 2018 14:12:56 +0200 Subject: Test mode finder Add a new `moder.c` based on `includer.c` to test getting a mode and then getting an action for a mode mapping. Doesn't completely work currently. Right now all I get is this output: $ ./moder 2 Segmentation fault: 11 Clearly I'm messing up something with the pointer in `c_run_key_action()`. Not sure what it is yet. Changed `CKeyActionResult.in_mode` to be a `Trigger` instead of a `HeadphoneButton` list. That allows us to pass it directly into the second argument of `c_run_key_action()` without converting. But maybe the pointer value isn't living long enough? Not sure what the problem is yet. --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 5f1288b..c5bd2e2 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,9 @@ $(LIB): $(SOURCE_FILES) includer: clean $(LIB) gcc -o $@ includer.c $(LIB) +moder: clean $(LIB) + gcc -o $@ $@.c $(LIB) + .PHONY: clean clean: - rm -f includer + rm -f includer moder -- cgit v1.2.3