Add common/match.c with match_glob() from theme.c

...and make it fully case-insensitive in preparation for window-rules.
This commit is contained in:
Johan Malm 2023-04-28 21:21:08 +01:00
parent ac1899ada5
commit 8563d5c44e
4 changed files with 66 additions and 48 deletions

14
include/common/match.h Normal file
View file

@ -0,0 +1,14 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef __LABWC_MATCH_H
#define __LABWC_MATCH_H
#include <glib.h>
/**
* match_glob() - Pattern match using '*' wildcards and '?' jokers.
* @pattern: Pattern to match against.
* @string: String to search.
* Note: Comparison case-insensitive.
*/
bool match_glob(const gchar *pattern, const gchar *string);
#endif /* __LABWC_MATCH_H */