From e5c5cd54788076973f08f6aadf0d2b2f954a0423 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 8 Feb 2022 19:35:41 +0100 Subject: config: ‘pipe’ is now optional ‘aux’ data in the key-binding struct MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows us to add helper functions that e.g. compare bindings’ aux data in a generic way. --- config.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'config.h') diff --git a/config.h b/config.h index 473cfdd4..927f4e5f 100644 --- a/config.h +++ b/config.h @@ -44,9 +44,18 @@ struct argv { char **args; }; -struct config_binding_pipe { - struct argv argv; +enum binding_aux_type { + BINDING_AUX_NONE, + BINDING_AUX_PIPE, +}; + +struct binding_aux { + enum binding_aux_type type; bool master_copy; + + union { + struct argv pipe; + }; }; enum key_binding_type { @@ -70,7 +79,7 @@ struct config_key_binding { } m; }; - struct config_binding_pipe pipe; + struct binding_aux aux; /* For error messages in collision handling */ const char *path; -- cgit v1.3