summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-05-03 20:59:27 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-05-03 20:59:27 +0100
commit3faf1a4627bee26a7550b00bd5f1ff01fc34d5c3 (patch)
tree8ba2ce8de7aa3066cf1fe2808265a1c73b4897ca
parent835221e29a58088b66a153007381b958eb924056 (diff)
downloadenlightenment-3faf1a4627bee26a7550b00bd5f1ff01fc34d5c3.tar.gz
move to eina's new fnmatch
-rw-r--r--meson.build6
-rw-r--r--src/bin/e.h1
-rw-r--r--src/bin/e_actions.c4
-rw-r--r--src/bin/e_fm/e_fm_ipc.c1
-rw-r--r--src/bin/e_fm/e_fm_main.c1
-rw-r--r--src/bin/e_sys_main.c7
-rw-r--r--src/bin/e_utils.c4
-rw-r--r--src/bin/meson.build1
-rw-r--r--src/bin/system/e_system.h1
-rw-r--r--src/bin/system/e_system_main.c8
-rw-r--r--src/modules/mixer/emixer.c2
11 files changed, 12 insertions, 24 deletions
diff --git a/meson.build b/meson.build
index c82233b1ac..1820bfd86b 100644
--- a/meson.build
+++ b/meson.build
@@ -192,12 +192,6 @@ if cc.has_function('mlock') == true
config_h.set('HAVE_MLOCK' , '1')
endif
-if cc.has_header('fnmatch.h') == false
- error('fnmatch.h not found')
-endif
-
-dep_fnmatch = cc.find_library('fnmatch', required: false)
-
code = '''#define _GNU_SOURCE 1
#include <unistd.h>
#include <stdio.h>
diff --git a/src/bin/e.h b/src/bin/e.h
index 62a8e61fe3..4d2b4f24e9 100644
--- a/src/bin/e.h
+++ b/src/bin/e.h
@@ -78,7 +78,6 @@ void *alloca (size_t);
# include <dlfcn.h>
# include <math.h>
# include <fcntl.h>
-# include <fnmatch.h>
# include <limits.h>
# include <ctype.h>
# include <time.h>
diff --git a/src/bin/e_actions.c b/src/bin/e_actions.c
index 3bdc26d479..0208365eeb 100644
--- a/src/bin/e_actions.c
+++ b/src/bin/e_actions.c
@@ -2718,7 +2718,7 @@ ACT_FN_GO(shelf_show, )
EINA_LIST_FOREACH(e_shelf_list(), l, es)
{
- if ((!params) || (params && (fnmatch(params, es->name, 0) == 0)))
+ if ((!params) || (params && (eina_fnmatch(params, es->name, 0))))
{
e_shelf_toggle(es, 1);
e_shelf_toggle(es, 0);
@@ -2727,7 +2727,7 @@ ACT_FN_GO(shelf_show, )
}
/***************************************************************************/
#define ACT_SHELF_SHOW(params, es) \
- if ((!params) || (params && (fnmatch(params, es->name, 0) == 0))) \
+ if ((!params) || (params && (eina_fnmatch(params, es->name, 0)))) \
{ \
e_shelf_toggle(es, 1); \
e_shelf_toggle(es, 0); \
diff --git a/src/bin/e_fm/e_fm_ipc.c b/src/bin/e_fm/e_fm_ipc.c
index 917ae21f97..6d5db7c315 100644
--- a/src/bin/e_fm/e_fm_ipc.c
+++ b/src/bin/e_fm/e_fm_ipc.c
@@ -20,7 +20,6 @@
#include <sys/param.h>
#include <utime.h>
#include <math.h>
-#include <fnmatch.h>
#include <limits.h>
#include <ctype.h>
#include <time.h>
diff --git a/src/bin/e_fm/e_fm_main.c b/src/bin/e_fm/e_fm_main.c
index a1317d680b..e85fafe623 100644
--- a/src/bin/e_fm/e_fm_main.c
+++ b/src/bin/e_fm/e_fm_main.c
@@ -32,7 +32,6 @@ void *alloca (size_t);
#include <sys/param.h>
#include <utime.h>
#include <math.h>
-#include <fnmatch.h>
#include <limits.h>
#include <ctype.h>
#include <time.h>
diff --git a/src/bin/e_sys_main.c b/src/bin/e_sys_main.c
index abc2c3bffe..e19c1dcebc 100644
--- a/src/bin/e_sys_main.c
+++ b/src/bin/e_sys_main.c
@@ -20,7 +20,6 @@
#include <sys/wait.h>
#include <pwd.h>
#include <grp.h>
-#include <fnmatch.h>
#include <ctype.h>
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
@@ -598,7 +597,7 @@ auth_etc_enlightenment_sysactions(char *a,
deny = 0;
if (!strcmp(id, "user:"))
{
- if (!fnmatch(ugname, u, 0))
+ if (eina_fnmatch(ugname, u, 0))
{
if (!strcmp(perm, "allow:")) allow = 1;
else if (!strcmp(perm, "deny:"))
@@ -615,7 +614,7 @@ auth_etc_enlightenment_sysactions(char *a,
for (gp = g; *gp; gp++)
{
- if (!fnmatch(ugname, *gp, 0))
+ if (eina_fnmatch(ugname, *gp, 0))
{
matched = EINA_TRUE;
if (!strcmp(perm, "allow:")) allow = 1;
@@ -646,7 +645,7 @@ auth_etc_enlightenment_sysactions(char *a,
{
p = get_word(p, act);
if (act[0] == 0) break;
- if (!fnmatch(act, a, 0))
+ if (eina_fnmatch(act, a, 0))
{
if (allow) ok = 1;
else if (deny)
diff --git a/src/bin/e_utils.c b/src/bin/e_utils.c
index 8db378add2..49716ebddb 100644
--- a/src/bin/e_utils.c
+++ b/src/bin/e_utils.c
@@ -62,7 +62,7 @@ e_util_glob_match(const char *str, const char *pattern)
}
if (str == pattern) return 1;
if (!strcmp(pattern, "*")) return 1;
- if (!fnmatch(pattern, str, 0)) return 1;
+ if (eina_fnmatch(pattern, str, 0)) return 1;
return 0;
}
@@ -87,7 +87,7 @@ e_util_glob_case_match(const char *str, const char *pattern)
for (tp = tglob, p = pattern; *p != 0; p++, tp++)
*tp = tolower(*p);
*tp = 0;
- if (!fnmatch(tglob, tstr, 0)) return 1;
+ if (eina_fnmatch(tglob, tstr, 0)) return 1;
return 0;
}
diff --git a/src/bin/meson.build b/src/bin/meson.build
index f4f1c315f9..5d15382cb5 100644
--- a/src/bin/meson.build
+++ b/src/bin/meson.build
@@ -16,7 +16,6 @@ deps_e = [
dep_m,
dep_dl,
dep_execinfo,
- dep_fnmatch,
dep_eina,
dep_eet,
dep_eeze,
diff --git a/src/bin/system/e_system.h b/src/bin/system/e_system.h
index 7d8e77bfd2..569699171b 100644
--- a/src/bin/system/e_system.h
+++ b/src/bin/system/e_system.h
@@ -52,7 +52,6 @@ void *alloca (size_t);
# include <dlfcn.h>
# include <math.h>
# include <fcntl.h>
-# include <fnmatch.h>
# include <limits.h>
# include <ctype.h>
# include <time.h>
diff --git a/src/bin/system/e_system_main.c b/src/bin/system/e_system_main.c
index 23a5f6f772..111430a846 100644
--- a/src/bin/system/e_system_main.c
+++ b/src/bin/system/e_system_main.c
@@ -15,12 +15,12 @@ _conf_allow_deny(const char *cmd, const char *glob, const char *sys)
if (!strcmp(cmd, "allow:"))
{
if (!strcmp(glob, "*")) return 1; // allow
- if (!fnmatch(glob, sys, 0)) return 1; // allow this sys
+ if (eina_fnmatch(glob, sys, 0)) return 1; // allow this sys
}
else if (!strcmp(cmd, "deny:"))
{
if (!strcmp(glob, "*")) return -1; // deny
- if (!fnmatch(glob, sys, 0)) return -1; // deny this sys
+ if (eina_fnmatch(glob, sys, 0)) return -1; // deny this sys
}
return 0; // unknown
}
@@ -58,7 +58,7 @@ _etc_enlightenment_system_conf_check(const char *sys)
in_usergroup = EINA_FALSE;
if (pw)
{
- if (!fnmatch(usergroup, pw->pw_name, 0))
+ if (eina_fnmatch(usergroup, pw->pw_name, 0))
{
in_usergroup = EINA_TRUE;
}
@@ -87,7 +87,7 @@ _etc_enlightenment_system_conf_check(const char *sys)
gp = getgrgid(gl[i]);
if (gp)
{
- if (!fnmatch(usergroup, gp->gr_name, 0))
+ if (eina_fnmatch(usergroup, gp->gr_name, 0))
{
in_usergroup = EINA_TRUE;
break;
diff --git a/src/modules/mixer/emixer.c b/src/modules/mixer/emixer.c
index beec525047..ab9266d6a6 100644
--- a/src/modules/mixer/emixer.c
+++ b/src/modules/mixer/emixer.c
@@ -42,7 +42,7 @@ _glob_case_match(const char *str, const char *pattern)
for (tp = tglob, p = pattern; *p != 0; p++, tp++)
*tp = tolower(*p);
*tp = 0;
- if (!fnmatch(tglob, tstr, 0)) return 1;
+ if (eina_fnmatch(tglob, tstr, 0)) return 1;
return 0;
}