From cbaf922ce13799f70190572ec9a3f90f1af1d685 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 12 May 2024 10:16:02 +0200 Subject: [PATCH] Make the recap optional Useful when you have to do multiple passes --- fbink.h | 1 + fbink_input_scan.c | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/fbink.h b/fbink.h index 5f79893b..d2060dc2 100644 --- a/fbink.h +++ b/fbink.h @@ -1693,6 +1693,7 @@ typedef enum OPEN_BLOCKING = 1U << 1U, // Do *NOT* open fd's with O_NONBLOCK MATCH_ALL = 1U << 2U, // Match on *all* the match_types bits instead of *any* EXCLUDE_ALL = 1U << 3U, // Exclude on *all* the exclude_types bits instead of *any* + NO_RECAP = 1U << 4U, // Do *NOT* print a recap of the results of input device classification } __attribute__((packed)) INPUT_SETTINGS_TYPE_E; typedef uint32_t INPUT_SETTINGS_TYPE_T; diff --git a/fbink_input_scan.c b/fbink_input_scan.c index 95b2222b..b478d7bf 100644 --- a/fbink_input_scan.c +++ b/fbink_input_scan.c @@ -415,10 +415,12 @@ static void // Let udev's builtin input_id logic do its thing! check_device_cap(dev); - // Recap the device's capabilities - char recap[4096] = { 0 }; - concat_type_recap(dev->type, recap, sizeof(recap)); - ELOG("%s: `%s`%s", dev->path, dev->name, recap); + // Recap the device's capabilities, unless requested otherwise. + if (!(settings & NO_RECAP)) { + char recap[4096] = { 0 }; + concat_type_recap(dev->type, recap, sizeof(recap)); + ELOG("%s: `%s`%s", dev->path, dev->name, recap); + } // Do we want to match on *all* or *any* of the match bits? if (settings & MATCH_ALL) {