aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_xdefaults.c
diff options
context:
space:
mode:
Diffstat (limited to 'legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_xdefaults.c')
-rw-r--r--legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_xdefaults.c39
1 files changed, 22 insertions, 17 deletions
diff --git a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_xdefaults.c b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_xdefaults.c
index ba41e9135e..e0e56102e2 100644
--- a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_xdefaults.c
+++ b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_xdefaults.c
@@ -2,14 +2,15 @@
#include <fnmatch.h>
/* local function prototypes */
-static Eina_Bool _ecore_xcb_xdefaults_glob_match(const char *str, const char *glob);
+static Eina_Bool _ecore_xcb_xdefaults_glob_match(const char *str,
+ const char *glob);
/* local variables */
static Eina_File *_ecore_xcb_xdefaults_file = NULL;
static char *_ecore_xcb_xdefaults_data = NULL;
-void
-_ecore_xcb_xdefaults_init(void)
+void
+_ecore_xcb_xdefaults_init(void)
{
char buff[PATH_MAX];
@@ -20,24 +21,25 @@ _ecore_xcb_xdefaults_init(void)
{
eina_mmap_safety_enabled_set(EINA_TRUE);
- _ecore_xcb_xdefaults_data =
+ _ecore_xcb_xdefaults_data =
eina_file_map_all(_ecore_xcb_xdefaults_file, EINA_FILE_SEQUENTIAL);
}
}
-void
-_ecore_xcb_xdefaults_shutdown(void)
+void
+_ecore_xcb_xdefaults_shutdown(void)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!_ecore_xcb_xdefaults_file) return;
- if (_ecore_xcb_xdefaults_data)
+ if (_ecore_xcb_xdefaults_data)
eina_file_map_free(_ecore_xcb_xdefaults_file, _ecore_xcb_xdefaults_data);
if (_ecore_xcb_xdefaults_file) eina_file_close(_ecore_xcb_xdefaults_file);
}
char *
-_ecore_xcb_xdefaults_string_get(const char *prog, const char *param)
+_ecore_xcb_xdefaults_string_get(const char *prog,
+ const char *param)
{
char buff[1024], ret[1024];
char *str = NULL;
@@ -51,9 +53,9 @@ _ecore_xcb_xdefaults_string_get(const char *prog, const char *param)
str = _ecore_xcb_xdefaults_data;
ea = eina_str_split_full(str, "\n", -1, &count);
- for (i = 0; i < count; i++)
+ for (i = 0; i < count; i++)
{
- if (_ecore_xcb_xdefaults_glob_match(ea[i], buff))
+ if (_ecore_xcb_xdefaults_glob_match(ea[i], buff))
sscanf(ea[i], "%*[^:]:%*[ ]%s", ret);
}
if ((ea) && (ea[0]))
@@ -65,8 +67,9 @@ _ecore_xcb_xdefaults_string_get(const char *prog, const char *param)
return strdup(ret);
}
-int
-_ecore_xcb_xdefaults_int_get(const char *prog, const char *param)
+int
+_ecore_xcb_xdefaults_int_get(const char *prog,
+ const char *param)
{
char buff[1024];
char *str = NULL;
@@ -81,9 +84,9 @@ _ecore_xcb_xdefaults_int_get(const char *prog, const char *param)
str = _ecore_xcb_xdefaults_data;
ea = eina_str_split_full(str, "\n", -1, &count);
- for (i = 0; i < count; i++)
+ for (i = 0; i < count; i++)
{
- if (_ecore_xcb_xdefaults_glob_match(ea[i], buff))
+ if (_ecore_xcb_xdefaults_glob_match(ea[i], buff))
sscanf(ea[i], "%*[^:]:%*[ ]%d", &ret);
}
if ((ea) && (ea[0]))
@@ -96,11 +99,12 @@ _ecore_xcb_xdefaults_int_get(const char *prog, const char *param)
}
/* local functions */
-static Eina_Bool
-_ecore_xcb_xdefaults_glob_match(const char *str, const char *glob)
+static Eina_Bool
+_ecore_xcb_xdefaults_glob_match(const char *str,
+ const char *glob)
{
if ((!str) || (!glob)) return EINA_FALSE;
- if (glob[0] == 0)
+ if (glob[0] == 0)
{
if (str[0] == 0) return EINA_TRUE;
return EINA_FALSE;
@@ -109,3 +113,4 @@ _ecore_xcb_xdefaults_glob_match(const char *str, const char *glob)
if (!fnmatch(glob, str, 0)) return EINA_TRUE;
return EINA_FALSE;
}
+