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 committed by Johan Malm
parent e1725e17b2
commit 71f5ac8323
4 changed files with 66 additions and 48 deletions

12
src/common/match.c Normal file
View file

@ -0,0 +1,12 @@
// SPDX-License-Identifier: GPL-2.0-only
#define _POSIX_C_SOURCE 200809L
#include <glib.h>
#include <stdbool.h>
#include "common/match.h"
bool
match_glob(const gchar *pattern, const gchar *string)
{
return g_pattern_match_simple(g_utf8_casefold(pattern, -1), g_utf8_casefold(string, -1));
}

View file

@ -5,6 +5,7 @@ labwc_sources += files(
'font.c',
'grab-file.c',
'graphic-helpers.c',
'match.c',
'mem.c',
'nodename.c',
'parse-bool.c',