From 3adfbc412a70616460a4fdaaa13924e94cab91e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Fri, 3 Jul 2020 21:11:43 +0200 Subject: [PATCH] Finish it --- CMakeLists.txt | 3 ++ heir.c | 121 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 122 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8328c98..6d3d31b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,3 +7,6 @@ add_executable(heir heir.c sway/common/ipc-client.c) target_include_directories(heir PRIVATE sway/include) + +find_package(json-c REQUIRED) +target_link_libraries(heir json-c::json-c) diff --git a/heir.c b/heir.c index 9644e14..470d9cd 100644 --- a/heir.c +++ b/heir.c @@ -1,16 +1,109 @@ +#include +#include + #include #include +#include +#include +#include + +int cmd_argc; +const char **cmd_argv; + +static void run() +{ + const char **cmd = calloc((size_t)cmd_argc + 1, sizeof(const char *)); + for(size_t i=0; i