mirror of
https://github.com/labwc/labwc.git
synced 2025-11-05 13:29:58 -05:00
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:
parent
e1725e17b2
commit
71f5ac8323
4 changed files with 66 additions and 48 deletions
12
src/common/match.c
Normal file
12
src/common/match.c
Normal 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));
|
||||
}
|
||||
|
||||
|
|
@ -5,6 +5,7 @@ labwc_sources += files(
|
|||
'font.c',
|
||||
'grab-file.c',
|
||||
'graphic-helpers.c',
|
||||
'match.c',
|
||||
'mem.c',
|
||||
'nodename.c',
|
||||
'parse-bool.c',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue