aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ecore/src/lib/ecore_config
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/ecore/src/lib/ecore_config')
-rw-r--r--libraries/ecore/src/lib/ecore_config/Ecore_Config.h312
-rw-r--r--libraries/ecore/src/lib/ecore_config/Makefile.am62
-rw-r--r--libraries/ecore/src/lib/ecore_config/Makefile.in869
-rw-r--r--libraries/ecore/src/lib/ecore_config/ecore_config.c1870
-rw-r--r--libraries/ecore/src/lib/ecore_config/ecore_config_db.c296
-rw-r--r--libraries/ecore/src/lib/ecore_config/ecore_config_extra.c803
-rw-r--r--libraries/ecore/src/lib/ecore_config/ecore_config_ipc.h50
-rw-r--r--libraries/ecore/src/lib/ecore_config/ecore_config_ipc_ecore.c384
-rw-r--r--libraries/ecore/src/lib/ecore_config/ecore_config_ipc_main.c275
-rw-r--r--libraries/ecore/src/lib/ecore_config/ecore_config_private.h70
-rw-r--r--libraries/ecore/src/lib/ecore_config/ecore_config_storage.c176
-rw-r--r--libraries/ecore/src/lib/ecore_config/ecore_config_util.c129
-rw-r--r--libraries/ecore/src/lib/ecore_config/ecore_config_util.h14
13 files changed, 0 insertions, 5310 deletions
diff --git a/libraries/ecore/src/lib/ecore_config/Ecore_Config.h b/libraries/ecore/src/lib/ecore_config/Ecore_Config.h
deleted file mode 100644
index 6733d7b..0000000
--- a/libraries/ecore/src/lib/ecore_config/Ecore_Config.h
+++ /dev/null
@@ -1,312 +0,0 @@
1#ifndef _ECORE_CONFIG_H
2# define _ECORE_CONFIG_H
3
4#ifdef EAPI
5#undef EAPI
6#endif
7#ifdef _MSC_VER
8# ifdef BUILDING_DLL
9# define EAPI __declspec(dllexport)
10# else
11# define EAPI __declspec(dllimport)
12# endif
13#else
14# ifdef __GNUC__
15# if __GNUC__ >= 4
16# define EAPI __attribute__ ((visibility("default")))
17# else
18# define EAPI
19# endif
20# else
21# define EAPI
22# endif
23#endif
24
25/**
26 * @file
27 * @brief Provides the Enlightened Property Library.
28 *
29 * This file provies all headers and structs for use with Ecore_Config.
30 * Using individual header files should not be necessary.
31 */
32
33# define DIR_DELIMITER '/'
34# define ECORE_CONFIG_FLOAT_PRECISION 1000
35
36/* FIXME: this should only be included if evas is present */
37# include <Evas.h>
38
39# define ECORE_CONFIG_GLOBAL_ID "_system"
40
41/* structures */
42
43/**
44 * Valid configuration property types.
45 */
46typedef enum Ecore_Config_Type
47{
48 ECORE_CONFIG_NIL = 0, /**< Property with no value. */
49 ECORE_CONFIG_INT = 1, /**< Integer property type. */
50 ECORE_CONFIG_FLT = 2, /**< Float property type. */
51 ECORE_CONFIG_STR = 3, /**< String property type. */
52 ECORE_CONFIG_RGB = 4, /**< Colour property type. */
53 ECORE_CONFIG_THM = 5, /**< Theme property type. */
54 ECORE_CONFIG_BLN = 6, /**< Boolean property type. */
55 ECORE_CONFIG_SCT = 7, /**< Structure property type */
56} Ecore_Config_Type;
57
58typedef enum Ecore_Config_Flag
59{
60 ECORE_CONFIG_FLAG_NONE = 0,
61 ECORE_CONFIG_FLAG_BOUNDS = 1,
62 ECORE_CONFIG_FLAG_MODIFIED = 2,
63 ECORE_CONFIG_FLAG_SYSTEM = 4,
64 ECORE_CONFIG_FLAG_CMDLN = 8
65} Ecore_Config_Flag;
66
67/**
68 * Property change callback function prototype.
69 */
70typedef int (*Ecore_Config_Listener) (const char *key,
71 const Ecore_Config_Type type,
72 const int tag, void *data);
73
74typedef struct Ecore_Config_Listener_List
75{
76 Ecore_Config_Listener listener;
77 const char *name;
78 void *data;
79 int tag;
80 struct Ecore_Config_Listener_List *next;
81} Ecore_Config_Listener_List;
82
83/**
84 * The actual property for storing a key-value pair.
85 */
86typedef struct Ecore_Config_Prop
87{
88 char *key; /* Property key. */
89 char *description; /* Description set by ecore_config_descibe. */
90 char short_opt; /* short identifier on command line (-f) */
91 char *long_opt; /* long identifier on command line (--foo) */
92 char *ptr; /* Used as the value when the property is a string or theme. */
93 Ecore_Config_Type type; /* Property type. */
94 long val; /* Used as the value when the property is an integer, float or colour. */
95 long lo; /* Lower bound for the value when the property is an integer or float. */
96 long hi; /* Higher bound for the value when the property is an integer or float. */
97 long step; /* Increment for the value when the property is an integer or float. */
98 Ecore_Config_Flag flags; /// < Configuration flags.
99 Ecore_Config_Listener_List *listeners; /* List of change listeners. */
100 void *data; /// < Stores extra data for the property.
101 struct Ecore_Config_Prop *parent; /* if we are in a struct we have a parent to notify of changes etc */
102 struct Ecore_Config_Prop *next; /* Pointer to the next property in the list. */
103} Ecore_Config_Prop;
104
105/*
106 * A container for a list of properties. Provided so that an
107 * application can use different set of properties at any time. This
108 * is useful for multiple window support.
109 */
110typedef struct Ecore_Config_Bundle
111{
112 char *identifier; /* Identifier for this set of properties (window ID for example) */
113 char *owner; /* This is used to store the application name related to the bundle */
114 long serial; /* Unique identifier to identify bundle */
115 Ecore_Config_Prop *data; /* Pointer to root of property list */
116 void *user_data; /* App specific pointer to "other data" */
117 struct Ecore_Config_Bundle *next; /* Pointer to next bundle in this application */
118} Ecore_Config_Bundle;
119
120typedef struct Ecore_Config_Server
121{
122 void *server;
123 char *name;
124 Ecore_Config_Bundle *bundles; /* data anchor */
125 struct Ecore_Config_Server *next;
126} Ecore_Config_Server;
127
128# ifdef __cplusplus
129extern "C"
130{
131# endif
132
133/* global ptrs to save passing them through the API */
134 EAPI extern Ecore_Config_Server *__ecore_config_server_global;
135 EAPI extern Ecore_Config_Server *__ecore_config_server_local;
136 EAPI extern Ecore_Config_Bundle *__ecore_config_bundle_local;
137 EAPI extern char *__ecore_config_app_name;
138
139 EAPI Ecore_Config_Prop *ecore_config_get(const char *key);
140 EAPI const char *ecore_config_type_get(const Ecore_Config_Prop *e);
141 EAPI int ecore_config_boolean_get(const char *key);
142 EAPI char *ecore_config_string_get(const char *key);
143 EAPI long ecore_config_int_get(const char *key);
144 EAPI int ecore_config_argb_get(const char *key, int *a, int *r,
145 int *g, int *b);
146 EAPI long ecore_config_argbint_get(const char *key);
147 EAPI char *ecore_config_argbstr_get(const char *key);
148 EAPI float ecore_config_float_get(const char *key);
149 EAPI char *ecore_config_theme_get(const char *key);
150 EAPI char *ecore_config_as_string_get(const char *key);
151 EAPI int ecore_config_bound(Ecore_Config_Prop *e);
152 EAPI int ecore_config_describe(const char *key, const char *desc);
153 EAPI int ecore_config_short_opt_set(const char *key,
154 char short_opt);
155 EAPI int ecore_config_long_opt_set(const char *key,
156 const char *long_opt);
157 EAPI int ecore_config_set(const char *key, const char *val);
158 EAPI int ecore_config_typed_set(const char *key, const void *val,
159 int type);
160 EAPI int ecore_config_boolean_set(const char *key, int val);
161 EAPI int ecore_config_string_set(const char *key, const char *val);
162 EAPI int ecore_config_int_set(const char *key, int val);
163 EAPI int ecore_config_argb_set(const char *key, int a, int r, int g, int b);
164 EAPI int ecore_config_argbint_set(const char *key, long argb);
165 EAPI int ecore_config_argbstr_set(const char *key, const char *val);
166 EAPI int ecore_config_float_set(const char *key, float val);
167 EAPI int ecore_config_theme_set(const char *key, const char *val);
168 EAPI int ecore_config_theme_preview_group_set(const char *key,
169 const char *group);
170 EAPI int ecore_config_as_string_set(const char *key, const char *val);
171
172 EAPI int ecore_config_default(const char *key, const char *val,
173 float lo, float hi, float step);
174 EAPI int ecore_config_typed_default(const char *key, const void *val,
175 int type);
176 EAPI int ecore_config_boolean_default(const char *key, int val);
177 EAPI int ecore_config_int_default(const char *key, int val);
178 EAPI int ecore_config_int_default_bound(const char *key, int val,
179 int lo, int hi, int step);
180 EAPI int ecore_config_string_default(const char *key, const char *val);
181 EAPI int ecore_config_float_default(const char *key, float val);
182 EAPI int ecore_config_float_default_bound(const char *key,
183 float val, float lo,
184 float hi, float step);
185 EAPI int ecore_config_argb_default(const char *key, int a, int r, int g, int b);
186 EAPI int ecore_config_argbint_default(const char *key, long argb);
187 EAPI int ecore_config_argbstr_default(const char *key, const char *val);
188 EAPI int ecore_config_theme_default(const char *key, const char *val);
189 EAPI int ecore_config_struct_default(const char *key);
190 EAPI int ecore_config_struct_int_add(const char *key, const char *name, int val);
191 EAPI int ecore_config_struct_float_add(const char *key, const char *name, float val);
192 EAPI int ecore_config_struct_create(const char *key);
193 EAPI int ecore_config_struct_string_add(const char *key, const char *name, const char* val);
194 EAPI int ecore_config_struct_theme_add(const char *key, const char *name, const char* val);
195 EAPI int ecore_config_struct_argb_add(const char *key, const char *name, int a, int r, int g, int b);
196 EAPI int ecore_config_struct_boolean_add(const char *key, const char *name, int val);
197 EAPI int ecore_config_struct_get(const char *key, void *data);
198
199 EAPI int ecore_config_listen(const char *name, const char *key,
200 Ecore_Config_Listener listener,
201 int tag, void *data);
202 EAPI int ecore_config_deaf(const char *name, const char *key,
203 Ecore_Config_Listener listener);
204 EAPI Ecore_Config_Prop *ecore_config_dst(Ecore_Config_Prop *e);
205 EAPI int ecore_config_type_guess(const char *key, const char *val);
206
207 EAPI Ecore_Config_Bundle *ecore_config_bundle_new(Ecore_Config_Server *srv,
208 const char *id);
209 EAPI Ecore_Config_Bundle *ecore_config_bundle_1st_get(Ecore_Config_Server *srv);
210 EAPI Ecore_Config_Bundle *ecore_config_bundle_next_get(Ecore_Config_Bundle *ns);
211 EAPI Ecore_Config_Bundle *ecore_config_bundle_by_serial_get(Ecore_Config_Server *srv,
212 long serial);
213 EAPI Ecore_Config_Bundle *ecore_config_bundle_by_label_get(Ecore_Config_Server *srv,
214 const char *label);
215 EAPI long ecore_config_bundle_serial_get(Ecore_Config_Bundle *ns);
216 EAPI char *ecore_config_bundle_label_get(Ecore_Config_Bundle *ns);
217
218 EAPI int ecore_config_init(const char *name);
219 EAPI int ecore_config_shutdown(void);
220
221 EAPI int ecore_config_system_init(void);
222 EAPI int ecore_config_system_shutdown(void);
223
224 EAPI int ecore_config_load(void);
225 EAPI int ecore_config_file_load(const char *file);
226 EAPI int ecore_config_save(void);
227 EAPI int ecore_config_file_save(const char *file);
228
229/* error codes */
230# define ECORE_CONFIG_ERR_NOTSUPP (-16)
231# define ECORE_CONFIG_ERR_NOFILE (-15)
232# define ECORE_CONFIG_ERR_META_DLFAIL (-14)
233# define ECORE_CONFIG_ERR_META_FILE (-13)
234# define ECORE_CONFIG_ERR_META_FORMAT (-12)
235# define ECORE_CONFIG_ERR_MONMIS (-11)
236# define ECORE_CONFIG_ERR_NOEXEC (-10)
237# define ECORE_CONFIG_ERR_PARTIAL (-9)
238# define ECORE_CONFIG_ERR_PATHEX (-8)
239# define ECORE_CONFIG_ERR_TYPEMISMATCH (-7)
240# define ECORE_CONFIG_ERR_MUTEX (-6)
241# define ECORE_CONFIG_ERR_NOTFOUND (-5) /* Error indicating that the item searched for could not be found. */
242# define ECORE_CONFIG_ERR_OOM (-4) /* Error given when the program runs out of memory. */
243# define ECORE_CONFIG_ERR_IGNORED (-3) /* Error occurred, but was ignored. */
244# define ECORE_CONFIG_ERR_NODATA (-2) /* Error given when necessary data is not provided. */
245# define ECORE_CONFIG_ERR_FAIL (-1) /* Failure result. */
246# define ECORE_CONFIG_ERR_SUCC (0) /* Success result. */
247
248# define ECORE_CONFIG_PARSE_HELP (-2) /* Help was displayed */
249# define ECORE_CONFIG_PARSE_EXIT (-1) /* An error occurred */
250# define ECORE_CONFIG_PARSE_CONTINUE (0) /* Arguments parsed successfully */
251
252/* convenience mathods in convenience.c */
253 /* FIXME: this should only be included if evas is present */
254 EAPI int ecore_config_evas_font_path_apply(Evas *evas);
255 EAPI char *ecore_config_theme_search_path_get(void);
256 EAPI int ecore_config_theme_search_path_append(const char *append);
257
258 EAPI char *ecore_config_theme_default_path_get(void);
259 EAPI char *ecore_config_theme_with_path_from_name_get(char *name);
260 EAPI char *ecore_config_theme_with_path_get(const char *key);
261 EAPI void ecore_config_args_display(void);
262 EAPI int ecore_config_args_parse(void);
263 EAPI void ecore_config_args_callback_str_add(char short_opt,
264 char *long_opt, char *desc,
265 void (*func)(char *val, void *data),
266 void *data);
267 EAPI void ecore_config_args_callback_noarg_add(char short_opt,
268 char *long_opt, char *desc,
269 void (*func)(char *val, void *data),
270 void *data);
271 EAPI void ecore_config_app_describe(char *description);
272
273 EAPI int ecore_config_create(const char *key, void *val,
274 char short_opt, char *long_opt,
275 char *desc);
276 EAPI int ecore_config_typed_create(const char *key, void *val,
277 int type, char short_opt,
278 char *long_opt, char *desc);
279 EAPI int ecore_config_boolean_create(const char *key, int val,
280 char short_opt, char *long_opt,
281 char *desc);
282 EAPI int ecore_config_int_create(const char *key, int val,
283 char short_opt, char *long_opt,
284 char *desc);
285 EAPI int ecore_config_int_create_bound(const char *key, int val,
286 int low, int high,
287 int step, char short_opt,
288 char *long_opt,
289 char *desc);
290 EAPI int ecore_config_string_create(const char *key, char *val,
291 char short_opt,
292 char *long_opt, char *desc);
293 EAPI int ecore_config_float_create(const char *key, float val,
294 char short_opt, char *long_opt,
295 char *desc);
296 EAPI int ecore_config_float_create_bound(const char *key,
297 float val, float low,
298 float high, float step,
299 char short_opt,
300 char *long_opt,
301 char *desc);
302 EAPI int ecore_config_argb_create(const char *key, char *val,
303 char short_opt, char *long_opt,
304 char *desc);
305 EAPI int ecore_config_theme_create(const char *key, char *val,
306 char short_opt, char *long_opt,
307 char *desc);
308
309# ifdef __cplusplus
310}
311# endif
312#endif
diff --git a/libraries/ecore/src/lib/ecore_config/Makefile.am b/libraries/ecore/src/lib/ecore_config/Makefile.am
deleted file mode 100644
index c459351..0000000
--- a/libraries/ecore/src/lib/ecore_config/Makefile.am
+++ /dev/null
@@ -1,62 +0,0 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3AM_CPPFLAGS = \
4-I$(top_srcdir)/src/lib/ecore \
5-I$(top_srcdir)/src/lib/ecore_ipc \
6-I$(top_srcdir)/ \
7-I$(top_builddir)/src/lib/ecore \
8-I$(top_builddir)/src/lib/ecore_ipc \
9-I$(top_builddir)/ \
10-DPACKAGE_BIN_DIR=\"$(bindir)\" \
11-DPACKAGE_LIB_DIR=\"$(libdir)\" \
12-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
13@EVAS_CFLAGS@ \
14@EET_CFLAGS@ \
15@EINA_CFLAGS@
16
17CLEANFILES = $(DB)
18
19#DB = system.db
20#$(DB): Makefile
21# edb_ed $(top_builddir)/src/lib/ecore_config/$(DB) add /e/theme/name str "winter"
22# edb_ed $(top_builddir)/src/lib/ecore_config/$(DB) add /e/font/path str "$(pkgdatadir)/data/fonts"
23# edb_ed $(top_builddir)/src/lib/ecore_config/$(DB) add /apps/web/browser str `which firefox 2>/dev/null || which phoenix 2>/dev/null || which mozilla 2>/dev/null || which opera 2>/dev/null || which konqueror 2>/dev/null || which epiphany 2>/dev/null`
24# edb_ed $(top_builddir)/src/lib/ecore_config/$(DB) add /apps/web/email str `which thunderbird 2>/dev/null || which mozilla 2>/dev/null || which kmail 2>/dev/null || which sylpheed 2>/dev/null || which evolution 2>/dev/null`
25
26lib_LTLIBRARIES = libecore_config.la
27
28includes_HEADERS = Ecore_Config.h
29includesdir = $(includedir)/ecore-@VMAJ@
30
31libecore_config_la_LDFLAGS = -no-undefined -version-info @version_info@ @release_info@
32
33#config_DATA = $(DB)
34#configdir = $(pkgdatadir)
35
36libecore_config_la_SOURCES = \
37ecore_config.c \
38ecore_config_util.c \
39ecore_config_storage.c \
40ecore_config_extra.c \
41ecore_config_db.c
42
43libecore_config_la_LIBADD = \
44$(top_builddir)/src/lib/ecore/libecore.la \
45@EET_LIBS@ \
46@EINA_LIBS@ \
47@EVAS_LIBS@
48
49if BUILD_ECORE_IPC
50
51libecore_config_la_SOURCES += \
52ecore_config_ipc_main.c \
53ecore_config_ipc_ecore.c
54
55libecore_config_la_LIBADD += $(top_builddir)/src/lib/ecore_ipc/libecore_ipc.la
56
57endif
58
59EXTRA_DIST = \
60ecore_config_ipc.h \
61ecore_config_private.h \
62ecore_config_util.h
diff --git a/libraries/ecore/src/lib/ecore_config/Makefile.in b/libraries/ecore/src/lib/ecore_config/Makefile.in
deleted file mode 100644
index 4b908cd..0000000
--- a/libraries/ecore/src/lib/ecore_config/Makefile.in
+++ /dev/null
@@ -1,869 +0,0 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18
19VPATH = @srcdir@
20pkgdatadir = $(datadir)/@PACKAGE@
21pkgincludedir = $(includedir)/@PACKAGE@
22pkglibdir = $(libdir)/@PACKAGE@
23pkglibexecdir = $(libexecdir)/@PACKAGE@
24am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
25install_sh_DATA = $(install_sh) -c -m 644
26install_sh_PROGRAM = $(install_sh) -c
27install_sh_SCRIPT = $(install_sh) -c
28INSTALL_HEADER = $(INSTALL_DATA)
29transform = $(program_transform_name)
30NORMAL_INSTALL = :
31PRE_INSTALL = :
32POST_INSTALL = :
33NORMAL_UNINSTALL = :
34PRE_UNINSTALL = :
35POST_UNINSTALL = :
36build_triplet = @build@
37host_triplet = @host@
38@BUILD_ECORE_IPC_TRUE@am__append_1 = \
39@BUILD_ECORE_IPC_TRUE@ecore_config_ipc_main.c \
40@BUILD_ECORE_IPC_TRUE@ecore_config_ipc_ecore.c
41
42@BUILD_ECORE_IPC_TRUE@am__append_2 = $(top_builddir)/src/lib/ecore_ipc/libecore_ipc.la
43subdir = src/lib/ecore_config
44DIST_COMMON = $(includes_HEADERS) $(srcdir)/Makefile.am \
45 $(srcdir)/Makefile.in
46ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
47am__aclocal_m4_deps = $(top_srcdir)/m4/ac_attribute.m4 \
48 $(top_srcdir)/m4/ac_path_generic.m4 \
49 $(top_srcdir)/m4/check_x_extension.m4 \
50 $(top_srcdir)/m4/ecore_check_module.m4 \
51 $(top_srcdir)/m4/ecore_check_options.m4 \
52 $(top_srcdir)/m4/efl_compiler_flag.m4 \
53 $(top_srcdir)/m4/efl_doxygen.m4 \
54 $(top_srcdir)/m4/efl_examples.m4 \
55 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
56 $(top_srcdir)/m4/efl_threads.m4 $(top_srcdir)/m4/gettext.m4 \
57 $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
58 $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
59 $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
60 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
61 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
62 $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
63 $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac
64am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
65 $(ACLOCAL_M4)
66mkinstalldirs = $(install_sh) -d
67CONFIG_HEADER = $(top_builddir)/config.h
68CONFIG_CLEAN_FILES =
69CONFIG_CLEAN_VPATH_FILES =
70am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
71am__vpath_adj = case $$p in \
72 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
73 *) f=$$p;; \
74 esac;
75am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
76am__install_max = 40
77am__nobase_strip_setup = \
78 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
79am__nobase_strip = \
80 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
81am__nobase_list = $(am__nobase_strip_setup); \
82 for p in $$list; do echo "$$p $$p"; done | \
83 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
84 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
85 if (++n[$$2] == $(am__install_max)) \
86 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
87 END { for (dir in files) print dir, files[dir] }'
88am__base_list = \
89 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
90 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
91am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includesdir)"
92LTLIBRARIES = $(lib_LTLIBRARIES)
93libecore_config_la_DEPENDENCIES = \
94 $(top_builddir)/src/lib/ecore/libecore.la $(am__append_2)
95am__libecore_config_la_SOURCES_DIST = ecore_config.c \
96 ecore_config_util.c ecore_config_storage.c \
97 ecore_config_extra.c ecore_config_db.c ecore_config_ipc_main.c \
98 ecore_config_ipc_ecore.c
99@BUILD_ECORE_IPC_TRUE@am__objects_1 = ecore_config_ipc_main.lo \
100@BUILD_ECORE_IPC_TRUE@ ecore_config_ipc_ecore.lo
101am_libecore_config_la_OBJECTS = ecore_config.lo ecore_config_util.lo \
102 ecore_config_storage.lo ecore_config_extra.lo \
103 ecore_config_db.lo $(am__objects_1)
104libecore_config_la_OBJECTS = $(am_libecore_config_la_OBJECTS)
105AM_V_lt = $(am__v_lt_$(V))
106am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
107am__v_lt_0 = --silent
108libecore_config_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
109 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
110 $(AM_CFLAGS) $(CFLAGS) $(libecore_config_la_LDFLAGS) \
111 $(LDFLAGS) -o $@
112DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
113depcomp = $(SHELL) $(top_srcdir)/depcomp
114am__depfiles_maybe = depfiles
115am__mv = mv -f
116COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
117 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
118LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
119 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
120 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
121 $(AM_CFLAGS) $(CFLAGS)
122AM_V_CC = $(am__v_CC_$(V))
123am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
124am__v_CC_0 = @echo " CC " $@;
125AM_V_at = $(am__v_at_$(V))
126am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
127am__v_at_0 = @
128CCLD = $(CC)
129LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
130 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
131 $(AM_LDFLAGS) $(LDFLAGS) -o $@
132AM_V_CCLD = $(am__v_CCLD_$(V))
133am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
134am__v_CCLD_0 = @echo " CCLD " $@;
135AM_V_GEN = $(am__v_GEN_$(V))
136am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
137am__v_GEN_0 = @echo " GEN " $@;
138SOURCES = $(libecore_config_la_SOURCES)
139DIST_SOURCES = $(am__libecore_config_la_SOURCES_DIST)
140HEADERS = $(includes_HEADERS)
141ETAGS = etags
142CTAGS = ctags
143DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
144ACLOCAL = @ACLOCAL@
145ALLOCA = @ALLOCA@
146AMTAR = @AMTAR@
147AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
148AR = @AR@
149AS = @AS@
150AUTOCONF = @AUTOCONF@
151AUTOHEADER = @AUTOHEADER@
152AUTOMAKE = @AUTOMAKE@
153AWK = @AWK@
154CARES_CFLAGS = @CARES_CFLAGS@
155CARES_LIBS = @CARES_LIBS@
156CC = @CC@
157CCDEPMODE = @CCDEPMODE@
158CFLAGS = @CFLAGS@
159CHECK_CFLAGS = @CHECK_CFLAGS@
160CHECK_LIBS = @CHECK_LIBS@
161CPP = @CPP@
162CPPFLAGS = @CPPFLAGS@
163CURL_CFLAGS = @CURL_CFLAGS@
164CURL_LIBS = @CURL_LIBS@
165CXX = @CXX@
166CXXCPP = @CXXCPP@
167CXXDEPMODE = @CXXDEPMODE@
168CXXFLAGS = @CXXFLAGS@
169CYGPATH_W = @CYGPATH_W@
170DEFS = @DEFS@
171DEPDIR = @DEPDIR@
172DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
173DIRECTFB_LIBS = @DIRECTFB_LIBS@
174DLLTOOL = @DLLTOOL@
175DSYMUTIL = @DSYMUTIL@
176DUMPBIN = @DUMPBIN@
177ECHO_C = @ECHO_C@
178ECHO_N = @ECHO_N@
179ECHO_T = @ECHO_T@
180ECORE_XCB_CFLAGS = @ECORE_XCB_CFLAGS@
181ECORE_XCB_LIBS = @ECORE_XCB_LIBS@
182EFL_ECORE_BUILD = @EFL_ECORE_BUILD@
183EFL_ECORE_CON_BUILD = @EFL_ECORE_CON_BUILD@
184EFL_ECORE_EVAS_BUILD = @EFL_ECORE_EVAS_BUILD@
185EFL_ECORE_FILE_BUILD = @EFL_ECORE_FILE_BUILD@
186EFL_ECORE_IMF_BUILD = @EFL_ECORE_IMF_BUILD@
187EFL_ECORE_IMF_EVAS_BUILD = @EFL_ECORE_IMF_EVAS_BUILD@
188EFL_ECORE_INPUT_BUILD = @EFL_ECORE_INPUT_BUILD@
189EFL_ECORE_INPUT_EVAS_BUILD = @EFL_ECORE_INPUT_EVAS_BUILD@
190EFL_ECORE_IPC_BUILD = @EFL_ECORE_IPC_BUILD@
191EFL_ECORE_PSL1GHT_BUILD = @EFL_ECORE_PSL1GHT_BUILD@
192EFL_ECORE_SDL_BUILD = @EFL_ECORE_SDL_BUILD@
193EFL_ECORE_WIN32_BUILD = @EFL_ECORE_WIN32_BUILD@
194EFL_ECORE_WINCE_BUILD = @EFL_ECORE_WINCE_BUILD@
195EFL_PTHREAD_CFLAGS = @EFL_PTHREAD_CFLAGS@
196EFL_PTHREAD_LIBS = @EFL_PTHREAD_LIBS@
197EGREP = @EGREP@
198EINA_CFLAGS = @EINA_CFLAGS@
199EINA_LIBS = @EINA_LIBS@
200ESCAPE_CFLAGS = @ESCAPE_CFLAGS@
201ESCAPE_LIBS = @ESCAPE_LIBS@
202EVAS_CFLAGS = @EVAS_CFLAGS@
203EVAS_LIBS = @EVAS_LIBS@
204EVIL_CFLAGS = @EVIL_CFLAGS@
205EVIL_LIBS = @EVIL_LIBS@
206EXEEXT = @EXEEXT@
207EXOTIC_CFLAGS = @EXOTIC_CFLAGS@
208EXOTIC_LIBS = @EXOTIC_LIBS@
209FGREP = @FGREP@
210GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
211GLIB_CFLAGS = @GLIB_CFLAGS@
212GLIB_LIBS = @GLIB_LIBS@
213GMSGFMT = @GMSGFMT@
214GMSGFMT_015 = @GMSGFMT_015@
215GREP = @GREP@
216INSTALL = @INSTALL@
217INSTALL_DATA = @INSTALL_DATA@
218INSTALL_PROGRAM = @INSTALL_PROGRAM@
219INSTALL_SCRIPT = @INSTALL_SCRIPT@
220INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
221INTLLIBS = @INTLLIBS@
222INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
223KEYSYMDEFS = @KEYSYMDEFS@
224LD = @LD@
225LDFLAGS = @LDFLAGS@
226LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@
227LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@
228LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@
229LIBICONV = @LIBICONV@
230LIBINTL = @LIBINTL@
231LIBOBJS = @LIBOBJS@
232LIBS = @LIBS@
233LIBTOOL = @LIBTOOL@
234LIPO = @LIPO@
235LN_S = @LN_S@
236LTLIBICONV = @LTLIBICONV@
237LTLIBINTL = @LTLIBINTL@
238LTLIBOBJS = @LTLIBOBJS@
239MAKEINFO = @MAKEINFO@
240MKDIR_P = @MKDIR_P@
241MSGFMT = @MSGFMT@
242MSGFMT_015 = @MSGFMT_015@
243MSGMERGE = @MSGMERGE@
244NM = @NM@
245NMEDIT = @NMEDIT@
246OBJC = @OBJC@
247OBJCDEPMODE = @OBJCDEPMODE@
248OBJCFLAGS = @OBJCFLAGS@
249OBJDUMP = @OBJDUMP@
250OBJEXT = @OBJEXT@
251OTOOL = @OTOOL@
252OTOOL64 = @OTOOL64@
253PACKAGE = @PACKAGE@
254PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
255PACKAGE_NAME = @PACKAGE_NAME@
256PACKAGE_STRING = @PACKAGE_STRING@
257PACKAGE_TARNAME = @PACKAGE_TARNAME@
258PACKAGE_URL = @PACKAGE_URL@
259PACKAGE_VERSION = @PACKAGE_VERSION@
260PATH_SEPARATOR = @PATH_SEPARATOR@
261PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
262PIXMAN_LIBS = @PIXMAN_LIBS@
263PKG_CONFIG = @PKG_CONFIG@
264PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
265PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
266POSUB = @POSUB@
267RANLIB = @RANLIB@
268SCIM_CFLAGS = @SCIM_CFLAGS@
269SCIM_LIBS = @SCIM_LIBS@
270SDL_CFLAGS = @SDL_CFLAGS@
271SDL_CONFIG = @SDL_CONFIG@
272SDL_LIBS = @SDL_LIBS@
273SED = @SED@
274SET_MAKE = @SET_MAKE@
275SHELL = @SHELL@
276SHM_OPEN_LIBS = @SHM_OPEN_LIBS@
277SSL_CFLAGS = @SSL_CFLAGS@
278SSL_LIBS = @SSL_LIBS@
279STRIP = @STRIP@
280TLS2_CFLAGS = @TLS2_CFLAGS@
281TLS2_LIBS = @TLS2_LIBS@
282TLS_CFLAGS = @TLS_CFLAGS@
283TLS_LIBS = @TLS_LIBS@
284TSLIB_CFLAGS = @TSLIB_CFLAGS@
285TSLIB_LIBS = @TSLIB_LIBS@
286USE_NLS = @USE_NLS@
287VERSION = @VERSION@
288VMAJ = @VMAJ@
289WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
290WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
291WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
292WAYLAND_LIBS = @WAYLAND_LIBS@
293WIN32_CFLAGS = @WIN32_CFLAGS@
294WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
295WIN32_LIBS = @WIN32_LIBS@
296XCB_COMPOSITE_CFLAGS = @XCB_COMPOSITE_CFLAGS@
297XCB_COMPOSITE_LIBS = @XCB_COMPOSITE_LIBS@
298XCB_CURSOR_CFLAGS = @XCB_CURSOR_CFLAGS@
299XCB_CURSOR_LIBS = @XCB_CURSOR_LIBS@
300XCB_DAMAGE_CFLAGS = @XCB_DAMAGE_CFLAGS@
301XCB_DAMAGE_LIBS = @XCB_DAMAGE_LIBS@
302XCB_DPMS_CFLAGS = @XCB_DPMS_CFLAGS@
303XCB_DPMS_LIBS = @XCB_DPMS_LIBS@
304XCB_RANDR_CFLAGS = @XCB_RANDR_CFLAGS@
305XCB_RANDR_LIBS = @XCB_RANDR_LIBS@
306XCB_RENDER_CFLAGS = @XCB_RENDER_CFLAGS@
307XCB_RENDER_LIBS = @XCB_RENDER_LIBS@
308XCB_SCREENSAVER_CFLAGS = @XCB_SCREENSAVER_CFLAGS@
309XCB_SCREENSAVER_LIBS = @XCB_SCREENSAVER_LIBS@
310XCB_SHAPE_CFLAGS = @XCB_SHAPE_CFLAGS@
311XCB_SHAPE_LIBS = @XCB_SHAPE_LIBS@
312XCB_SYNC_CFLAGS = @XCB_SYNC_CFLAGS@
313XCB_SYNC_LIBS = @XCB_SYNC_LIBS@
314XCB_X11_CFLAGS = @XCB_X11_CFLAGS@
315XCB_X11_LIBS = @XCB_X11_LIBS@
316XCB_XFIXES_CFLAGS = @XCB_XFIXES_CFLAGS@
317XCB_XFIXES_LIBS = @XCB_XFIXES_LIBS@
318XCB_XGESTURE_CFLAGS = @XCB_XGESTURE_CFLAGS@
319XCB_XGESTURE_LIBS = @XCB_XGESTURE_LIBS@
320XCB_XINERAMA_CFLAGS = @XCB_XINERAMA_CFLAGS@
321XCB_XINERAMA_LIBS = @XCB_XINERAMA_LIBS@
322XCB_XINPUT_CFLAGS = @XCB_XINPUT_CFLAGS@
323XCB_XINPUT_LIBS = @XCB_XINPUT_LIBS@
324XCB_XPRINT_CFLAGS = @XCB_XPRINT_CFLAGS@
325XCB_XPRINT_LIBS = @XCB_XPRINT_LIBS@
326XCB_XTEST_CFLAGS = @XCB_XTEST_CFLAGS@
327XCB_XTEST_LIBS = @XCB_XTEST_LIBS@
328XCOMPOSITE_CFLAGS = @XCOMPOSITE_CFLAGS@
329XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@
330XDAMAGE_CFLAGS = @XDAMAGE_CFLAGS@
331XDAMAGE_LIBS = @XDAMAGE_LIBS@
332XDPMS_CFLAGS = @XDPMS_CFLAGS@
333XDPMS_LIBS = @XDPMS_LIBS@
334XFIXES_CFLAGS = @XFIXES_CFLAGS@
335XFIXES_LIBS = @XFIXES_LIBS@
336XGESTURE_CFLAGS = @XGESTURE_CFLAGS@
337XGESTURE_LIBS = @XGESTURE_LIBS@
338XGETTEXT = @XGETTEXT@
339XGETTEXT_015 = @XGETTEXT_015@
340XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
341XI2_CFLAGS = @XI2_CFLAGS@
342XI2_LIBS = @XI2_LIBS@
343XINERAMA_CFLAGS = @XINERAMA_CFLAGS@
344XINERAMA_LIBS = @XINERAMA_LIBS@
345XKB_CFLAGS = @XKB_CFLAGS@
346XKB_LIBS = @XKB_LIBS@
347XMKMF = @XMKMF@
348XPRINT_CFLAGS = @XPRINT_CFLAGS@
349XPRINT_LIBS = @XPRINT_LIBS@
350XRANDR_CFLAGS = @XRANDR_CFLAGS@
351XRANDR_LIBS = @XRANDR_LIBS@
352XRENDER_CFLAGS = @XRENDER_CFLAGS@
353XRENDER_LIBS = @XRENDER_LIBS@
354XSS_CFLAGS = @XSS_CFLAGS@
355XSS_LIBS = @XSS_LIBS@
356XTEST_CFLAGS = @XTEST_CFLAGS@
357XTEST_LIBS = @XTEST_LIBS@
358X_CFLAGS = @X_CFLAGS@
359X_EXTRA_LIBS = @X_EXTRA_LIBS@
360X_LIBS = @X_LIBS@
361X_PRE_LIBS = @X_PRE_LIBS@
362Xcursor_cflags = @Xcursor_cflags@
363Xcursor_libs = @Xcursor_libs@
364abs_builddir = @abs_builddir@
365abs_srcdir = @abs_srcdir@
366abs_top_builddir = @abs_top_builddir@
367abs_top_srcdir = @abs_top_srcdir@
368ac_ct_CC = @ac_ct_CC@
369ac_ct_CXX = @ac_ct_CXX@
370ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
371ac_ct_OBJC = @ac_ct_OBJC@
372am__include = @am__include@
373am__leading_dot = @am__leading_dot@
374am__quote = @am__quote@
375am__tar = @am__tar@
376am__untar = @am__untar@
377bindir = @bindir@
378build = @build@
379build_alias = @build_alias@
380build_cpu = @build_cpu@
381build_os = @build_os@
382build_vendor = @build_vendor@
383builddir = @builddir@
384cocoa_ldflags = @cocoa_ldflags@
385datadir = @datadir@
386datarootdir = @datarootdir@
387dlopen_libs = @dlopen_libs@
388docdir = @docdir@
389dvidir = @dvidir@
390ecore_cocoa_cflags = @ecore_cocoa_cflags@
391ecore_cocoa_libs = @ecore_cocoa_libs@
392ecore_con_cflags = @ecore_con_cflags@
393ecore_con_libs = @ecore_con_libs@
394ecore_directfb_cflags = @ecore_directfb_cflags@
395ecore_directfb_libs = @ecore_directfb_libs@
396ecore_evas_cflags = @ecore_evas_cflags@
397ecore_evas_libs = @ecore_evas_libs@
398ecore_fb_cflags = @ecore_fb_cflags@
399ecore_fb_libs = @ecore_fb_libs@
400ecore_file_cflags = @ecore_file_cflags@
401ecore_file_libs = @ecore_file_libs@
402ecore_imf_cflags = @ecore_imf_cflags@
403ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
404ecore_imf_evas_libs = @ecore_imf_evas_libs@
405ecore_imf_libs = @ecore_imf_libs@
406ecore_imf_scim_cflags = @ecore_imf_scim_cflags@
407ecore_imf_scim_libs = @ecore_imf_scim_libs@
408ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
409ecore_imf_xim_libs = @ecore_imf_xim_libs@
410ecore_input_cflags = @ecore_input_cflags@
411ecore_input_evas_cflags = @ecore_input_evas_cflags@
412ecore_input_evas_libs = @ecore_input_evas_libs@
413ecore_input_libs = @ecore_input_libs@
414ecore_ipc_cflags = @ecore_ipc_cflags@
415ecore_ipc_libs = @ecore_ipc_libs@
416ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
417ecore_psl1ght_libs = @ecore_psl1ght_libs@
418ecore_sdl_cflags = @ecore_sdl_cflags@
419ecore_sdl_libs = @ecore_sdl_libs@
420ecore_wayland_cflags = @ecore_wayland_cflags@
421ecore_wayland_libs = @ecore_wayland_libs@
422ecore_win32_cflags = @ecore_win32_cflags@
423ecore_win32_libs = @ecore_win32_libs@
424ecore_wince_cflags = @ecore_wince_cflags@
425ecore_wince_libs = @ecore_wince_libs@
426ecore_x_cflags = @ecore_x_cflags@
427ecore_x_libs = @ecore_x_libs@
428ecore_x_libs_private = @ecore_x_libs_private@
429efl_doxygen = @efl_doxygen@
430efl_have_doxygen = @efl_have_doxygen@
431exec_prefix = @exec_prefix@
432have_ecore_x_xcb_define = @have_ecore_x_xcb_define@
433host = @host@
434host_alias = @host_alias@
435host_cpu = @host_cpu@
436host_os = @host_os@
437host_vendor = @host_vendor@
438htmldir = @htmldir@
439includedir = @includedir@
440infodir = @infodir@
441install_sh = @install_sh@
442libdir = @libdir@
443libexecdir = @libexecdir@
444localedir = @localedir@
445localstatedir = @localstatedir@
446lt_ECHO = @lt_ECHO@
447lt_enable_auto_import = @lt_enable_auto_import@
448mandir = @mandir@
449mkdir_p = @mkdir_p@
450oldincludedir = @oldincludedir@
451pdfdir = @pdfdir@
452pkgconfig_requires_private = @pkgconfig_requires_private@
453prefix = @prefix@
454program_transform_name = @program_transform_name@
455psdir = @psdir@
456release_info = @release_info@
457requirements_ecore = @requirements_ecore@
458requirements_ecore_cocoa = @requirements_ecore_cocoa@
459requirements_ecore_con = @requirements_ecore_con@
460requirements_ecore_directfb = @requirements_ecore_directfb@
461requirements_ecore_evas = @requirements_ecore_evas@
462requirements_ecore_fb = @requirements_ecore_fb@
463requirements_ecore_file = @requirements_ecore_file@
464requirements_ecore_imf = @requirements_ecore_imf@
465requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
466requirements_ecore_imf_scim = @requirements_ecore_imf_scim@
467requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
468requirements_ecore_input = @requirements_ecore_input@
469requirements_ecore_input_evas = @requirements_ecore_input_evas@
470requirements_ecore_ipc = @requirements_ecore_ipc@
471requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
472requirements_ecore_sdl = @requirements_ecore_sdl@
473requirements_ecore_wayland = @requirements_ecore_wayland@
474requirements_ecore_win32 = @requirements_ecore_win32@
475requirements_ecore_wince = @requirements_ecore_wince@
476requirements_ecore_x = @requirements_ecore_x@
477rt_libs = @rt_libs@
478sbindir = @sbindir@
479sharedstatedir = @sharedstatedir@
480srcdir = @srcdir@
481sysconfdir = @sysconfdir@
482target_alias = @target_alias@
483top_build_prefix = @top_build_prefix@
484top_builddir = @top_builddir@
485top_srcdir = @top_srcdir@
486version_info = @version_info@
487x_cflags = @x_cflags@
488x_includes = @x_includes@
489x_libs = @x_libs@
490MAINTAINERCLEANFILES = Makefile.in
491AM_CPPFLAGS = \
492-I$(top_srcdir)/src/lib/ecore \
493-I$(top_srcdir)/src/lib/ecore_ipc \
494-I$(top_srcdir)/ \
495-I$(top_builddir)/src/lib/ecore \
496-I$(top_builddir)/src/lib/ecore_ipc \
497-I$(top_builddir)/ \
498-DPACKAGE_BIN_DIR=\"$(bindir)\" \
499-DPACKAGE_LIB_DIR=\"$(libdir)\" \
500-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
501@EVAS_CFLAGS@ \
502@EET_CFLAGS@ \
503@EINA_CFLAGS@
504
505CLEANFILES = $(DB)
506
507#DB = system.db
508#$(DB): Makefile
509# edb_ed $(top_builddir)/src/lib/ecore_config/$(DB) add /e/theme/name str "winter"
510# edb_ed $(top_builddir)/src/lib/ecore_config/$(DB) add /e/font/path str "$(pkgdatadir)/data/fonts"
511# edb_ed $(top_builddir)/src/lib/ecore_config/$(DB) add /apps/web/browser str `which firefox 2>/dev/null || which phoenix 2>/dev/null || which mozilla 2>/dev/null || which opera 2>/dev/null || which konqueror 2>/dev/null || which epiphany 2>/dev/null`
512# edb_ed $(top_builddir)/src/lib/ecore_config/$(DB) add /apps/web/email str `which thunderbird 2>/dev/null || which mozilla 2>/dev/null || which kmail 2>/dev/null || which sylpheed 2>/dev/null || which evolution 2>/dev/null`
513lib_LTLIBRARIES = libecore_config.la
514includes_HEADERS = Ecore_Config.h
515includesdir = $(includedir)/ecore-@VMAJ@
516libecore_config_la_LDFLAGS = -no-undefined -version-info @version_info@ @release_info@
517
518#config_DATA = $(DB)
519#configdir = $(pkgdatadir)
520libecore_config_la_SOURCES = ecore_config.c ecore_config_util.c \
521 ecore_config_storage.c ecore_config_extra.c ecore_config_db.c \
522 $(am__append_1)
523libecore_config_la_LIBADD = $(top_builddir)/src/lib/ecore/libecore.la \
524 @EET_LIBS@ @EINA_LIBS@ @EVAS_LIBS@ $(am__append_2)
525EXTRA_DIST = \
526ecore_config_ipc.h \
527ecore_config_private.h \
528ecore_config_util.h
529
530all: all-am
531
532.SUFFIXES:
533.SUFFIXES: .c .lo .o .obj
534$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
535 @for dep in $?; do \
536 case '$(am__configure_deps)' in \
537 *$$dep*) \
538 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
539 && { if test -f $@; then exit 0; else break; fi; }; \
540 exit 1;; \
541 esac; \
542 done; \
543 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/ecore_config/Makefile'; \
544 $(am__cd) $(top_srcdir) && \
545 $(AUTOMAKE) --gnu src/lib/ecore_config/Makefile
546.PRECIOUS: Makefile
547Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
548 @case '$?' in \
549 *config.status*) \
550 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
551 *) \
552 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
553 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
554 esac;
555
556$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
557 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
558
559$(top_srcdir)/configure: $(am__configure_deps)
560 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
561$(ACLOCAL_M4): $(am__aclocal_m4_deps)
562 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
563$(am__aclocal_m4_deps):
564install-libLTLIBRARIES: $(lib_LTLIBRARIES)
565 @$(NORMAL_INSTALL)
566 test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
567 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
568 list2=; for p in $$list; do \
569 if test -f $$p; then \
570 list2="$$list2 $$p"; \
571 else :; fi; \
572 done; \
573 test -z "$$list2" || { \
574 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
575 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
576 }
577
578uninstall-libLTLIBRARIES:
579 @$(NORMAL_UNINSTALL)
580 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
581 for p in $$list; do \
582 $(am__strip_dir) \
583 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
584 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
585 done
586
587clean-libLTLIBRARIES:
588 -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
589 @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
590 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
591 test "$$dir" != "$$p" || dir=.; \
592 echo "rm -f \"$${dir}/so_locations\""; \
593 rm -f "$${dir}/so_locations"; \
594 done
595libecore_config.la: $(libecore_config_la_OBJECTS) $(libecore_config_la_DEPENDENCIES)
596 $(AM_V_CCLD)$(libecore_config_la_LINK) -rpath $(libdir) $(libecore_config_la_OBJECTS) $(libecore_config_la_LIBADD) $(LIBS)
597
598mostlyclean-compile:
599 -rm -f *.$(OBJEXT)
600
601distclean-compile:
602 -rm -f *.tab.c
603
604@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_config.Plo@am__quote@
605@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_config_db.Plo@am__quote@
606@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_config_extra.Plo@am__quote@
607@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_config_ipc_ecore.Plo@am__quote@
608@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_config_ipc_main.Plo@am__quote@
609@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_config_storage.Plo@am__quote@
610@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_config_util.Plo@am__quote@
611
612.c.o:
613@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
614@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
615@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
616@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
617@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
618@am__fastdepCC_FALSE@ $(COMPILE) -c $<
619
620.c.obj:
621@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
622@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
623@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
624@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
625@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
626@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
627
628.c.lo:
629@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
630@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
631@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
632@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
633@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
634@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
635
636mostlyclean-libtool:
637 -rm -f *.lo
638
639clean-libtool:
640 -rm -rf .libs _libs
641install-includesHEADERS: $(includes_HEADERS)
642 @$(NORMAL_INSTALL)
643 test -z "$(includesdir)" || $(MKDIR_P) "$(DESTDIR)$(includesdir)"
644 @list='$(includes_HEADERS)'; test -n "$(includesdir)" || list=; \
645 for p in $$list; do \
646 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
647 echo "$$d$$p"; \
648 done | $(am__base_list) | \
649 while read files; do \
650 echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includesdir)'"; \
651 $(INSTALL_HEADER) $$files "$(DESTDIR)$(includesdir)" || exit $$?; \
652 done
653
654uninstall-includesHEADERS:
655 @$(NORMAL_UNINSTALL)
656 @list='$(includes_HEADERS)'; test -n "$(includesdir)" || list=; \
657 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
658 test -n "$$files" || exit 0; \
659 echo " ( cd '$(DESTDIR)$(includesdir)' && rm -f" $$files ")"; \
660 cd "$(DESTDIR)$(includesdir)" && rm -f $$files
661
662ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
663 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
664 unique=`for i in $$list; do \
665 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
666 done | \
667 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
668 END { if (nonempty) { for (i in files) print i; }; }'`; \
669 mkid -fID $$unique
670tags: TAGS
671
672TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
673 $(TAGS_FILES) $(LISP)
674 set x; \
675 here=`pwd`; \
676 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
677 unique=`for i in $$list; do \
678 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
679 done | \
680 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
681 END { if (nonempty) { for (i in files) print i; }; }'`; \
682 shift; \
683 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
684 test -n "$$unique" || unique=$$empty_fix; \
685 if test $$# -gt 0; then \
686 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
687 "$$@" $$unique; \
688 else \
689 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
690 $$unique; \
691 fi; \
692 fi
693ctags: CTAGS
694CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
695 $(TAGS_FILES) $(LISP)
696 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
697 unique=`for i in $$list; do \
698 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
699 done | \
700 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
701 END { if (nonempty) { for (i in files) print i; }; }'`; \
702 test -z "$(CTAGS_ARGS)$$unique" \
703 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
704 $$unique
705
706GTAGS:
707 here=`$(am__cd) $(top_builddir) && pwd` \
708 && $(am__cd) $(top_srcdir) \
709 && gtags -i $(GTAGS_ARGS) "$$here"
710
711distclean-tags:
712 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
713
714distdir: $(DISTFILES)
715 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
716 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
717 list='$(DISTFILES)'; \
718 dist_files=`for file in $$list; do echo $$file; done | \
719 sed -e "s|^$$srcdirstrip/||;t" \
720 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
721 case $$dist_files in \
722 */*) $(MKDIR_P) `echo "$$dist_files" | \
723 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
724 sort -u` ;; \
725 esac; \
726 for file in $$dist_files; do \
727 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
728 if test -d $$d/$$file; then \
729 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
730 if test -d "$(distdir)/$$file"; then \
731 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
732 fi; \
733 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
734 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
735 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
736 fi; \
737 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
738 else \
739 test -f "$(distdir)/$$file" \
740 || cp -p $$d/$$file "$(distdir)/$$file" \
741 || exit 1; \
742 fi; \
743 done
744check-am: all-am
745check: check-am
746all-am: Makefile $(LTLIBRARIES) $(HEADERS)
747installdirs:
748 for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includesdir)"; do \
749 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
750 done
751install: install-am
752install-exec: install-exec-am
753install-data: install-data-am
754uninstall: uninstall-am
755
756install-am: all-am
757 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
758
759installcheck: installcheck-am
760install-strip:
761 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
762 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
763 `test -z '$(STRIP)' || \
764 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
765mostlyclean-generic:
766
767clean-generic:
768 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
769
770distclean-generic:
771 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
772 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
773
774maintainer-clean-generic:
775 @echo "This command is intended for maintainers to use"
776 @echo "it deletes files that may require special tools to rebuild."
777 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
778clean: clean-am
779
780clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
781 mostlyclean-am
782
783distclean: distclean-am
784 -rm -rf ./$(DEPDIR)
785 -rm -f Makefile
786distclean-am: clean-am distclean-compile distclean-generic \
787 distclean-tags
788
789dvi: dvi-am
790
791dvi-am:
792
793html: html-am
794
795html-am:
796
797info: info-am
798
799info-am:
800
801install-data-am: install-includesHEADERS
802
803install-dvi: install-dvi-am
804
805install-dvi-am:
806
807install-exec-am: install-libLTLIBRARIES
808
809install-html: install-html-am
810
811install-html-am:
812
813install-info: install-info-am
814
815install-info-am:
816
817install-man:
818
819install-pdf: install-pdf-am
820
821install-pdf-am:
822
823install-ps: install-ps-am
824
825install-ps-am:
826
827installcheck-am:
828
829maintainer-clean: maintainer-clean-am
830 -rm -rf ./$(DEPDIR)
831 -rm -f Makefile
832maintainer-clean-am: distclean-am maintainer-clean-generic
833
834mostlyclean: mostlyclean-am
835
836mostlyclean-am: mostlyclean-compile mostlyclean-generic \
837 mostlyclean-libtool
838
839pdf: pdf-am
840
841pdf-am:
842
843ps: ps-am
844
845ps-am:
846
847uninstall-am: uninstall-includesHEADERS uninstall-libLTLIBRARIES
848
849.MAKE: install-am install-strip
850
851.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
852 clean-libLTLIBRARIES clean-libtool ctags distclean \
853 distclean-compile distclean-generic distclean-libtool \
854 distclean-tags distdir dvi dvi-am html html-am info info-am \
855 install install-am install-data install-data-am install-dvi \
856 install-dvi-am install-exec install-exec-am install-html \
857 install-html-am install-includesHEADERS install-info \
858 install-info-am install-libLTLIBRARIES install-man install-pdf \
859 install-pdf-am install-ps install-ps-am install-strip \
860 installcheck installcheck-am installdirs maintainer-clean \
861 maintainer-clean-generic mostlyclean mostlyclean-compile \
862 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
863 tags uninstall uninstall-am uninstall-includesHEADERS \
864 uninstall-libLTLIBRARIES
865
866
867# Tell versions [3.59,3.63) of GNU make to not export all variables.
868# Otherwise a system limit (for SysV at least) may be exceeded.
869.NOEXPORT:
diff --git a/libraries/ecore/src/lib/ecore_config/ecore_config.c b/libraries/ecore/src/lib/ecore_config/ecore_config.c
deleted file mode 100644
index e81538e..0000000
--- a/libraries/ecore/src/lib/ecore_config/ecore_config.c
+++ /dev/null
@@ -1,1870 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <string.h>
6#include <ctype.h>
7#include <stdio.h>
8#include <stdlib.h>
9
10#include <sys/param.h>
11#include <sys/types.h>
12#include <sys/stat.h>
13#include <fcntl.h>
14#include <limits.h>
15#include <unistd.h>
16
17#include "Ecore_Config.h"
18#include "ecore_config_private.h"
19#include "ecore_config_ipc.h"
20
21#include "ecore_config_util.h"
22int _ecore_config_log_dom = -1;
23int DEBUG = 0;
24EAPI Ecore_Config_Server *__ecore_config_server_global = NULL;
25EAPI Ecore_Config_Server *__ecore_config_server_local = NULL;
26EAPI Ecore_Config_Bundle *__ecore_config_bundle_local = NULL;
27EAPI char *__ecore_config_app_name = NULL;
28int __ecore_config_system_init = 0;
29
30static int _ecore_config_system_init_no_load(void);
31static int _ecore_config_system_load(void);
32
33static inline void *__ecore_argb_to_long(int a, int r, int g, int b, long *v);
34static inline void *__ecore_argbstr_to_long(const char *argb, long *v);
35
36static const char *_ecore_config_type[] =
37 { "undefined", "integer", "float", "string", "colour", "theme", "boolean", "structure" };
38
39/**
40 * @defgroup Ecore_Config_Property_Group Ecore Config Property Functions
41 *
42 * Functions that retrieve or set the attributes relating to a property.
43 */
44
45/**
46 * Removes the given property from the local configuration and destroys it.
47 * @param e Property to destroy.
48 * @return @c NULL
49 * @ingroup Ecore_Config_Property_Group
50 */
51EAPI Ecore_Config_Prop *
52ecore_config_dst(Ecore_Config_Prop * e)
53{
54 Ecore_Config_Bundle *t;
55 Ecore_Config_Prop *p, *c;
56 Ecore_Config_Listener_List *l;
57
58 p = NULL;
59 t = __ecore_config_bundle_local;
60 c = t->data;
61
62 if (!e || !e->key)
63 return NULL;
64 if (t)
65 {
66 if (t->data == e)
67 t->data = e->next;
68 else
69 {
70 do
71 {
72 p = c;
73 c = c->next;
74 }
75 while (c && (c != e));
76 if (c) /* remove from list if even in there */
77 p->next = c->next;
78 }
79 }
80
81 while (e->listeners)
82 {
83 l = e->listeners;
84 e->listeners = e->listeners->next;
85 free(l);
86 }
87
88 if (e->key)
89 free(e->key);
90 if (e->ptr && ((e->type == ECORE_CONFIG_STR) || (e->type == ECORE_CONFIG_THM)))
91 free(e->ptr);
92
93 memset(e, 0, sizeof(Ecore_Config_Prop));
94 free(e);
95
96 return NULL;
97}
98
99/**
100 * @defgroup Ecore_Config_Get_Group Configuration Retrieve Functions
101 *
102 * Functions that retrieve configuration values, based on type.
103 */
104
105/**
106 * Returns the property with the given key.
107 * @param key The unique name of the wanted property.
108 * @return The property that corresponds to the given key. @c NULL if the
109 * key could not be found.
110 * @ingroup Ecore_Config_Get_Group
111 */
112EAPI Ecore_Config_Prop *
113ecore_config_get(const char *key)
114{
115 Ecore_Config_Bundle *t;
116 Ecore_Config_Prop *e;
117
118 t = __ecore_config_bundle_local;
119 if (!t || !key)
120 return NULL;
121 e = t->data;
122 while (e)
123 {
124 if (!strcmp(key, e->key))
125 return e;
126 e = e->next;
127 }
128 return NULL;
129}
130
131/**
132 * Returns the type of the property.
133 * @param e Property to get the type of.
134 * @returns The type of the property. If the property is invalid, then the
135 * string "not found" is returned.
136 * @ingroup Ecore_Config_Property_Group
137 */
138EAPI const char *
139ecore_config_type_get(const Ecore_Config_Prop * e)
140{
141 if (e)
142 {
143 return _ecore_config_type[e->type];
144 }
145 return "not found";
146}
147
148/**
149 * Returns the specified property as a string.
150 * @param key The property key.
151 * @return The string value of the property. The function returns @c NULL if
152 * the property is not a string or is not set.
153 * @ingroup Ecore_Config_Get_Group
154 */
155EAPI char *
156ecore_config_string_get(const char *key)
157{
158 return _ecore_config_string_get( ecore_config_get(key) );
159}
160
161char *
162_ecore_config_string_get(Ecore_Config_Prop *e)
163{
164 return (e && (e->type == ECORE_CONFIG_STR) && e->ptr) ? strdup(e->ptr) : NULL;
165}
166
167/**
168 * Returns the specified property as an integer.
169 * @param key The property key.
170 * @return The value of the property. The function returns -1 if the
171 * property is not an integer or is not set.
172 * @ingroup Ecore_Config_Get_Group
173 */
174EAPI int
175ecore_config_boolean_get(const char *key)
176{
177 return _ecore_config_boolean_get( ecore_config_get(key) );
178}
179
180int
181_ecore_config_boolean_get(Ecore_Config_Prop *e)
182{
183 return (e && ((e->type == ECORE_CONFIG_INT) || (e->type == ECORE_CONFIG_BLN))) ? (e->val != 0) : -1;
184}
185
186/**
187 * Returns the specified property as a long integer.
188 * @param key The property key.
189 * @return The integer value of the property. The function returns 0 if the
190 * property is not an integer or is not set.
191 * @ingroup Ecore_Config_Get_Group
192 */
193EAPI long
194ecore_config_int_get(const char *key)
195{
196 return _ecore_config_int_get( ecore_config_get(key) );
197}
198
199long
200_ecore_config_int_get(Ecore_Config_Prop *e)
201{
202 return (e && ((e->type == ECORE_CONFIG_INT) || (e->type == ECORE_CONFIG_RGB))) ? e->val : 0L;
203}
204
205/**
206 * Returns the specified property as a float.
207 * @param key The property key.
208 * @return The float value of the property. The function returns 0.0 if the
209 * property is not a float or is not set.
210 * @ingroup Ecore_Config_Get_Group
211 */
212EAPI float
213ecore_config_float_get(const char *key)
214{
215 return _ecore_config_float_get( ecore_config_get(key) );
216}
217
218float
219_ecore_config_float_get(Ecore_Config_Prop *e)
220{
221 return (e && (e->type == ECORE_CONFIG_FLT)) ? ((float)e->val / ECORE_CONFIG_FLOAT_PRECISION) : 0.0;
222}
223
224/**
225 * Finds the alpha, red, green and blue values of a color property.
226 * @param key The property key.
227 * @param a A pointer to an integer to store the alpha value into.
228 * @param r A pointer to an integer to store the red value into.
229 * @param g A pointer to an integer to store the green value into.
230 * @param b A pointer to an integer to store the blue value into.
231 * @return @c ECORE_CONFIG_ERR_SUCC on success. @c ECORE_CONFIG_ERR_FAIL
232 * otherwise.
233 * @ingroup Ecore_Config_Get_Group
234 */
235EAPI int
236ecore_config_argb_get(const char *key, int *a, int *r, int *g, int *b)
237{
238 return _ecore_config_argb_get( ecore_config_get(key), a, r, g, b);
239}
240
241int
242_ecore_config_argb_get(Ecore_Config_Prop *e, int *a, int *r, int *g, int *b)
243{
244 if (e && ((e->type == ECORE_CONFIG_RGB)))
245 {
246 if(a) *a = (e->val >> 24) & 0xff;
247 if(r) *r = (e->val >> 16) & 0xff;
248 if(g) *g = (e->val >> 8) & 0xff;
249 if(b) *b = e->val & 0xff;
250 return ECORE_CONFIG_ERR_SUCC;
251 }
252 return ECORE_CONFIG_ERR_FAIL;
253}
254
255/**
256 * Returns a color property as a long
257 * @param key The property key.
258 * @return ARGB data as long
259 * @ingroup Ecore_Config_Get_Group
260 */
261EAPI long
262ecore_config_argbint_get(const char *key)
263{
264 return _ecore_config_argbint_get( ecore_config_get(key) );
265}
266
267long
268_ecore_config_argbint_get(Ecore_Config_Prop *e)
269{
270 if (e && ((e->type == ECORE_CONFIG_RGB)))
271 {
272 return e->val;
273 }
274 return 0L;
275}
276
277/**
278 * Returns a color property as a string of hexadecimal characters.
279 * @param key The property key.
280 * @return A string of hexadecimal characters in the format #aarrggbb.
281 * @ingroup Ecore_Config_Get_Group
282 */
283EAPI char *
284ecore_config_argbstr_get(const char *key)
285{
286 return _ecore_config_argbstr_get( ecore_config_get(key) );
287}
288
289char *
290_ecore_config_argbstr_get(Ecore_Config_Prop *e)
291{
292 char *r;
293
294 r = NULL;
295 esprintf(&r, "#%08x", _ecore_config_int_get(e));
296 return r;
297}
298
299/**
300 * Returns a theme property.
301 * @param key The property key.
302 * @return The name of the theme the property refers to. The function returns
303 * @c NULL if the property is not a theme or is not set.
304 * @ingroup Ecore_Config_Get_Group
305 */
306EAPI char *
307ecore_config_theme_get(const char *key)
308{
309 return _ecore_config_theme_get( ecore_config_get(key) );
310}
311
312char *
313_ecore_config_theme_get(Ecore_Config_Prop *e)
314{
315 return (e && (e->type == ECORE_CONFIG_THM)) ? strdup(e->ptr) : NULL;
316}
317
318/**
319 * Retrieves the key as a string.
320 * @param key The property key.
321 * @return Returns a character array in the form of 'key:type=value'. @c NULL
322 * is returned if the property does not exist.
323 * @ingroup Ecore_Config_Get_Group
324 */
325EAPI char *
326ecore_config_as_string_get(const char *key)
327{
328 Ecore_Config_Prop *e;
329 char *val;
330 char *r;
331
332 val = NULL;
333 r = NULL;
334 if (!(e = ecore_config_get(key)))
335 ERR("no such property, \"%s\"...", key);
336 else
337 {
338 switch (e->type)
339 {
340 case ECORE_CONFIG_NIL:
341 val = strdup("<nil>");
342 break;
343 case ECORE_CONFIG_INT:
344 esprintf(&val, "%ld", _ecore_config_int_get(e));
345 break;
346 case ECORE_CONFIG_BLN:
347 esprintf(&val, "%ld", _ecore_config_boolean_get(e));
348 break;
349 case ECORE_CONFIG_FLT:
350 esprintf(&val, "%lf", _ecore_config_float_get(e));
351 break;
352 case ECORE_CONFIG_STR:
353 esprintf(&val, "\"%s\"", _ecore_config_string_get(e));
354 break;
355 case ECORE_CONFIG_RGB:
356 esprintf(&val, "#%08x", _ecore_config_int_get(e));
357 break;
358 case ECORE_CONFIG_THM:
359 esprintf(&val, "\"%s\"", _ecore_config_theme_get(e));
360 break;
361 case ECORE_CONFIG_SCT:
362 break;
363 default:
364 esprintf(&r, "%s:unknown_type", key);
365 break;
366 }
367 if (val)
368 {
369 esprintf(&r, "%s:%s=%s", key, _ecore_config_type[e->type], val);
370 free(val);
371 }
372 }
373 return r;
374}
375
376EAPI int
377ecore_config_bound(Ecore_Config_Prop * e)
378{
379 int ret;
380 long v;
381
382 ret = ECORE_CONFIG_ERR_SUCC;
383
384 if (!e)
385 return ECORE_CONFIG_ERR_FAIL;
386 if (e->flags & ECORE_CONFIG_FLAG_BOUNDS)
387 {
388 if ((e->val < e->lo))
389 {
390 WRN("ecore_config_bounds(\"%s\",%ld): value out of range; adjusted to %ld...",
391 e->key, e->val, e->lo);
392 e->val = e->lo;
393 }
394 else if ((e->val > e->hi))
395 {
396 WRN("ecore_config_bounds(\"%s\",%ld): value out of range; adjusted to %ld...",
397 e->key, e->val, e->hi);
398 e->val = e->hi;
399 }
400 else
401 ret = ECORE_CONFIG_ERR_IGNORED;
402 }
403 else
404 ret = ECORE_CONFIG_ERR_IGNORED;
405
406 if (e->step)
407 {
408 v = ((int)(e->val / e->step)) * e->step;
409 if (v != e->val)
410 {
411 if (e->type == ECORE_CONFIG_FLT)
412 WRN("ecore_config_bound(\"%s\"): float value %f not a multiple of %f, adjusted to %f...",
413 e->key, ((double)e->val) / ECORE_CONFIG_FLOAT_PRECISION,
414 ((double)e->step) / ECORE_CONFIG_FLOAT_PRECISION,
415 ((double)v) / ECORE_CONFIG_FLOAT_PRECISION);
416 else
417 WRN("ecore_config_bound(\"%s\"): integer value %ld not a multiple of %ld, adjusted to %ld...",
418 e->key, e->val, e->step, v);
419 ret = ECORE_CONFIG_ERR_SUCC;
420 e->val = v;
421 }
422 }
423
424 return ret;
425}
426
427/**
428 * Tries to guess the type of a property.
429 *
430 * This function first checks to see if the property exists. If it does, then
431 * the type of the stored property is returned. Otherwise, the function tries
432 * to guess the type of the property based on @p val.
433 *
434 * @param key The property key.
435 * @param val The value in string form.
436 * @return The type of the property determined by the function. Note that if
437 * val is @c NULL, @c ECORE_CONFIG_NIL will be returned.
438 */
439EAPI int
440ecore_config_type_guess(const char *key, const char *val)
441{
442 Ecore_Config_Prop *p;
443 char *l;
444
445 l = NULL;
446
447 if (key && (p = ecore_config_get(key)) && p->type != ECORE_CONFIG_NIL)
448 return p->type;
449
450 if (!val)
451 return ECORE_CONFIG_NIL;
452 if (val[0] == '#')
453 return ECORE_CONFIG_RGB;
454 strtol(val, &l, 10);
455 if (*l)
456 {
457 float f;
458
459 if (sscanf(val, "%f%*s", &f) != 1)
460 return ECORE_CONFIG_STR;
461 return ECORE_CONFIG_FLT;
462 }
463 return ECORE_CONFIG_INT;
464}
465
466static int
467ecore_config_typed_val(Ecore_Config_Prop * e, const void *val, int type)
468{
469
470 if (!e)
471 return ECORE_CONFIG_ERR_NODATA;
472
473 if (!(val) && (type != ECORE_CONFIG_NIL && type != ECORE_CONFIG_SCT))
474 e->ptr = NULL;
475 else
476 {
477 if (type == ECORE_CONFIG_INT || type == ECORE_CONFIG_BLN)
478 {
479 e->val = (long) *((int *)val);
480 e->type = type;
481 }
482 else if (type == ECORE_CONFIG_STR || type == ECORE_CONFIG_THM)
483 {
484 if (!(e->ptr = strdup(val)))
485 return ECORE_CONFIG_ERR_OOM;
486 if (e->type == ECORE_CONFIG_NIL)
487 e->type = type;
488 }
489 else if (type == ECORE_CONFIG_RGB)
490 {
491 __ecore_argbstr_to_long((char *)val, &e->val);
492 e->type = ECORE_CONFIG_RGB;
493 }
494 else if (type == ECORE_CONFIG_FLT)
495 {
496 e->val = (long) ((*((float *)val)) * ECORE_CONFIG_FLOAT_PRECISION);
497 e->type = ECORE_CONFIG_FLT;
498 }
499 else if (type == ECORE_CONFIG_SCT)
500 {
501 e->type = ECORE_CONFIG_SCT;
502 }
503 else
504 {
505 e->type = ECORE_CONFIG_NIL;
506 }
507
508 ecore_config_bound(e);
509 e->flags |= ECORE_CONFIG_FLAG_MODIFIED;
510 e->flags &= ~ECORE_CONFIG_FLAG_CMDLN;
511 return ECORE_CONFIG_ERR_SUCC;
512 }
513 return ECORE_CONFIG_ERR_IGNORED;
514}
515
516static int
517ecore_config_typed_add(const char *key, const void *val, int type)
518{
519 int error = ECORE_CONFIG_ERR_SUCC;
520 Ecore_Config_Prop *e = NULL;
521 Ecore_Config_Bundle *t;
522
523 t = __ecore_config_bundle_local;
524 if (!key)
525 return ECORE_CONFIG_ERR_NODATA;
526
527 if (!(e = calloc(1, sizeof(Ecore_Config_Prop))))
528 {
529 return ECORE_CONFIG_ERR_OOM;
530 }
531 else if (!(e->key = strdup(key)))
532 {
533 error = ECORE_CONFIG_ERR_OOM;
534 }
535 else if ((error = ecore_config_typed_val(e, val, type)) == ECORE_CONFIG_ERR_SUCC)
536 {
537 if (t)
538 {
539 e->next = t->data;
540 t->data = e;
541 }
542 return ECORE_CONFIG_ERR_SUCC;
543 }
544
545 if(e->key)
546 free(e->key);
547 if(e)
548 free(e);
549
550 if (error == ECORE_CONFIG_ERR_SUCC)
551 error = ECORE_CONFIG_ERR_FAIL;
552
553 return error;
554}
555
556static int
557ecore_config_add(const char *key, const char *val)
558{
559 int type;
560
561 type = ecore_config_type_guess(key, val);
562 return ecore_config_typed_add(key, val, type);
563}
564
565/**
566 * Sets the description field of the indicated property.
567 * @param key The property key.
568 * @param desc Description string.
569 * @note The description string is copied for the property's use. You can
570 * free @p desc once this function is called.
571 * @ingroup Ecore_Config_Property_Group
572 */
573EAPI int
574ecore_config_describe(const char *key, const char *desc)
575{
576 Ecore_Config_Prop *e;
577
578 if (!(e = ecore_config_get(key)))
579 return ECORE_CONFIG_ERR_NODATA;
580 e->description = strdup(desc);
581 return ECORE_CONFIG_ERR_SUCC;
582}
583
584/**
585 * Set the short option character of a property.
586 * @param key The property key.
587 * @param short_opt Character used to indicate the value of a property
588 * given on the command line.
589 * @return @c ECORE_CONFIG_ERR_SUCC on success. @c ECORE_CONFIG_ERR_NODATA
590 * is returned if the property does not exist.
591 * @ingroup Ecore_Config_Property_Group
592 */
593EAPI int
594ecore_config_short_opt_set(const char *key, char short_opt)
595{
596 Ecore_Config_Prop *e;
597
598 if (!(e = ecore_config_get(key)))
599 return ECORE_CONFIG_ERR_NODATA;
600 e->short_opt = short_opt;
601 return ECORE_CONFIG_ERR_SUCC;
602}
603
604/**
605 * Set the long option string of the property.
606 * @param key The property key.
607 * @param long_opt String used to indicate the value of a property given
608 * on the command line.
609 * @return @c ECORE_CONFIG_ERR_SUCC on success. @c ECORE_CONFIG_ERR_NODATA
610 * is returned if the property does not exist.
611 * @ingroup Ecore_Config_Property_Group
612 */
613EAPI int
614ecore_config_long_opt_set(const char *key, const char *long_opt)
615{
616 Ecore_Config_Prop *e;
617
618 if (!(e = ecore_config_get(key)))
619 return ECORE_CONFIG_ERR_NODATA;
620 if (e->long_opt)
621 free(e->long_opt);
622 if (long_opt)
623 e->long_opt = strdup(long_opt);
624 return ECORE_CONFIG_ERR_SUCC;
625}
626
627static void
628_ecore_config_listener_fire(Ecore_Config_Prop *prop)
629{
630 Ecore_Config_Listener_List *l;
631 for (l = prop->listeners; l; l = l->next)
632 l->listener(prop->key, prop->type, l->tag, l->data);
633
634 /* fire change listeners for the generic struct container etc */
635 if (prop->parent)
636 _ecore_config_listener_fire(prop->parent);
637}
638
639/**
640 * Sets the indicated property to the given value and type.
641 * @param key The property key.
642 * @param val A pointer to the value to set the property to.
643 * @param type The type of the property.
644 * @return @c ECORE_CONFIG_ERR_SUCC if the property is set successfully.
645 * @ingroup Ecore_Config_Property_Group
646 */
647EAPI int
648ecore_config_typed_set(const char *key, const void *val, int type)
649{
650 Ecore_Config_Prop *e;
651 int ret;
652
653 if (!key)
654 return ECORE_CONFIG_ERR_NODATA;
655/* if (!t) { * global prop *
656 e=ecore_config_get(key);
657 if (e)
658 for(l=e->listeners;l;l=l->next)
659 l->listener(e->key,e->type,l->tag,l->data,t);
660 return ECORE_CONFIG_ERR_SUCC;
661 }
662*/
663 if (!(e = ecore_config_get(key)))
664 return ecore_config_typed_add(key, val, type);
665
666 if ((ret = ecore_config_typed_val(e, val, type)) == ECORE_CONFIG_ERR_SUCC)
667 {
668 _ecore_config_listener_fire(e);
669 }
670 else
671 {
672 ERR("ecore_config_typed_set(\"%s\"): ecore_config_typed_val() failed: %d",
673 key, ret);
674 }
675
676 return ret;
677}
678
679/**
680 * @defgroup Ecore_Config_Set_Group Ecore Config Setters
681 *
682 * Functions that set the value of a property.
683 */
684
685/**
686 * Sets the indicated property to the value indicated by @a val.
687 * @param key The property key.
688 * @param val String representation of value to set.
689 * @return @c ECORE_CONFIG_ERR_SUCC if the property is set successfully.
690 * @ingroup Ecore_Config_Set_Group
691 */
692EAPI int
693ecore_config_set(const char *key, const char *val)
694{
695 int type;
696 int tmpi;
697 float tmpf;
698 long tmpl;
699
700 type = ecore_config_type_guess(key, val);
701 if (type == ECORE_CONFIG_INT || type == ECORE_CONFIG_BLN)
702 {
703 tmpi = atoi(val);
704 return ecore_config_typed_set(key, &tmpi, type);
705 }
706 else if (type == ECORE_CONFIG_FLT)
707 {
708 tmpf = atof(val);
709 return ecore_config_typed_set(key, &tmpf, type);
710 }
711 else if (type == ECORE_CONFIG_RGB)
712 {
713 __ecore_argbstr_to_long(val, &tmpl);
714 return ecore_config_typed_set(key, &tmpl, type);
715 }
716 else
717 return ecore_config_typed_set(key, val, type);
718}
719
720/**
721 * Sets the indicated property to the value given in the string.
722 * @param key The property key.
723 * @param val String representation of the value.
724 * @return @c ECORE_CONFIG_ERR_SUCC if the property is set successfully.
725 * @ingroup Ecore_Config_Set_Group
726 */
727EAPI int
728ecore_config_as_string_set(const char *key, const char *val)
729{
730 return ecore_config_set(key, val);
731}
732
733/**
734 * Sets the indicated property to the given boolean.
735 * @param key The property key.
736 * @param val Boolean integer to set the property to.
737 * @return @c ECORE_CONFIG_ERR_SUCC if the property is set successfully.
738 * @ingroup Ecore_Config_Set_Group
739 */
740EAPI int
741ecore_config_boolean_set(const char *key, int val)
742{
743 val = val ? 1 : 0;
744 return ecore_config_typed_set(key, &val, ECORE_CONFIG_BLN);
745}
746
747/**
748 * Sets the indicated property to the given integer.
749 * @param key The property key.
750 * @param val Integer to set the property to.
751 * @return @c ECORE_CONFIG_ERR_SUCC if the property is set successfully.
752 * @ingroup Ecore_Config_Set_Group
753 */
754EAPI int
755ecore_config_int_set(const char *key, int val)
756{
757 return ecore_config_typed_set(key, &val, ECORE_CONFIG_INT);
758}
759
760/**
761 * Sets the indicated property to the given string.
762 * @param key The property key.
763 * @param val String to set the property to.
764 * @return @c ECORE_CONFIG_ERR_SUCC if the property is set successfully.
765 * @ingroup Ecore_Config_Set_Group
766 */
767EAPI int
768ecore_config_string_set(const char *key, const char *val)
769{
770 return ecore_config_typed_set(key, val, ECORE_CONFIG_STR);
771}
772
773/**
774 * Sets the indicated property to the given float value.
775 * @param key The property key.
776 * @param val Float to set the property to.
777 * @return @c ECORE_CONFIG_ERR_SUCC if the property is set successfully.
778 * @ingroup Ecore_Config_Set_Group
779 */
780EAPI int
781ecore_config_float_set(const char *key, float val)
782{
783 return ecore_config_typed_set(key, &val, ECORE_CONFIG_FLT);
784}
785
786/**
787 * Sets the indicated property to a color value.
788 * @param key The property key
789 * @param a integer 0..255
790 * @param r integer 0..255
791 * @param g integer 0..255
792 * @param b integer 0..255
793 * @return @c ECORE_CONFIG_ERR_SUCC if the property is set successfully.
794 * @ingroup Ecore_Config_Set_Group
795 */
796EAPI int
797ecore_config_argb_set(const char *key, int a, int r, int g, int b)
798{
799 long v = 0;
800 return ecore_config_typed_set(key, __ecore_argb_to_long(a,r,g,b, &v), ECORE_CONFIG_RGB);
801}
802
803/**
804 * Sets the indicated property to a color value.
805 * @param key The property key
806 * @param argb ARGB data as long
807 * @return @c ECORE_CONFIG_ERR_SUCC if the property is set successfully.
808 * @ingroup Ecore_Config_Set_Group
809 */
810EAPI int
811ecore_config_argbint_set(const char *key, long argb)
812{
813 return ecore_config_typed_set(key, &argb, ECORE_CONFIG_RGB);
814}
815
816/**
817 * Sets the indicated property to a color value.
818 * @param key The property key
819 * @param val Color value in ARGB format.
820 * @return @c ECORE_CONFIG_ERR_SUCC if the property is set successfully.
821 * @ingroup Ecore_Config_Set_Group
822 */
823EAPI int
824ecore_config_argbstr_set(const char *key, const char *val)
825{
826 long v = 0;
827 return ecore_config_typed_set(key, __ecore_argbstr_to_long(val, &v), ECORE_CONFIG_RGB);
828}
829
830/**
831 * Sets the indicated property to a theme name.
832 * @param key The property key.
833 * @param val String giving the name of the theme.
834 * @return @c ECORE_CONFIG_ERR_SUCC if the property is set successfully.
835 * @ingroup Ecore_Config_Set_Group
836 */
837EAPI int
838ecore_config_theme_set(const char *key, const char *val)
839{
840 return ecore_config_typed_set(key, val, ECORE_CONFIG_THM);
841}
842
843/**
844 * Sets the theme preview group of an indicated property.
845 * @param key The property key.
846 * @param group The group name.
847 * @return @c ECORE_CONFIG_ERR_SUCC on success.
848 * @ingroup Ecore_Config_Set_Group
849 */
850EAPI int
851ecore_config_theme_preview_group_set(const char *key, const char *group)
852{
853 int ret;
854 Ecore_Config_Prop *e;
855
856 ret = ECORE_CONFIG_ERR_SUCC;
857 if (!(e = ecore_config_get(key)))
858 { /* prop doesn't exist yet */
859 if ((ret = ecore_config_typed_add(key, "", ECORE_CONFIG_THM)) != ECORE_CONFIG_ERR_SUCC) /* try to add it */
860 return ret; /* ...failed */
861 if (!(e = ecore_config_get(key))) /* get handle */
862 return ECORE_CONFIG_ERR_FAIL;
863 }
864 if (e->data)
865 free(e->data);
866 e->data = strdup(group);
867
868 return ret;
869}
870
871EAPI int
872ecore_config_typed_default(const char *key, const void *val, int type)
873{
874 int ret;
875 Ecore_Config_Prop *e;
876
877 ret = ECORE_CONFIG_ERR_SUCC;
878
879 if (!(e = ecore_config_get(key)))
880 { /* prop doesn't exist yet */
881 if ((ret = ecore_config_typed_add(key, val, type)) != ECORE_CONFIG_ERR_SUCC) /* try to add it */
882 return ret; /* ...failed */
883 if (!(e = ecore_config_get(key))) /* get handle */
884 return ECORE_CONFIG_ERR_FAIL;
885 e->flags = e->flags & ~ECORE_CONFIG_FLAG_MODIFIED;
886 }
887 else if (!(e->flags & ECORE_CONFIG_FLAG_MODIFIED) && !(e->flags & ECORE_CONFIG_FLAG_SYSTEM))
888 {
889 ecore_config_typed_set(key, val, type);
890 if (!(e = ecore_config_get(key))) /* get handle */
891 return ECORE_CONFIG_ERR_FAIL;
892 e->flags = e->flags & ~ECORE_CONFIG_FLAG_MODIFIED;
893 }
894 return ret;
895}
896
897/**
898 * @defgroup Ecore_Config_Default_Group Ecore Config Defaults
899 *
900 * Functions that are used to set the default values of properties.
901 */
902
903/**
904 * Sets the indicated property if it has not already been set or loaded.
905 * @param key The property key.
906 * @param val Default value of the key.
907 * @param lo Lowest valid value for the key.
908 * @param hi Highest valid value for the key.
909 * @param step Used by integer and float values.
910 * @return @c ECORE_CONFIG_ERR_SUCC if there are no errors.
911 * @note The @p lo, @p hi and @p step parameters are only used when storing
912 * integer and float properties.
913 * @ingroup Ecore_Config_Default_Group
914 */
915EAPI int
916ecore_config_default(const char *key, const char *val, float lo, float hi, float step)
917{
918 int ret, type;
919 Ecore_Config_Prop *e;
920
921 type = ecore_config_type_guess(key, val);
922 ret = ecore_config_typed_default(key, val, type);
923 e = ecore_config_get(key);
924 if (e)
925 {
926 if (type == ECORE_CONFIG_INT)
927 {
928 e->step = step;
929 e->flags |= ECORE_CONFIG_FLAG_BOUNDS;
930 e->lo = lo;
931 e->hi = hi;
932 ecore_config_bound(e);
933 }
934 else if (type == ECORE_CONFIG_FLT)
935 {
936 e->step = (int)(step * ECORE_CONFIG_FLOAT_PRECISION);
937 e->flags |= ECORE_CONFIG_FLAG_BOUNDS;
938 e->lo = (int)(lo * ECORE_CONFIG_FLOAT_PRECISION);
939 e->hi = (int)(hi * ECORE_CONFIG_FLOAT_PRECISION);
940 ecore_config_bound(e);
941 }
942 }
943
944 return ret;
945}
946
947/**
948 * Sets the indicated property to the given boolean if the property has not yet
949 * been set.
950 * @param key The property key.
951 * @param val Boolean Integer to set the value to.
952 * @return @c ECORE_CONFIG_ERR_SUCC if there are no problems.
953 * @ingroup Ecore_Config_Default_Group
954 */
955EAPI int
956ecore_config_boolean_default(const char *key, int val)
957{
958 val = val ? 1 : 0;
959 return ecore_config_typed_default(key, &val, ECORE_CONFIG_BLN);
960}
961
962/**
963 * Sets the indicated property to the given integer if the property has not yet
964 * been set.
965 * @param key The property key.
966 * @param val Integer to set the value to.
967 * @return @c ECORE_CONFIG_ERR_SUCC if there are no problems.
968 * @ingroup Ecore_Config_Default_Group
969 */
970EAPI int
971ecore_config_int_default(const char *key, int val)
972{
973 return ecore_config_typed_default(key, &val, ECORE_CONFIG_INT);
974}
975
976/**
977 * Sets the indicated property to the given integer if the property has not yet
978 * been set.
979 *
980 * The bounds and step values are set regardless.
981 *
982 * @param key The property key.
983 * @param val Integer to set the property to.
984 * @param low Lowest valid integer value for the property.
985 * @param high Highest valid integer value for the property.
986 * @param step Increment value for the property.
987 * @return @c ECORE_CONFIG_ERR_SUCC if there were no problems.
988 * @ingroup Ecore_Config_Default_Group
989 */
990EAPI int
991ecore_config_int_default_bound(const char *key, int val, int low, int high,
992 int step)
993{
994 Ecore_Config_Prop *e;
995 int ret;
996
997 ret = ecore_config_typed_default(key, &val, ECORE_CONFIG_INT);
998 e = ecore_config_get(key);
999 if (e)
1000 {
1001 e->step = step;
1002 e->flags |= ECORE_CONFIG_FLAG_BOUNDS;
1003 e->lo = low;
1004 e->hi = high;
1005 ecore_config_bound(e);
1006 }
1007
1008 return ret;
1009}
1010
1011/**
1012 * Sets the indicated property to the given string if the property has not yet
1013 * been set.
1014 * @param key The property key.
1015 * @param val String to set the property to.
1016 * @return @c ECORE_CONFIG_ERR_SUCC if there were no problems.
1017 * @ingroup Ecore_Config_Default_Group
1018 */
1019EAPI int
1020ecore_config_string_default(const char *key, const char *val)
1021{
1022 return ecore_config_typed_default(key, val, ECORE_CONFIG_STR);
1023}
1024
1025/**
1026 * Sets the indicated property to the given float if the property has not yet
1027 * been set.
1028 * @param key The property key.
1029 * @param val Float to set the property to.
1030 * @return @c ECORE_CONFIG_ERR_SUCC if there were no problems.
1031 * @ingroup Ecore_Config_Default_Group
1032 */
1033EAPI int
1034ecore_config_float_default(const char *key, float val)
1035{
1036 return ecore_config_typed_default(key, &val, ECORE_CONFIG_FLT);
1037}
1038
1039/**
1040 * Sets the indicated property to the given float if the property has not yet
1041 * been set.
1042 *
1043 * The bounds and step values are set regardless.
1044 *
1045 * @param key The property key.
1046 * @param val Float to set the property to.
1047 * @param low Lowest valid integer value for the property.
1048 * @param high Highest valid float value for the property.
1049 * @param step Increment value for the property.
1050 * @return @c ECORE_CONFIG_ERR_SUCC if there were no problems.
1051 * @ingroup Ecore_Config_Default_Group
1052 */
1053EAPI int
1054ecore_config_float_default_bound(const char *key, float val, float low,
1055 float high, float step)
1056{
1057 Ecore_Config_Prop *e;
1058 int ret;
1059
1060 ret = ecore_config_typed_default(key, &val, ECORE_CONFIG_FLT);
1061 e = ecore_config_get(key);
1062 if (e)
1063 {
1064 e->step = (int)(step * ECORE_CONFIG_FLOAT_PRECISION);
1065 e->flags |= ECORE_CONFIG_FLAG_BOUNDS;
1066 e->lo = (int)(low * ECORE_CONFIG_FLOAT_PRECISION);
1067 e->hi = (int)(high * ECORE_CONFIG_FLOAT_PRECISION);
1068 ecore_config_bound(e);
1069 }
1070
1071 return ret;
1072}
1073
1074/**
1075 * Sets the indicated property to a color value if the property has not yet
1076 * been set.
1077 * @param key The property key.
1078 * @param a integer 0..255
1079 * @param r integer 0..255
1080 * @param g integer 0..255
1081 * @param b integer 0..255
1082 * @return @c ECORE_CONFIG_ERR_SUCC if there are no problems.
1083 * @ingroup Ecore_Config_Default_Group
1084 */
1085EAPI int
1086ecore_config_argb_default(const char *key, int a, int r, int g, int b)
1087{
1088 long v = 0;
1089 return ecore_config_typed_default(key, __ecore_argb_to_long(a,r,g,b, &v), ECORE_CONFIG_RGB);
1090}
1091
1092/**
1093 * Sets the indicated property to a color value if the property has not yet
1094 * been set.
1095 * @param key The property key.
1096 * @param argb ARGB data as long
1097 * @return @c ECORE_CONFIG_ERR_SUCC if there are no problems.
1098 * @ingroup Ecore_Config_Default_Group
1099 */
1100EAPI int
1101ecore_config_argbint_default(const char *key, long argb)
1102{
1103 return ecore_config_typed_default(key, &argb, ECORE_CONFIG_RGB);
1104}
1105
1106/**
1107 * Sets the indicated property to a color value if the property has not yet
1108 * been set.
1109 * @param key The property key.
1110 * @param val Color value in ARGB format.
1111 * @return @c ECORE_CONFIG_ERR_SUCC if there are no problems.
1112 * @ingroup Ecore_Config_Default_Group
1113 */
1114EAPI int
1115ecore_config_argbstr_default(const char *key, const char *val)
1116{
1117 long v = 0;
1118 return ecore_config_typed_default(key, __ecore_argbstr_to_long(val, &v), ECORE_CONFIG_RGB);
1119}
1120
1121/**
1122 * Sets the indicated property to a theme name if the property has not yet
1123 * been set.
1124 * @param key The property key.
1125 * @param val String giving the name of the theme.
1126 * @return @c ECORE_CONFIG_ERR_SUCC if the property is set successfully.
1127 * @ingroup Ecore_Config_Default_Group
1128 */
1129EAPI int
1130ecore_config_theme_default(const char *key, const char *val)
1131{
1132 return ecore_config_typed_default(key, val, ECORE_CONFIG_THM);
1133}
1134
1135/**
1136 * @defgroup Ecore_Config_Struct_Group Ecore Config Structures
1137 *
1138 * Functions that are used to create structures of properties.
1139 */
1140
1141/**
1142 * Sets the indicated property to a structure if the property has not yet
1143 * been set.
1144 * @param key The property key.
1145 * @return @c ECORE_CONFIG_ERR_SUCC if the property is set successfully.
1146 * @ingroup Ecore_Config_Struct_Group
1147 */
1148EAPI int
1149ecore_config_struct_create(const char *key)
1150{
1151 WRN("you are using ecore_config structures. These are very young");
1152 WRN(" and not complete - you have been warned");
1153
1154 return ecore_config_typed_default(key, NULL, ECORE_CONFIG_SCT);
1155}
1156
1157static int
1158_ecore_config_struct_append(Ecore_Config_Prop *sct, Ecore_Config_Prop *add)
1159{
1160 Eina_List *l;
1161
1162 if (!sct || !add || sct->type != ECORE_CONFIG_SCT)
1163 return ECORE_CONFIG_ERR_IGNORED;
1164
1165 l = sct->data;
1166 sct->data = eina_list_append(l, add);
1167 add->parent = sct;
1168
1169 return ECORE_CONFIG_ERR_SUCC;
1170}
1171
1172static int
1173_ecore_config_struct_typed_add(const char *key, const char *name, const void *val,
1174 int type)
1175{
1176 char *subkey;
1177 int ret;
1178
1179 subkey = malloc((strlen(key) + strlen(name) + 2) * sizeof(char));
1180 strcpy(subkey, key);
1181 strcat(subkey, ".");
1182 strcat(subkey, name);
1183
1184 ecore_config_typed_default(subkey, val, type);
1185 ret = _ecore_config_struct_append(ecore_config_get(key),
1186 ecore_config_get(subkey));
1187 free(subkey);
1188 return ret;
1189}
1190
1191/**
1192 * Add an int property to the named structure. The property is set if it has not
1193 * yet been set.
1194 * @param key The key of the structure to add to.
1195 * @param name The name of the item to add - this will be appended to the key
1196 * @param val the int to default to
1197 * @return @c ECORE_CONFIG_ERR_SUCC if the property is set successfully.
1198 * @ingroup Ecore_Config_Struct_Group
1199 */
1200EAPI int
1201ecore_config_struct_int_add(const char *key, const char *name, int val)
1202{
1203 return _ecore_config_struct_typed_add(key, name, &val, ECORE_CONFIG_INT);
1204}
1205
1206/**
1207 * Add a float property to the named structure. The property is set if it has
1208 * not yet been set.
1209 * @param key The key of the structure to add to.
1210 * @param name The name of the item to add - this will be appended to the key
1211 * @param val The float to default to
1212 * @return @c ECORE_CONFIG_ERR_SUCC if the property is set successfully.
1213 * @ingroup Ecore_Config_Struct_Group
1214 */
1215EAPI int
1216ecore_config_struct_float_add(const char *key, const char *name, float val)
1217{
1218 return _ecore_config_struct_typed_add(key, name, &val, ECORE_CONFIG_FLT);
1219}
1220
1221/**
1222 * Add a string property to the named structure. The property is set if it has
1223 * not yet been set.
1224 * @param key The key of the structure to add to.
1225 * @param name The name of the item to add - this will be appended to the key
1226 * @param val The string to default to
1227 * @return @c ECORE_CONFIG_ERR_SUCC if the property is set successfully.
1228 * @ingroup Ecore_Config_Struct_Group
1229 */
1230EAPI int
1231ecore_config_struct_string_add(const char *key, const char *name, const char* val)
1232{
1233 return _ecore_config_struct_typed_add(key, name, val, ECORE_CONFIG_STR);
1234}
1235
1236/**
1237 * Add an argb property to the named structure. The property is set if it has
1238 * not yet been set.
1239 * @param key The key of the structure to add to.
1240 * @param name The name of the item to add - this will be appended to the key
1241 * @param a The alpha to default to
1242 * @param r The red to default to
1243 * @param g The green to default to
1244 * @param b The blue to default to
1245 * @return @c ECORE_CONFIG_ERR_SUCC if the property is set successfully.
1246 * @ingroup Ecore_Config_Struct_Group
1247 */
1248EAPI int
1249ecore_config_struct_argb_add(const char *key, const char *name, int a, int r,
1250 int g, int b)
1251{
1252 long argb;
1253
1254 __ecore_argb_to_long(a, r, g, b, &argb);
1255 return _ecore_config_struct_typed_add(key, name, &argb, ECORE_CONFIG_RGB);
1256}
1257
1258/**
1259 * Add a theme property to the named structure. The property is set if it has
1260 * not yet been set.
1261 * @param key The key of the structure to add to.
1262 * @param name The name of the item to add - this will be appended to the key
1263 * @param val The theme name to default to
1264 * @return @c ECORE_CONFIG_ERR_SUCC if the property is set successfully.
1265 * @ingroup Ecore_Config_Struct_Group
1266 */
1267EAPI int
1268ecore_config_struct_theme_add(const char *key, const char *name, const char* val)
1269{
1270 return _ecore_config_struct_typed_add(key, name, val, ECORE_CONFIG_THM);
1271}
1272
1273/**
1274 * Add a boolean property to the named structure. The property is set if it has
1275 * not yet been set.
1276 * @param key The key of the structure to add to.
1277 * @param name The name of the item to add - this will be appended to the key
1278 * @param val The boolean to default to
1279 * @return @c ECORE_CONFIG_ERR_SUCC if the property is set successfully.
1280 * @ingroup Ecore_Config_Struct_Group
1281 */
1282EAPI int
1283ecore_config_struct_boolean_add(const char *key, const char *name, int val)
1284{
1285 val = val ? 1 : 0;
1286 return _ecore_config_struct_typed_add(key, name, &val, ECORE_CONFIG_BLN);
1287}
1288
1289/**
1290 * Get the contents of a defined structure property and load it into the passed
1291 * C struct
1292 * @param key The name of the structure property to look up.
1293 * @param data The struct to write into.
1294 * @return @c ECORE_CONFIG_ERR_SUCC if the structure is written successfully.
1295 * @ingroup Ecore_Config_Struct_Group
1296 */
1297EAPI int
1298ecore_config_struct_get(const char *key, void *data)
1299{
1300 Ecore_Config_Prop *e, *f;
1301 Eina_List *l;
1302 unsigned char *ptr;
1303 long argb;
1304
1305 e = ecore_config_get(key);
1306 if (!e)
1307 return ECORE_CONFIG_ERR_NODATA;
1308
1309 l = e->data;
1310 ptr = data;
1311 while (l)
1312 {
1313 f = (Ecore_Config_Prop *) l->data;
1314 switch (f->type)
1315 {
1316 case ECORE_CONFIG_INT:
1317 *((int *) ptr) = _ecore_config_int_get(f);
1318 ptr += sizeof(int);
1319 break;
1320 case ECORE_CONFIG_BLN:
1321 *((int *) ptr) = _ecore_config_boolean_get(f);
1322 ptr += sizeof(int);
1323 break;
1324 case ECORE_CONFIG_FLT:
1325 *((float *) ptr) = _ecore_config_float_get(f);
1326 ptr += sizeof(float);
1327 break;
1328 case ECORE_CONFIG_STR:
1329 case ECORE_CONFIG_THM:
1330 *((char **) ptr) = _ecore_config_string_get(f);
1331 ptr += sizeof(char *);
1332 break;
1333 case ECORE_CONFIG_RGB:
1334 argb = _ecore_config_argbint_get(f);
1335 *((int *) ptr) = (argb >> 24) & 0xff;
1336 ptr += sizeof(int);
1337 *((int *) ptr) = (argb >> 16) & 0xff;
1338 ptr += sizeof(int);
1339 *((int *) ptr) = (argb >> 8) & 0xff;
1340 ptr += sizeof(int);
1341 *((int *) ptr) = argb & 0xff;
1342 ptr += sizeof(int);
1343 break;
1344 default:
1345 WRN("ARGH - STRUCT coding not implemented yet");
1346 }
1347 l = eina_list_next(l);
1348 }
1349 return ECORE_CONFIG_ERR_SUCC;
1350}
1351
1352/**
1353 * @defgroup Ecore_Config_Listeners_Group Ecore Config Listeners
1354 *
1355 * Functions that set and unset property listener callbacks.
1356 */
1357
1358/**
1359 * Adds a callback function to the list of functions called when a property
1360 * changes.
1361 * @param name Name of the callback.
1362 * @param key The key of the property to listen to.
1363 * @param listener Listener callback function.
1364 * @param tag Tag to pass to @p listener when it is called.
1365 * @param data Data to pass to @p listener when it is called.
1366 * @return @c ECORE_CONFIG_ERR_SUCC if successful in setting up the callback.
1367 * @ingroup Ecore_Config_Listeners_Group
1368 */
1369EAPI int
1370ecore_config_listen(const char *name, const char *key,
1371 Ecore_Config_Listener listener, int tag, void *data)
1372{
1373 Ecore_Config_Prop *e;
1374 Ecore_Config_Listener_List *l;
1375
1376 if (!key)
1377 return ECORE_CONFIG_ERR_NODATA;
1378
1379 if (!(e = ecore_config_get(key)))
1380 {
1381 int ret = ecore_config_add(key, "");
1382
1383 if (ret != ECORE_CONFIG_ERR_SUCC)
1384 {
1385 ERR("ecore_config_listen: ecore_config_add(\"%s\") failed: %d",
1386 key, ret);
1387 return ret;
1388 }
1389 if (!(e = ecore_config_get(key)))
1390 {
1391 ERR("ecore_config_listen: list of properties corrupted!?");
1392 return ECORE_CONFIG_ERR_FAIL;
1393 }
1394 }
1395
1396 for (l = e->listeners; l; l = l->next)
1397 if (!strcmp(l->name, name) || (l->listener == listener))
1398 {
1399 ERR("ecore_config_listen: %s is already listening for changes of %s...",
1400 name, key);
1401 return ECORE_CONFIG_ERR_IGNORED;
1402 }
1403
1404 if (!(l = malloc(sizeof(Ecore_Config_Listener_List))))
1405 return ECORE_CONFIG_ERR_OOM;
1406
1407 ERR("registering listener \"%s\" for \"%s\" (%d)...", name, key, e->type);
1408
1409 memset(l, 0, sizeof(Ecore_Config_Listener_List));
1410
1411 l->listener = listener;
1412 l->name = name;
1413 l->data = data;
1414 l->tag = tag;
1415 l->next = e->listeners;
1416 e->listeners = l;
1417
1418 if (e->type != ECORE_CONFIG_NIL) /* call right on creation if prop exists and has val */
1419 listener(key, e->type, tag, data);
1420
1421 return ECORE_CONFIG_ERR_SUCC;
1422}
1423
1424/**
1425 * Removes a listener callback.
1426 * @param name Name of the callback to remove.
1427 * @param key The property key the callback is listening to.
1428 * @param listener The callback function to remove.
1429 * @return @c ECORE_CONFIG_ERR_SUCC if successful in removing the callback.
1430 * If no callback matches the given parameters, then
1431 * @c ECORE_CONFIG_ERR_NOTFOUND is returned. If @c NULL is passed
1432 * for the key pointer, @c ECORE_CONFIG_ERR_NODATA is returned.
1433 * @ingroup Ecore_Config_Listeners_Group
1434 */
1435EAPI int
1436ecore_config_deaf(const char *name, const char *key,
1437 Ecore_Config_Listener listener)
1438{
1439 Ecore_Config_Prop *e;
1440 Ecore_Config_Listener_List *l, *p;
1441 int ret;
1442
1443 ret = ECORE_CONFIG_ERR_NOTFOUND;
1444
1445 if (!key)
1446 return ECORE_CONFIG_ERR_NODATA;
1447
1448 if (!(e = ecore_config_get(key)))
1449 return ECORE_CONFIG_ERR_NOTFOUND;
1450
1451 for (p = NULL, l = e->listeners; l; p = l)
1452 {
1453 Ecore_Config_Listener_List *nl;
1454
1455 nl = l->next;
1456 if ((name && !strcmp(l->name, name)) || (l->listener == listener))
1457 {
1458 ret = ECORE_CONFIG_ERR_SUCC;
1459 if (!p)
1460 e->listeners = e->listeners->next;
1461 else
1462 p->next = l->next;
1463 memset(l, 0, sizeof(Ecore_Config_Listener));
1464 free(l);
1465 }
1466 l = nl;
1467 }
1468
1469 return ret;
1470}
1471
1472/**
1473 * Locates the first configuration bundle on the given server.
1474 * @param srv The configuration server.
1475 * @return Pointer to the first configuration bundle.
1476 */
1477EAPI Ecore_Config_Bundle *
1478ecore_config_bundle_1st_get(Ecore_Config_Server * srv)
1479{ /* anchor: global, but read-only */
1480 return srv->bundles;
1481}
1482
1483/**
1484 * Locates the configuration bundle after the given one.
1485 * @param ns The configuration bundle.
1486 * @return The next configuration bundle.
1487 */
1488EAPI Ecore_Config_Bundle *
1489ecore_config_bundle_next_get(Ecore_Config_Bundle * ns)
1490{
1491 return ns ? ns->next : NULL;
1492}
1493
1494/**
1495 * Locates a configuration bundle on a configuration server based on its serial
1496 * number.
1497 * @param srv The configuration server.
1498 * @param serial Serial number.
1499 * @return The configuration bundle with the given serial number.
1500 */
1501EAPI Ecore_Config_Bundle *
1502ecore_config_bundle_by_serial_get(Ecore_Config_Server * srv, long serial)
1503{
1504 Ecore_Config_Bundle *eb;
1505
1506 eb = srv->bundles;
1507
1508 if (serial < 0)
1509 return NULL;
1510 else if (serial == 0)
1511 {
1512 Ecore_Config_Bundle *r = eb;
1513
1514 return r;
1515 }
1516
1517 while (eb)
1518 {
1519 if (eb->serial == serial)
1520 return eb;
1521 eb = eb->next;
1522 }
1523 return NULL;
1524}
1525
1526/**
1527 * Gets the Ecore_Config_Bundle with the given identifier from the given
1528 * server.
1529 * @param srv The configuration server.
1530 * @param label The bundle's identifier string.
1531 * @return The bundle with the given identifier string, or @c NULL if it
1532 * could not be found.
1533 */
1534EAPI Ecore_Config_Bundle *
1535ecore_config_bundle_by_label_get(Ecore_Config_Server * srv, const char *label)
1536{
1537 Ecore_Config_Bundle *ns;
1538
1539 ns = srv->bundles;
1540
1541 while (ns)
1542 {
1543 if (ns->identifier && !strcmp(ns->identifier, label))
1544 return ns;
1545 ns = ns->next;
1546 }
1547 return NULL;
1548}
1549
1550/**
1551 * Retrieves the bundle's serial number.
1552 * @param ns The configuration bundle.
1553 * @return The bundle's identifier string, or -1 if ns is @c NULL.
1554 */
1555EAPI long
1556ecore_config_bundle_serial_get(Ecore_Config_Bundle * ns)
1557{
1558 return ns ? ns->serial : -1;
1559}
1560
1561/**
1562 * Retrieves the bundle's identifier.
1563 * @param ns The configuration bundle.
1564 * @return The bundle's identifer string.
1565 */
1566EAPI char *
1567ecore_config_bundle_label_get(Ecore_Config_Bundle * ns)
1568{
1569 return ns ? ns->identifier : NULL;
1570}
1571
1572/**
1573 * Creates a new Ecore_Config_Bundle.
1574 * @param srv Config server.
1575 * @param identifier Identifier string for the new bundle.
1576 * @return A pointer to a new Ecore_Config_Bundle. @c NULL is returned if the
1577 * structure couldn't be allocated.
1578 */
1579EAPI Ecore_Config_Bundle *
1580ecore_config_bundle_new(Ecore_Config_Server * srv, const char *identifier)
1581{
1582 Ecore_Config_Bundle *t;
1583 static long ss;
1584
1585 ss = 0; /* bundle unique serial */
1586
1587 if ((t = malloc(sizeof(Ecore_Config_Bundle))))
1588 {
1589 memset(t, 0, sizeof(Ecore_Config_Bundle));
1590
1591 t->identifier = (char *)identifier;
1592 t->serial = ++ss;
1593 t->owner = srv->name;
1594 t->next = srv->bundles;
1595 srv->bundles = t;
1596 }
1597 return t;
1598}
1599
1600static Ecore_Config_Server *
1601do_init(const char *name)
1602{
1603 return _ecore_config_ipc_init(name);
1604}
1605
1606static Ecore_Config_Server *
1607ecore_config_init_local(const char *name)
1608{
1609 char *p;
1610 char *buf;
1611
1612 if ((p = getenv("HOME")))
1613 { /* debug-only ### FIXME */
1614 if (!(buf = malloc(PATH_MAX * sizeof(char))))
1615 return NULL;
1616 snprintf(buf, PATH_MAX, "%s/.ecore/%s/.global", p, name);
1617 unlink(buf);
1618
1619 free(buf);
1620 }
1621
1622 return do_init(name);
1623}
1624
1625static Ecore_Config_Server *
1626ecore_config_init_global(const char *name)
1627{
1628 char *p;
1629 int global;
1630 char *buf;
1631
1632 if ((p = getenv("HOME")))
1633 { /* debug-only ### FIXME */
1634 if (!(buf = malloc(PATH_MAX * sizeof(char))))
1635 return NULL;
1636 snprintf(buf, PATH_MAX, "%s/.ecore/%s/.global", p, name);
1637 global = creat(buf, S_IRWXU);
1638
1639 if (global >= 0)
1640 close(global);
1641
1642 free(buf);
1643 }
1644
1645 return do_init(name);
1646}
1647
1648/**
1649 * @defgroup Ecore_Config_App_Lib_Group Ecore Config App Library Functions
1650 *
1651 * Functions that are used to start up and shutdown the Enlightened
1652 * Property Library when used directly by an application.
1653 */
1654
1655/**
1656 * Initializes the Enlightened Property Library.
1657 *
1658 * Either this function or @ref ecore_config_system_init must be run
1659 * before any other function in the Enlightened Property Library, even
1660 * if you have run @ref ecore_init . The name given is used to
1661 * determine the default configuration to load.
1662 *
1663 * @param name Application name
1664 * @return @c ECORE_CONFIG_ERR_SUCC if the library is successfully set up.
1665 * @c ECORE_CONFIG_ERR_FAIL otherwise.
1666 * @ingroup Ecore_Config_App_Lib_Group
1667 */
1668EAPI int
1669ecore_config_init(const char *name)
1670{
1671 char *path;
1672 Ecore_Config_Prop *list;
1673 _ecore_config_log_dom = eina_log_domain_register
1674 ("ecore_config", ECORE_CONFIG_DEFAULT_LOG_COLOR);
1675 if(_ecore_config_log_dom < 0)
1676 {
1677 EINA_LOG_ERR("Impossible to create a log domain for the Ecore config module.");
1678 return -1;
1679 }
1680 _ecore_config_system_init_no_load();
1681
1682 __ecore_config_app_name = strdup(name);
1683 __ecore_config_server_local = ecore_config_init_local(name);
1684 if (!__ecore_config_server_local)
1685 return ECORE_CONFIG_ERR_FAIL;
1686
1687 list = __ecore_config_bundle_local->data;
1688 free( __ecore_config_bundle_local );
1689 __ecore_config_bundle_local =
1690 ecore_config_bundle_new(__ecore_config_server_local, "config");
1691 __ecore_config_bundle_local->data = list;
1692
1693 path = ecore_config_theme_default_path_get();
1694 ecore_config_string_default("/e/themes/search_path", path);
1695 if (path)
1696 free(path);
1697
1698 list = ecore_config_get("/e/themes/search_path");
1699 if (list)
1700 {
1701 list->flags |= ECORE_CONFIG_FLAG_SYSTEM;
1702 list->flags &= ~ECORE_CONFIG_FLAG_MODIFIED;
1703 }
1704
1705 return _ecore_config_system_load();
1706}
1707
1708/**
1709 * Frees memory and shuts down the library for an application.
1710 * @return @c ECORE_CONFIG_ERR_IGNORED .
1711 * @ingroup Ecore_Config_App_Lib_Group
1712 */
1713EAPI int
1714ecore_config_shutdown(void)
1715{
1716 return ecore_config_system_shutdown();
1717}
1718
1719/**
1720 * @defgroup Ecore_Config_Lib_Lib_Group Ecore Config Library Functions
1721 *
1722 * Functions that are used to start up and shutdown the Enlightened
1723 * Property Library when used directly by an application.
1724 */
1725
1726/**
1727 * Initializes the Enlightened Property Library.
1728 *
1729 * This function is meant to be run from other programming libraries.
1730 * It should not be called from applications.
1731 *
1732 * This function (or @ref ecore_config_init )
1733 * must be run before any other function in the
1734 * Enlightened Property Library, even if you have run @ref ecore_init .
1735 *
1736 * @return @c ECORE_CONFIG_ERR_SUCC if the library is successfully set up.
1737 * @c ECORE_CONFIG_ERR_FAIL otherwise.
1738 * @ingroup Ecore_Config_Lib_Lib_Group
1739 */
1740EAPI int
1741ecore_config_system_init(void)
1742{
1743 _ecore_config_system_init_no_load();
1744 return _ecore_config_system_load();
1745}
1746
1747static int
1748_ecore_config_system_init_no_load(void)
1749{
1750 char *p;
1751
1752 __ecore_config_system_init++;
1753 if (__ecore_config_system_init > 1)
1754 return ECORE_CONFIG_ERR_IGNORED;
1755
1756 DEBUG = -1;
1757 if ((p = getenv("ECORE_CONFIG_DEBUG")) && p[0] != 0)
1758 {
1759 DEBUG = atoi(p);
1760 }
1761
1762 __ecore_config_server_global =
1763 ecore_config_init_global(ECORE_CONFIG_GLOBAL_ID);
1764 if (!__ecore_config_server_global)
1765 return ECORE_CONFIG_ERR_FAIL;
1766
1767 __ecore_config_bundle_local =
1768 ecore_config_bundle_new(__ecore_config_server_global, "system");
1769
1770 /* set up a simple default path */
1771 ecore_config_string_default("/e/themes/search_path", PACKAGE_DATA_DIR "../ewl/themes");
1772
1773 return ECORE_CONFIG_ERR_SUCC;
1774}
1775
1776
1777static int
1778_ecore_config_system_load(void)
1779{
1780 char *buf, *p;
1781 Ecore_Config_Prop *sys;
1782
1783 if (__ecore_config_system_init != 1)
1784 return ECORE_CONFIG_ERR_FAIL;
1785
1786 if ((p = getenv("HOME")))
1787 { /* debug-only ### FIXME */
1788 if ((buf = malloc(PATH_MAX * sizeof(char))))
1789 {
1790 snprintf(buf, PATH_MAX, "%s/.e/config.eet", p);
1791 if (ecore_config_file_load(buf) != 0) {
1792 /* even if this file (system.eet) doesn't exist we can
1793 * continue without it as it isn't striclty necessary.
1794 */
1795 ecore_config_file_load(PACKAGE_DATA_DIR "/system.eet");
1796 }
1797 sys = __ecore_config_bundle_local->data;
1798 while (sys)
1799 {
1800 /* unmark it modified - modification will mean it has been overridden */
1801 sys->flags &= ~ECORE_CONFIG_FLAG_MODIFIED;
1802 /* mark as system so that examine can hide them */
1803 sys->flags |= ECORE_CONFIG_FLAG_SYSTEM;
1804 sys = sys->next;
1805 }
1806 }
1807 free(buf);
1808 }
1809
1810 return ECORE_CONFIG_ERR_SUCC;
1811}
1812
1813
1814/**
1815 * Frees memory and shuts down the library for other programming libraries.
1816 * @return @c ECORE_CONFIG_ERR_IGNORED
1817 * @ingroup Ecore_Config_Lib_Lib_Group
1818 */
1819EAPI int
1820ecore_config_system_shutdown(void)
1821{
1822 int ret;
1823
1824 __ecore_config_system_init--;
1825 if (__ecore_config_system_init > 0)
1826 return ECORE_CONFIG_ERR_IGNORED;
1827
1828 ret = _ecore_config_ipc_exit();
1829 if (__ecore_config_app_name)
1830 free(__ecore_config_app_name);
1831 while(__ecore_config_bundle_local->data)
1832 ecore_config_dst(__ecore_config_bundle_local->data);
1833 free(__ecore_config_bundle_local);
1834 free(__ecore_config_server_local);
1835 free(__ecore_config_server_global);
1836 eina_log_domain_unregister(_ecore_config_log_dom);
1837 _ecore_config_log_dom = -1;
1838 return ret;
1839}
1840
1841static inline void *
1842__ecore_argb_to_long(int a, int r, int g, int b, long *v)
1843{
1844 *v = ((a << 24) & 0xff000000 )
1845 | ((r << 16) & 0xff0000 )
1846 | ((g << 8) & 0xff00 )
1847 | ( b & 0xff );
1848
1849 return v;
1850}
1851
1852static inline void *
1853__ecore_argbstr_to_long(const char *argb, long *v)
1854{
1855 char *l = NULL;
1856
1857 // convert hexadecimal string #..., #0x..., 0x..., ... to long
1858 if(*argb == '#')
1859 argb++;
1860 *v = (long)strtoul( argb, &l, 16);
1861
1862 if(*l)
1863 {
1864 ERR("ecore_config_val: value \"%s\" not a valid hexadecimal RGB value?", argb);
1865 return NULL;
1866 }
1867
1868 return v;
1869}
1870
diff --git a/libraries/ecore/src/lib/ecore_config/ecore_config_db.c b/libraries/ecore/src/lib/ecore_config/ecore_config_db.c
deleted file mode 100644
index 6238958..0000000
--- a/libraries/ecore/src/lib/ecore_config/ecore_config_db.c
+++ /dev/null
@@ -1,296 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <stdlib.h>
6#include <stdio.h>
7#include <string.h>
8#include <limits.h>
9
10#include <sys/param.h>
11#include <sys/types.h>
12#include <sys/stat.h>
13#include <unistd.h>
14#include <locale.h>
15
16#include <Eet.h>
17
18#include "Ecore_Config.h"
19#include "ecore_config_private.h"
20#include "ecore_config_util.h"
21
22struct _Ecore_Config_DB_File
23{
24 Eet_File *ef;
25};
26
27Ecore_Config_DB_File *
28_ecore_config_db_open_read(const char *file)
29{
30 Eet_File *ef;
31 Ecore_Config_DB_File *db;
32
33 eet_init();
34 db = malloc(sizeof(Ecore_Config_DB_File));
35 if (!db) return NULL;
36 ef = eet_open((char*)file, EET_FILE_MODE_READ);
37 if (!ef)
38 {
39 free(db);
40 return NULL;
41 }
42 db->ef = ef;
43 return db;
44}
45
46Ecore_Config_DB_File *
47_ecore_config_db_open_write(const char *file)
48{
49 Eet_File *ef;
50 Ecore_Config_DB_File *db;
51
52 eet_init();
53 db = malloc(sizeof(Ecore_Config_DB_File));
54 if (!db) return NULL;
55 ef = eet_open((char*)file, EET_FILE_MODE_WRITE);
56 if (!ef)
57 {
58 free(db);
59 return NULL;
60 }
61 db->ef = ef;
62 return db;
63}
64
65void
66_ecore_config_db_close(Ecore_Config_DB_File *db)
67{
68 eet_close(db->ef);
69 free(db);
70 eet_shutdown();
71}
72
73char **
74_ecore_config_db_keys_get(Ecore_Config_DB_File *db, int *num_ret)
75{
76 char **keys;
77 int key_count;
78 int i;
79
80 keys = eet_list(db->ef, (char*)"*", &key_count);
81 if (!keys)
82 {
83 *num_ret = 0;
84 return NULL;
85 }
86 /* make keys freeable - this is safe to do */
87 for (i = 0; i < key_count; i++) keys[i] = strdup(keys[i]);
88 *num_ret = key_count;
89 return keys;
90}
91
92Ecore_Config_Type
93_ecore_config_db_key_type_get(Ecore_Config_DB_File *db, const char *key)
94{
95 char *data;
96 int size;
97
98 data = eet_read(db->ef, (char*)key, &size);
99 if (data)
100 {
101 if (size <= 2)
102 {
103 free(data);
104 return ECORE_CONFIG_NIL;
105 }
106 if (data[size - 1] != 0)
107 {
108 free(data);
109 return ECORE_CONFIG_NIL;
110 }
111 return (Ecore_Config_Type) data[0];
112 }
113 return ECORE_CONFIG_NIL;
114}
115
116int
117_ecore_config_db_read(Ecore_Config_DB_File *db, const char *key)
118{
119 char *data, *value;
120 int size;
121 Ecore_Config_Type type;
122
123 data = eet_read(db->ef, (char*)key, &size);
124 if (data)
125 {
126 int l;
127 char *prev_locale;
128
129 if (size <= 2)
130 {
131 free(data);
132 return 0;
133 }
134 if (data[size - 1] != 0)
135 {
136 free(data);
137 return 0;
138 }
139 /* "type" NIL 1242 NIL */
140 l = strlen(data);
141 if (l >= (size - 1))
142 {
143 free(data);
144 return 0;
145 }
146
147 type = data[0];
148 value = data + l + 1;
149
150 switch (type)
151 {
152 case ECORE_CONFIG_INT:
153 case ECORE_CONFIG_BLN:
154 {
155 int tmp;
156 prev_locale = setlocale(LC_NUMERIC, "C");
157 tmp = atoi(value);
158 if (prev_locale) setlocale(LC_NUMERIC, prev_locale);
159
160 ecore_config_typed_set(key, (void *)&tmp, type);
161 break;
162 }
163 case ECORE_CONFIG_FLT:
164 {
165 float tmp;
166 prev_locale = setlocale(LC_NUMERIC, "C");
167 tmp = atof(value);
168 if (prev_locale) setlocale(LC_NUMERIC, prev_locale);
169
170 ecore_config_typed_set(key, (void *)&tmp, type);
171 break;
172 }
173 case ECORE_CONFIG_RGB:
174 ecore_config_argbstr_set(key, value);
175 break;
176 case ECORE_CONFIG_STR:
177 case ECORE_CONFIG_THM:
178 ecore_config_typed_set(key, (void *)value, type);
179 break;
180 case ECORE_CONFIG_SCT:
181 INF("loading struct %s", key);
182 break;
183 default:
184 WRN("Type %d not handled", type);
185 }
186 free(data);
187 return 1;
188 }
189 return 0;
190}
191
192/*
193void *
194_ecore_config_db_key_data_get(Ecore_Config_DB_File *db, const char *key, int *size_ret)
195{
196 char *data;
197 int size;
198
199 data = eet_read(db->ef, (char*)key, &size);
200 if (data)
201 {
202 int l;
203 char *dat;
204
205 if (size <= 2)
206 {
207 free(data);
208 return NULL;
209 }
210 if (data[size - 1] != 0)
211 {
212 free(data);
213 return NULL;
214 }
215 * "type" NIL data_goes_here NIL *
216 l = strlen(data);
217 if (l >= (size - 1))
218 {
219 free(data);
220 return NULL;
221 }
222 dat = malloc(size - (l + 2));
223 memcpy(dat, data + l + 1, size - (l + 2));
224 free(data);
225 *size_ret = size - (l + 2);
226 return dat;
227 }
228 return NULL;
229}*/
230
231void
232_ecore_config_db_write(Ecore_Config_DB_File *db, Ecore_Config_Prop *e)
233{
234 char *prev_locale= NULL;
235 char *val = NULL;
236 char *r = NULL;
237 int num;
238
239 prev_locale = setlocale(LC_NUMERIC, "C");
240
241 switch (e->type)
242 {
243 case ECORE_CONFIG_INT:
244 esprintf(&val, "%i", _ecore_config_int_get(e));
245 break;
246 case ECORE_CONFIG_BLN:
247 esprintf(&val, "%i", _ecore_config_boolean_get(e));
248 break;
249 case ECORE_CONFIG_FLT:
250 esprintf(&val, "%16.16f", _ecore_config_float_get(e));
251 break;
252 case ECORE_CONFIG_STR:
253 val = _ecore_config_string_get(e);
254 break;
255 case ECORE_CONFIG_THM:
256 val = _ecore_config_theme_get(e);
257 break;
258 case ECORE_CONFIG_RGB:
259 val = _ecore_config_argbstr_get(e);
260 break;
261 default:
262 WRN("Type %d not handled", e->type);
263 }
264
265 if (prev_locale)
266 {
267 setlocale(LC_NUMERIC, prev_locale);
268 }
269
270 if(val)
271 {
272 num = esprintf(&r, "%c%c%s%c", (char) e->type, 0, val, 0);
273 if(num)
274 eet_write(db->ef, e->key, r, num, 1);
275 free(r);
276 }
277
278 free(val);
279}
280/*
281void
282_ecore_config_db_key_data_set(Ecore_Config_DB_File *db, const char *key, void *data, int data_size)
283{
284 char *buf;
285 int num;
286
287 num = 1 + 1 + data_size + 1;
288 buf = malloc(num);
289 if (!buf) return;
290 buf[0] = (char) ECORE_CONFIG_BIN;
291 buf[1] = 0;
292 memcpy(buf + 2, data, data_size);
293 buf[num - 1] = 0;
294 eet_write(db->ef, (char*)key, buf, num, 1);
295 free(buf);
296}*/
diff --git a/libraries/ecore/src/lib/ecore_config/ecore_config_extra.c b/libraries/ecore/src/lib/ecore_config/ecore_config_extra.c
deleted file mode 100644
index a134952..0000000
--- a/libraries/ecore/src/lib/ecore_config/ecore_config_extra.c
+++ /dev/null
@@ -1,803 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <string.h>
6#include <stdio.h>
7#include <stdlib.h>
8
9#include <sys/types.h>
10#include <sys/stat.h>
11
12#include "Ecore_Config.h"
13#include "Ecore.h"
14#include "ecore_config_private.h"
15typedef struct __Ecore_Config_Arg_Callback _Ecore_Config_Arg_Callback;
16struct __Ecore_Config_Arg_Callback
17{
18 char short_opt;
19 char *long_opt;
20 char *description;
21 void *data;
22 void (*func)(char *val, void *data);
23 Ecore_Config_Type type;
24 _Ecore_Config_Arg_Callback *next;
25};
26
27char *__ecore_config_app_description;
28_Ecore_Config_Arg_Callback *_ecore_config_arg_callbacks;
29
30/* shorthand prop setup code to make client apps a little smaller ;) */
31
32/**
33 * Creates a new property, if it does not already exist, and sets its
34 * attributes to those given.
35 *
36 * The type of the property is guessed from the key and the value
37 * given.
38 *
39 * @param key The property key.
40 * @param val Pointer to default value of key.
41 * @param short_opt Short option used to set the property from command
42 * line.
43 * @param long_opt Long option used to set the property from command line.
44 * @param desc String description of property.
45 * @return @c ECORE_CONFIG_ERR_SUCC on success.
46 * @ingroup Ecore_Config_Create_Group
47 */
48int
49ecore_config_create(const char *key, void *val, char short_opt, char *long_opt,
50 char *desc)
51{
52 int type = ecore_config_type_guess(key, val);
53
54 return ecore_config_typed_create(key, val, type, short_opt, long_opt, desc);
55}
56
57/**
58 * Creates a new property, if it does not already exist, and sets its
59 * attributes to those given.
60 * @param key The property key.
61 * @param val Pointer to default value of key.
62 * @param type Type of the property.
63 * @param short_opt Short option used to set the property from
64 * command line.
65 * @param long_opt Long option used to set the property from command line.
66 * @param desc String description of property.
67 * @return @c ECORE_CONFIG_ERR_SUCC on success.
68 * @ingroup Ecore_Config_Create_Group
69 */
70int
71ecore_config_typed_create(const char *key, void *val, int type, char short_opt,
72 char *long_opt, char *desc)
73{
74 int ret;
75
76 if ((ret =
77 ecore_config_typed_default(key, val, type)) != ECORE_CONFIG_ERR_SUCC)
78 return ret;
79 if ((ret =
80 ecore_config_short_opt_set(key, short_opt)) != ECORE_CONFIG_ERR_SUCC)
81 return ret;
82 if ((ret =
83 ecore_config_long_opt_set(key, long_opt)) != ECORE_CONFIG_ERR_SUCC)
84 return ret;
85 ret = ecore_config_describe(key, desc);
86 return ret;
87}
88
89/**
90 * Creates a new boolean property, if it does not already exist, and sets its
91 * attributes to those given.
92 * @param key The property key.
93 * @param val Default boolean value of key.
94 * @param short_opt Short option used to set the property from command
95 * line.
96 * @param long_opt Long option used to set the property from command line.
97 * @param desc String description of property.
98 * @return @c ECORE_CONFIG_ERR_SUCC on success.
99 * @ingroup Ecore_Config_Create_Group
100 */
101int
102ecore_config_boolean_create(const char *key, int val, char short_opt,
103 char *long_opt, char *desc)
104{
105 return
106 ecore_config_typed_create(key, (void *)&val, ECORE_CONFIG_BLN, short_opt, long_opt,
107 desc);
108}
109
110/**
111 * Creates a new integer property, if it does not already exist, and sets its
112 * attributes to those given.
113 * @param key The property key.
114 * @param val Default integer value of key.
115 * @param short_opt Short option used to set the property from command
116 * line.
117 * @param long_opt Long option used to set the property from command line.
118 * @param desc String description of property.
119 * @return @c ECORE_CONFIG_ERR_SUCC on success.
120 * @ingroup Ecore_Config_Create_Group
121 */
122int
123ecore_config_int_create(const char *key, int val, char short_opt,
124 char *long_opt, char *desc)
125{
126 return
127 ecore_config_typed_create(key, (void *)&val, ECORE_CONFIG_INT, short_opt, long_opt,
128 desc);
129}
130
131/**
132 * Creates a new integer property, if it does not already exist, and sets its
133 * attributes to those given.
134 * @param key The property key.
135 * @param val Default integer value of key.
136 * @param low Lowest valid integer value for the property.
137 * @param high Highest valid integer value for the property.
138 * @param step Increment value for the property.
139 * @param short_opt Short option used to set the property from command
140 * line.
141 * @param long_opt Long option used to set the property from command line.
142 * @param desc String description of property.
143 * @return @c ECORE_CONFIG_ERR_SUCC on success.
144 * @ingroup Ecore_Config_Create_Group
145 */
146int
147ecore_config_int_create_bound(const char *key, int val, int low, int high,
148 int step, char short_opt, char *long_opt,
149 char *desc)
150{
151 Ecore_Config_Prop *e;
152 int ret;
153
154 ret =
155 ecore_config_typed_create(key, (void *)&val, ECORE_CONFIG_INT, short_opt, long_opt,
156 desc);
157 if (ret != ECORE_CONFIG_ERR_SUCC)
158 return ret;
159 e = ecore_config_get(key);
160 if (e)
161 {
162 e->step = step;
163 e->flags |= ECORE_CONFIG_FLAG_BOUNDS;
164 e->lo = low;
165 e->hi = high;
166 ecore_config_bound(e);
167 }
168 return ret;
169}
170
171/**
172 * Creates a new string property, if it does not already exist, and sets its
173 * attributes to those given.
174 * @param key The property key.
175 * @param val Default value of key.
176 * @param short_opt Short option used to set the property from command
177 * line.
178 * @param long_opt Long option used to set the property from command line.
179 * @param desc String description of property.
180 * @return @c ECORE_CONFIG_ERR_SUCC on success.
181 * @ingroup Ecore_Config_Create_Group
182 */
183int
184ecore_config_string_create(const char *key, char *val, char short_opt,
185 char *long_opt, char *desc)
186{
187 return
188 ecore_config_typed_create(key, (void *)val, ECORE_CONFIG_STR, short_opt, long_opt,
189 desc);
190}
191
192/**
193 * Creates a new float property, if it does not already exist, and sets its
194 * attributes to those given.
195 * @param key The property key.
196 * @param val Default float value of key.
197 * @param short_opt Short option used to set the property from command
198 * line.
199 * @param long_opt Long option used to set the property from command line.
200 * @param desc String description of property.
201 * @return @c ECORE_CONFIG_ERR_SUCC on success.
202 * @ingroup Ecore_Config_Create_Group
203 */
204int
205ecore_config_float_create(const char *key, float val, char short_opt,
206 char *long_opt, char *desc)
207{
208 return
209 ecore_config_typed_create(key, (void *)&val, ECORE_CONFIG_FLT, short_opt, long_opt,
210 desc);
211}
212
213/**
214 * Creates a new float property, if it does not already exist, and sets its
215 * attributes to those given.
216 * @param key The property key.
217 * @param val Default float value of key.
218 * @param low Lowest valid float value for the property.
219 * @param high Highest valid float value for the property.
220 * @param step Increment value for the property.
221 * @param short_opt Short option used to set the property from command
222 * line.
223 * @param long_opt Long option used to set the property from command line.
224 * @param desc String description of property.
225 * @return @c ECORE_CONFIG_ERR_SUCC on success.
226 * @ingroup Ecore_Config_Create_Group
227 */
228int
229ecore_config_float_create_bound(const char *key, float val, float low,
230 float high, float step, char short_opt,
231 char *long_opt, char *desc)
232{
233 Ecore_Config_Prop *e;
234 int ret;
235
236 ret =
237 ecore_config_typed_create(key, (void *)&val, ECORE_CONFIG_FLT, short_opt, long_opt,
238 desc);
239 e = ecore_config_get(key);
240 if (e)
241 {
242 e->step = (int)(step * ECORE_CONFIG_FLOAT_PRECISION);
243 e->flags |= ECORE_CONFIG_FLAG_BOUNDS;
244 e->lo = (int)(low * ECORE_CONFIG_FLOAT_PRECISION);
245 e->hi = (int)(high * ECORE_CONFIG_FLOAT_PRECISION);
246 ecore_config_bound(e);
247 }
248 return ret;
249}
250
251/**
252 * Creates a new color property, if it does not already exist, and sets its
253 * attributes to those given.
254 * @param key The property key.
255 * @param val Default color value of key, as a hexadecimal string.
256 * @param short_opt Short option used to set the property from command
257 * line.
258 * @param long_opt Long option used to set the property from command line.
259 * @param desc String description of property.
260 * @return @c ECORE_CONFIG_ERR_SUCC on success.
261 * @ingroup Ecore_Config_Create_Group
262 */
263int
264ecore_config_argb_create(const char *key, char *val, char short_opt,
265 char *long_opt, char *desc)
266{
267 return
268 ecore_config_typed_create(key, (void *)val, ECORE_CONFIG_RGB, short_opt, long_opt,
269 desc);
270}
271
272/**
273 * Creates a new theme property, if it does not already exist, and sets its
274 * attributes to those given.
275 * @param key The property key.
276 * @param val Default theme name for the property.
277 * @param short_opt Short option used to set the property from command
278 * line.
279 * @param long_opt Long option used to set the property from command line.
280 * @param desc String description of property.
281 * @return @c ECORE_CONFIG_ERR_SUCC on success.
282 * @ingroup Ecore_Config_Create_Group
283 */
284int
285ecore_config_theme_create(const char *key, char *val, char short_opt,
286 char *long_opt, char *desc)
287{
288 return
289 ecore_config_typed_create(key, (void *)val, ECORE_CONFIG_THM, short_opt, long_opt,
290 desc);
291}
292
293/* this should only be built if evas is present */
294
295/**
296 * Calls evas_font_path_append on @p evas for each of the font names stored
297 * in the property "/e/font/path".
298 * @param evas Evas object to append the font names to.
299 * @return @c ECORE_CONFIG_ERR_SUCC on success. @c ECORE_CONFIG_ERR_NODATA
300 * is returned if the property has not been set.
301 */
302int
303ecore_config_evas_font_path_apply(Evas * evas)
304{
305 char *font_path, *font_path_tmp, *ptr, *end;
306
307 font_path = ecore_config_string_get("/e/font/path");
308
309 if (!font_path)
310 return ECORE_CONFIG_ERR_NODATA;
311 ptr = font_path;
312 end = font_path + strlen(font_path);
313 font_path_tmp = font_path;
314 while (ptr && ptr < end)
315 {
316 while (*ptr != '|' && ptr < end)
317 ptr++;
318 if (ptr < end)
319 *ptr = '\0';
320
321 evas_font_path_append(evas, font_path_tmp);
322 ptr++;
323 font_path_tmp = ptr;
324 }
325
326 free(font_path);
327
328 return ECORE_CONFIG_ERR_SUCC;
329}
330
331/**
332 * Retrieves the default theme search path.
333 *
334 * @return The default theme search path.
335 */
336char *
337ecore_config_theme_default_path_get(void)
338{
339 char *path, *home;
340 int len;
341
342 home = getenv("HOME");
343 len = strlen(PACKAGE_DATA_DIR "/../") + strlen(__ecore_config_app_name) +
344 strlen("/themes/") + 1;
345 if (home)
346 len += strlen(home) + strlen("/.e/apps/") +
347 strlen(__ecore_config_app_name) +
348 strlen("/themes/|"); /* no \0, as that is above */
349
350 if (!(path = malloc(len)))
351 return NULL;
352
353 *path = '\0';
354 if (home)
355 {
356 strcat(path, home);
357 strcat(path, "/.e/apps/");
358 strcat(path, __ecore_config_app_name);
359 strcat(path, "/themes/|");
360 }
361 strcat(path, PACKAGE_DATA_DIR "/../");
362 strcat(path, __ecore_config_app_name);
363 strcat(path, "/themes/");
364
365 return path;
366}
367
368/**
369 * Retrieves the search path used to find themes.
370 *
371 * The search path is stored in the property "/e/themes/search_path". If
372 * the property has not been set, the default path used is
373 * "/usr/local/share/<app_name>/themes|~/.e/apps/<app_name>/themes".
374 * See @ref ecore_config_theme_default_path_get for more information about
375 * the default path.
376 *
377 * @return The search path. @c NULL is returned if there is no memory left.
378 */
379char *
380ecore_config_theme_search_path_get(void)
381{
382 char *search_path;
383 search_path = ecore_config_string_get("/e/themes/search_path");
384
385 /* this should no longer be the case, as it is defaulted in init */
386 if (!search_path)
387 {
388 search_path = ecore_config_theme_default_path_get();
389 if (search_path)
390 {
391 ecore_config_string_default("/e/themes/search_path", search_path);
392 free(search_path);
393 }
394 }
395 return search_path;
396}
397
398/**
399 * Adds the given path to the search path used to find themes.
400 *
401 * If the search path is successfully, the new search path will be saved
402 * into the property "/e/themes/search_path". Therefore, this function
403 * should be called @b after @ref ecore_config_load to allow a user to
404 * override the default search path.
405 *
406 * @param path The given
407 * @return @c ECORE_CONFIG_ERR_SUCC on success. @c ECORE_CONFIG_ERR_FAIL
408 * will be returned if @p path already exists in the search path.
409 * @c ECORE_CONFIG_ERR_FAIL is returned if @p path is @c NULL.
410 */
411int
412ecore_config_theme_search_path_append(const char *path)
413{
414 char *search_path, *loc, *new_search_path;
415 int len, search_len;
416 Ecore_Config_Prop *prop;
417
418 if (!path)
419 return ECORE_CONFIG_ERR_NODATA;
420 search_path = ecore_config_theme_search_path_get();
421
422 loc = strstr(search_path, path);
423 len = strlen(path);
424 search_len = strlen(search_path);
425
426 if (!loc || (loc != search_path && *(loc - 1) != '|') ||
427 (loc != (search_path + search_len - len) && *(loc + len - 1) != '|'))
428 {
429 new_search_path = malloc(search_len + len + 2); /* 2 = \0 + | */
430 strcpy(new_search_path, search_path);
431 strncat(new_search_path, "|", 1);
432 strncat(new_search_path, path, len);
433
434 ecore_config_string_set("/e/themes/search_path", new_search_path);
435 prop = ecore_config_get("/e/themes/search_path");
436 if (prop)
437 prop->flags &= ~ECORE_CONFIG_FLAG_MODIFIED;
438
439 free(new_search_path);
440
441 return ECORE_CONFIG_ERR_SUCC;
442 }
443 return ECORE_CONFIG_ERR_FAIL;
444}
445
446/**
447 * Retrieve a theme file's full path.
448 *
449 * The search path for theme files is given by @ref
450 * ecore_config_theme_search_path_get .
451 *
452 * @param name The name of the theme.
453 * @return A full path to the theme on success. @c NULL will be returned
454 * if @p name is @c NULL or no theme matching the given name could
455 * be found.
456 */
457char *
458ecore_config_theme_with_path_from_name_get(char *name)
459{
460 char *search_path, *search_path_tmp, *ptr, *end, *file;
461 struct stat st;
462
463 if (!name)
464 return NULL; /* no theme specified (nor a default) */
465
466 search_path = ecore_config_theme_search_path_get();
467 ptr = search_path;
468 end = search_path + strlen(search_path);
469 search_path_tmp = search_path;
470 while (ptr && ptr < end)
471 {
472 while (*ptr != '|' && ptr < end)
473 ptr++;
474 if (ptr < end)
475 *ptr = '\0';
476
477 file = malloc(strlen(search_path_tmp) + strlen(name) + 6);
478 /* 6 = / + .edj + \0 */
479
480 snprintf(file, strlen(search_path_tmp) + strlen(name) + 6,
481 "%s/%s.edj", search_path_tmp, name);
482
483 if (stat(file, &st) == 0)
484 {
485 free(search_path);
486 return file;
487 }
488 free(file);
489 ptr++;
490 search_path_tmp = ptr;
491 }
492
493 free(search_path);
494
495 return NULL; /* we could not find the theme with that name in search path */
496}
497
498/**
499 * Retrieves the full path to the theme file of the theme stored in the
500 * given property.
501 *
502 * The search path for themes is given by @ref
503 * ecore_config_theme_search_path_get .
504 *
505 * @param key The given property.
506 * @return A full path to the theme on success, or @c NULL on failure.
507 * This function will fail if no key is specified or not theme
508 * matching that given by the property @p key could be found.
509 */
510char *
511ecore_config_theme_with_path_get(const char *key)
512{
513 return
514 ecore_config_theme_with_path_from_name_get(ecore_config_theme_get(key));
515}
516
517static const char *_ecore_config_short_types[] =
518 { " ", "<int> ", "<flt> ", "<str> ", "<rgb> ", "<str> ", "<bool>" };
519
520/**
521 * Prints the property list of the local configuration bundle to output.
522 */
523void
524ecore_config_args_display(void)
525{
526 Ecore_Config_Prop *props;
527 _Ecore_Config_Arg_Callback *callbacks;
528
529 if (__ecore_config_app_description)
530 ERR("%s\n\n", __ecore_config_app_description);
531 ERR("Supported Options:");
532 ERR(" -h, --help\t Print this text");
533 if (!__ecore_config_bundle_local)
534 return;
535 props = __ecore_config_bundle_local->data;
536 while (props)
537 {
538 /* if it is a system prop, or cannot be set on command line hide it */
539 if (props->flags & ECORE_CONFIG_FLAG_SYSTEM || (!props->short_opt && !props->long_opt))
540 {
541 props = props->next;
542 continue;
543 }
544 INF(" %c%c%c --%s\t%s %s", props->short_opt ? '-' : ' ',
545 props->short_opt ? props->short_opt : ' ',
546 props->short_opt ? ',' : ' ',
547 props->long_opt ? props->long_opt : props->key,
548 _ecore_config_short_types[props->type],
549 props->description ? props->description :
550 "(no description available)");
551
552 props = props->next;
553 }
554 callbacks = _ecore_config_arg_callbacks;
555 while (callbacks)
556 {
557 INF(" %c%c%c --%s\t%s %s", callbacks->short_opt ? '-' : ' ',
558 callbacks->short_opt ? callbacks->short_opt : ' ',
559 callbacks->short_opt ? ',' : ' ',
560 callbacks->long_opt ? callbacks->long_opt : "",
561 _ecore_config_short_types[callbacks->type],
562 callbacks->description ? callbacks->description :
563 "(no description available)");
564
565 callbacks = callbacks->next;
566 }
567}
568
569static int
570ecore_config_parse_set(Ecore_Config_Prop * prop, char *arg, char *opt,
571 char opt2)
572{
573 if (!arg)
574 {
575 if (opt)
576 ERR("Missing expected argument for option --%s", opt);
577 else
578 ERR("Missing expected argument for option -%c", opt2);
579 return ECORE_CONFIG_PARSE_EXIT;
580 }
581 else
582 {
583 ecore_config_set(prop->key, arg);
584 prop->flags |= ECORE_CONFIG_FLAG_CMDLN;
585 }
586 return ECORE_CONFIG_PARSE_CONTINUE;
587}
588
589static void
590ecore_config_args_callback_add(char short_opt, char *long_opt, char *desc,
591 void (*func)(char *val, void *data),
592 void *data, Ecore_Config_Type type) {
593 _Ecore_Config_Arg_Callback *new_cb;
594
595 new_cb = malloc(sizeof(_Ecore_Config_Arg_Callback));
596 new_cb->short_opt = short_opt;
597 if (long_opt)
598 new_cb->long_opt = strdup(long_opt);
599 if (desc)
600 new_cb->description = strdup(desc);
601 new_cb->data = data;
602 new_cb->func = func;
603 new_cb->type = type;
604
605 new_cb->next = _ecore_config_arg_callbacks;
606 _ecore_config_arg_callbacks = new_cb;
607}
608
609void
610ecore_config_args_callback_str_add(char short_opt, char *long_opt, char *desc,
611 void (*func)(char *val, void *data),
612 void *data) {
613 ecore_config_args_callback_add(short_opt, long_opt, desc, func, data, ECORE_CONFIG_STR);
614}
615
616void
617ecore_config_args_callback_noarg_add(char short_opt, char *long_opt, char *desc,
618 void (*func)(char *val, void *data),
619 void *data) {
620 ecore_config_args_callback_add(short_opt, long_opt, desc, func, data, ECORE_CONFIG_NIL);
621}
622
623/**
624 * Parse the arguments set by @ref ecore_app_args_set and set properties
625 * accordingly.
626 *
627 * @return @c ECORE_CONFIG_PARSE_CONTINUE if successful.
628 * @c ECORE_CONFIG_PARSE_EXIT is returned if an unrecognised option
629 * is found. @c ECORE_CONFIG_PARSE_HELP is returned if help was
630 * displayed.
631 */
632int
633ecore_config_args_parse(void)
634{
635 int argc;
636 char **argv;
637 int nextarg, next_short_opt, found, ret;
638 char *arg;
639 char *long_opt, short_opt;
640 Ecore_Config_Prop *prop;
641 _Ecore_Config_Arg_Callback *callback;
642
643 ecore_app_args_get(&argc, &argv);
644 nextarg = 1;
645 while (nextarg < argc)
646 {
647 arg = argv[nextarg];
648
649 if (*arg != '-')
650 {
651 ERR("Unexpected attribute \"%s\"", arg);
652 nextarg++;
653 continue;
654 }
655
656 next_short_opt = 1;
657 short_opt = *(arg + next_short_opt);
658
659 if (short_opt == '-')
660 {
661 long_opt = arg + 2;
662
663 if (!strcmp(long_opt, "help"))
664 {
665 ecore_config_args_display();
666 return ECORE_CONFIG_PARSE_HELP;
667 }
668
669 found = 0;
670 prop = __ecore_config_bundle_local->data;
671 while (prop)
672 {
673 if ((prop->long_opt && !strcmp(long_opt, prop->long_opt))
674 || !strcmp(long_opt, prop->key))
675 {
676 found = 1;
677 if ((ret =
678 ecore_config_parse_set(prop, argv[++nextarg],
679 long_opt,
680 '\0')) !=
681 ECORE_CONFIG_PARSE_CONTINUE)
682 return ret;
683 break;
684 }
685 prop = prop->next;
686 }
687 if (!found)
688 {
689 callback = _ecore_config_arg_callbacks;
690 while (callback)
691 {
692 if ((callback->long_opt &&
693 !strcmp(long_opt, callback->long_opt)))
694 {
695 found = 1;
696 if (callback->type == ECORE_CONFIG_NIL)
697 {
698 callback->func(NULL, callback->data);
699 }
700 else
701 {
702 if (!argv[++nextarg])
703 {
704 ERR("Missing expected argument for option --%s", long_opt);
705 return ECORE_CONFIG_PARSE_EXIT;
706 }
707 callback->func(argv[nextarg], callback->data);
708 }
709 break;
710 }
711 callback = callback->next;
712 }
713 }
714 if (!found)
715 {
716 ERR("Unrecognised option \"%s\"", long_opt);
717 ERR("Try using -h or --help for more information.\n");
718 return ECORE_CONFIG_PARSE_EXIT;
719 }
720 }
721 else
722 {
723 while (short_opt)
724 {
725 if (short_opt == 'h')
726 {
727 ecore_config_args_display();
728 return ECORE_CONFIG_PARSE_HELP;
729 }
730 else
731 {
732 found = 0;
733 prop = __ecore_config_bundle_local->data;
734 while (prop)
735 {
736 if (short_opt == prop->short_opt)
737 {
738 found = 1;
739 if ((ret =
740 ecore_config_parse_set(prop,
741 argv[++nextarg],
742 NULL,
743 short_opt)) !=
744 ECORE_CONFIG_PARSE_CONTINUE)
745 return ret;
746 break;
747 }
748 prop = prop->next;
749 }
750
751 if (!found)
752 {
753 callback = _ecore_config_arg_callbacks;
754 while (callback)
755 {
756 if (short_opt == callback->short_opt)
757 {
758 found = 1;
759 if (callback->type == ECORE_CONFIG_NIL)
760 {
761 callback->func(NULL, callback->data);
762 }
763 else
764 {
765 if (!argv[++nextarg])
766 {
767 ERR("Missing expected argument for option -%c", short_opt);
768 return ECORE_CONFIG_PARSE_EXIT;
769 }
770 callback->func(argv[nextarg], callback->data);
771 }
772 break;
773 }
774 callback = callback->next;
775 }
776 }
777 if (!found)
778 {
779 ERR("Unrecognised option '%c'", short_opt);
780 ERR("Try using -h or --help for more information.\n");
781 return ECORE_CONFIG_PARSE_EXIT;
782 }
783 }
784 short_opt = *(arg + ++next_short_opt);
785 }
786 }
787 nextarg++;
788 }
789
790 return ECORE_CONFIG_PARSE_CONTINUE;
791}
792
793/**
794 * Sets the description string used by @ref ecore_config_args_display .
795 * @param description Description of application.
796 */
797void
798ecore_config_app_describe(char *description)
799{
800 if (__ecore_config_app_description)
801 free(__ecore_config_app_description);
802 __ecore_config_app_description = strdup(description);
803}
diff --git a/libraries/ecore/src/lib/ecore_config/ecore_config_ipc.h b/libraries/ecore/src/lib/ecore_config/ecore_config_ipc.h
deleted file mode 100644
index 7b3dea1..0000000
--- a/libraries/ecore/src/lib/ecore_config/ecore_config_ipc.h
+++ /dev/null
@@ -1,50 +0,0 @@
1#include <Ecore_Ipc.h>
2#include "Ecore_Config.h"
3
4typedef enum
5{
6 IPC_NONE,
7 IPC_PROP_LIST,
8 IPC_PROP_DESC,
9 IPC_PROP_GET,
10 IPC_PROP_SET, /* end of the codes shared by evidence and econf */
11
12 IPC_GLOBAL_PROP_LIST,
13
14 IPC_BUNDLE_LIST,
15 IPC_BUNDLE_NEW,
16 IPC_BUNDLE_LABEL_GET,
17 IPC_BUNDLE_LABEL_SET,
18 IPC_BUNDLE_LABEL_FIND,
19
20 IPC_LAST
21} Ecore_Config_Ipc_Call;
22
23Ecore_Config_Server *_ecore_config_ipc_init(const char *pipe_name);
24int _ecore_config_ipc_exit(void);
25
26Ecore_Config_Server *_ecore_config_server_convert(void *srv);
27
28char *_ecore_config_ipc_prop_list(Ecore_Config_Server * srv,
29 const long serial);
30char *_ecore_config_ipc_prop_desc(Ecore_Config_Server * srv,
31 const long serial,
32 const char *key);
33char *_ecore_config_ipc_prop_get(Ecore_Config_Server * srv,
34 const long serial,
35 const char *key);
36int _ecore_config_ipc_prop_set(Ecore_Config_Server * srv,
37 const long serial,
38 const char *key,
39 const char *val);
40
41char *_ecore_config_ipc_bundle_list(Ecore_Config_Server * srv);
42int _ecore_config_ipc_bundle_new(Ecore_Config_Server * srv,
43 const char *);
44char *_ecore_config_ipc_bundle_label_get(Ecore_Config_Server *
45 srv, const long);
46int _ecore_config_ipc_bundle_label_set(Ecore_Config_Server *
47 srv, const long,
48 const char *);
49long _ecore_config_ipc_bundle_label_find(Ecore_Config_Server *
50 srv, const char *);
diff --git a/libraries/ecore/src/lib/ecore_config/ecore_config_ipc_ecore.c b/libraries/ecore/src/lib/ecore_config/ecore_config_ipc_ecore.c
deleted file mode 100644
index b1622f3..0000000
--- a/libraries/ecore/src/lib/ecore_config/ecore_config_ipc_ecore.c
+++ /dev/null
@@ -1,384 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5/* by Azundris, with thanks to Corey Donohoe <atmos@atmos.org> */
6#include <stdio.h>
7#include <stdlib.h>
8#include <string.h>
9#include <errno.h>
10#include <limits.h>
11#include <sys/types.h>
12#include <sys/stat.h>
13#include <unistd.h>
14#include <ctype.h>
15
16#include <Ecore.h>
17#include "ecore_private.h"
18#include <Ecore_Ipc.h>
19
20#include "ecore_config_ipc.h"
21#include "ecore_config_util.h"
22#include "ecore_config_private.h"
23
24#include "Ecore_Config.h"
25
26
27/*****************************************************************************/
28
29static int
30_ecore_config_ipc_ecore_string_get(char **m, char **r)
31{
32 char *q;
33 int l = 0;
34
35 if (!m || !*m)
36 return ECORE_CONFIG_ERR_NODATA;
37 if (!r)
38 return ECORE_CONFIG_ERR_FAIL;
39 q = *m;
40 if (*q != 's')
41 return ECORE_CONFIG_ERR_TYPEMISMATCH;
42 q++;
43 l = (*(q++)) << 8;
44 l += *(q++);
45 *r = q;
46 q += l;
47 *m = q;
48 WRN("IPC/eCore: got string-%d \"%s\"", l, *r);
49 return ECORE_CONFIG_ERR_SUCC;
50}
51
52static char *
53_ecore_config_ipc_global_prop_list(Ecore_Config_Server * srv __UNUSED__, long serial __UNUSED__)
54{
55 Ecore_Config_DB_File *db;
56 char **keys;
57 int key_count, x;
58 estring *s;
59 int f;
60 char buf[PATH_MAX], *p;
61 // char *data; UNUSED
62 Ecore_Config_Type type;
63
64 db = NULL;
65 s = estring_new(8192);
66 f = 0;
67 if ((p = getenv("HOME")))
68 {
69 snprintf(buf, sizeof(buf), "%s/.e/config.eet", p);
70 if (!(db = _ecore_config_db_open_read(buf)))
71 {
72 strcpy(buf, PACKAGE_DATA_DIR"/system.eet");
73 if (!(db = _ecore_config_db_open_read(buf)))
74 return NULL;
75 }
76 }
77 if (!db) return NULL;
78 key_count = 0;
79 keys = _ecore_config_db_keys_get(db, &key_count);
80 if (keys)
81 {
82 for (x = 0; x < key_count; x++)
83 {
84 type = _ecore_config_db_key_type_get(db, keys[x]);
85 switch (type)
86 {
87 case ECORE_CONFIG_INT:
88 estring_appendf(s, "%s%s: integer", f ? "\n" : "", keys[x]);
89 break;
90 case ECORE_CONFIG_BLN:
91 estring_appendf(s, "%s%s: boolean", f ? "\n" : "", keys[x]);
92 break;
93 case ECORE_CONFIG_FLT:
94 estring_appendf(s, "%s%s: float", f ? "\n" : "", keys[x]);
95 break;
96 case ECORE_CONFIG_STR:
97 estring_appendf(s, "%s%s: string", f ? "\n" : "", keys[x]);
98 break;
99 case ECORE_CONFIG_RGB:
100 estring_appendf(s, "%s%s: colour", f ? "\n" : "", keys[x]);
101 break;
102 case ECORE_CONFIG_THM:
103 estring_appendf(s, "%s%s: theme", f ? "\n" : "", keys[x]);
104 break;
105 case ECORE_CONFIG_SCT:
106 estring_appendf(s, "%s%s: structure", f ? "\n" : "", keys[x]);
107 break;
108 default:
109 estring_appendf(s, "%s%s: unknown", f ? "\n" : "", keys[x]);
110 continue;
111 }
112 f = 1;
113 }
114 }
115 _ecore_config_db_close(db);
116 if (keys)
117 {
118 for (x = 0; x < key_count; x++)
119 {
120 free(keys[x]);
121 }
122 free(keys);
123 }
124
125 return estring_disown(s);
126}
127
128/*****************************************************************************/
129
130static int
131_ecore_config_ipc_ecore_send(Ecore_Ipc_Event_Client_Data * e, int code,
132 char *reply)
133{
134 static int our_ref = 0;
135 int len = reply ? strlen(reply) + 1 : 0;
136
137 our_ref++;
138 WRN("IPC/eCore: replying [0,0] %d IRT %d => %d {\"%s\":%d}", our_ref,
139 e->ref, code, reply ? reply : "", len);
140 return ecore_ipc_client_send(e->client, 0, 0, our_ref, e->ref, code, reply,
141 len);
142}
143
144/*****************************************************************************/
145
146static int
147_ecore_config_ipc_ecore_handle_request(Ecore_Ipc_Server * server,
148 Ecore_Ipc_Event_Client_Data * e)
149{
150 Ecore_Config_Server *srv;
151 long serial;
152 int ret;
153 char *r, *k, *v, *m;
154
155 srv = _ecore_config_server_convert(server);
156 serial = e->minor;
157 r = NULL;
158 m = (char *)e->data;
159 INF("IPC/eCore: client sent: [%d,%d] #%d (%d) @ %p", e->major, e->minor,
160 e->ref, e->size, server);
161
162 switch (e->major)
163 {
164 case IPC_PROP_LIST:
165 if (srv == __ecore_config_server_global)
166 r = _ecore_config_ipc_global_prop_list(srv, serial);
167 else
168 r = _ecore_config_ipc_prop_list(srv, serial);
169 break;
170 case IPC_PROP_DESC:
171 if (_ecore_config_ipc_ecore_string_get(&m, &k) == ECORE_CONFIG_ERR_SUCC)
172 r = _ecore_config_ipc_prop_desc(srv, serial, k);
173 break;
174 case IPC_PROP_GET:
175 if (_ecore_config_ipc_ecore_string_get(&m, &k) == ECORE_CONFIG_ERR_SUCC)
176 r = _ecore_config_ipc_prop_get(srv, serial, k);
177 break;
178 case IPC_PROP_SET:
179 if (_ecore_config_ipc_ecore_string_get(&m, &k) == ECORE_CONFIG_ERR_SUCC)
180 {
181 if (_ecore_config_ipc_ecore_string_get(&m, &v) ==
182 ECORE_CONFIG_ERR_SUCC)
183 return _ecore_config_ipc_ecore_send(e,
184 _ecore_config_ipc_prop_set
185 (srv, serial, k, v), NULL);
186 }
187 break;
188
189 case IPC_BUNDLE_LIST:
190 r = _ecore_config_ipc_bundle_list(srv);
191 break;
192 case IPC_BUNDLE_NEW:
193 if (_ecore_config_ipc_ecore_string_get(&m, &k) == ECORE_CONFIG_ERR_SUCC)
194 return _ecore_config_ipc_ecore_send(e,
195 k ?
196 _ecore_config_ipc_bundle_new(srv,
197 k) :
198 ECORE_CONFIG_ERR_FAIL, NULL);
199 break;
200 case IPC_BUNDLE_LABEL_SET:
201 if (_ecore_config_ipc_ecore_string_get(&m, &k) == ECORE_CONFIG_ERR_SUCC)
202 return _ecore_config_ipc_ecore_send(e,
203 k ?
204 _ecore_config_ipc_bundle_label_set
205 (srv, serial,
206 k) : ECORE_CONFIG_ERR_FAIL,
207 NULL);
208 break;
209 case IPC_BUNDLE_LABEL_FIND:
210 if (_ecore_config_ipc_ecore_string_get(&m, &k) == ECORE_CONFIG_ERR_SUCC)
211 return _ecore_config_ipc_ecore_send(e,
212 _ecore_config_ipc_bundle_label_find
213 (srv, k), NULL);
214 break;
215 case IPC_BUNDLE_LABEL_GET:
216 r = _ecore_config_ipc_bundle_label_get(srv, serial);
217 break;
218 }
219
220 ret =
221 _ecore_config_ipc_ecore_send(e,
222 r ? ECORE_CONFIG_ERR_SUCC :
223 ECORE_CONFIG_ERR_FAIL, r);
224 if (r)
225 {
226 free(r);
227 return ret;
228 }
229 return ECORE_CONFIG_ERR_NOTFOUND;
230}
231
232/*****************************************************************************/
233
234static Eina_Bool
235_ecore_config_ipc_client_add(void *data, int type __UNUSED__, void *event)
236{
237 Ecore_Ipc_Server **server;
238 Ecore_Ipc_Event_Client_Data *e;
239
240 server = (Ecore_Ipc_Server **) data;
241 e = (Ecore_Ipc_Event_Client_Data *) event;
242
243 if (*server != ecore_ipc_client_server_get(e->client))
244 return EINA_TRUE;
245
246 INF("IPC/eCore: Client connected. @ %p", server);
247 return EINA_TRUE;
248}
249
250static Eina_Bool
251_ecore_config_ipc_client_del(void *data, int type __UNUSED__, void *event)
252{
253 Ecore_Ipc_Server **server;
254 Ecore_Ipc_Event_Client_Data *e;
255
256 server = (Ecore_Ipc_Server **) data;
257 e = (Ecore_Ipc_Event_Client_Data *) event;
258
259 if (*server != ecore_ipc_client_server_get(e->client))
260 return EINA_TRUE;
261
262 INF("IPC/eCore: Client disconnected. @ %p", server);
263 return EINA_TRUE;
264}
265
266static Eina_Bool
267_ecore_config_ipc_client_sent(void *data, int type __UNUSED__, void *event)
268{
269 Ecore_Ipc_Server **server;
270 Ecore_Ipc_Event_Client_Data *e;
271
272 server = (Ecore_Ipc_Server **) data;
273 e = (Ecore_Ipc_Event_Client_Data *) event;
274
275 if (*server != ecore_ipc_client_server_get(e->client))
276 return EINA_TRUE;
277
278 _ecore_config_ipc_ecore_handle_request(*server, e);
279 return EINA_TRUE;
280}
281
282/*****************************************************************************/
283
284int
285_ecore_config_ipc_ecore_init(const char *pipe_name, void **data)
286{
287 Ecore_Ipc_Server **server;
288 struct stat st;
289 char *p;
290 int port;
291 char socket[PATH_MAX];
292
293 server = (Ecore_Ipc_Server **) data;
294 port = 0;
295 if (!server)
296 return ECORE_CONFIG_ERR_FAIL;
297
298/* if(*server)
299 return ECORE_CONFIG_ERR_IGNORED; */
300
301 ecore_init();
302 if (ecore_ipc_init() < 1)
303 return ECORE_CONFIG_ERR_FAIL;
304
305 if ((p = getenv("HOME")))
306 { /* debug-only ### FIXME */
307 int stale;
308
309 stale = 1;
310 while (stale)
311 {
312 snprintf(socket, PATH_MAX, "%s/.ecore/%s/%d", p, pipe_name, port);
313
314 if (!stat(socket, &st))
315 {
316 INF("IPC/eCore: pipe \"%s\" already exists!?", socket);
317/* if(unlink(buf))
318 E(0,"IPC/eCore: could not remove pipe \"%s\": %d\n",buf,errno); }}*/
319 port++;
320 }
321 else
322 {
323 stale = 0;
324 }
325 }
326 }
327 *server = ecore_ipc_server_add(ECORE_IPC_LOCAL_USER, pipe_name, port, NULL);
328 ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_ADD,
329 _ecore_config_ipc_client_add, server);
330 ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DEL,
331 _ecore_config_ipc_client_del, server);
332 ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DATA,
333 _ecore_config_ipc_client_sent, server);
334
335 if (*server)
336 {
337 INF("IPC/eCore: Server is listening on %s.", pipe_name);
338 }
339
340 return ECORE_CONFIG_ERR_SUCC;
341}
342
343int
344_ecore_config_ipc_ecore_exit(void **data)
345{
346 int ret;
347 Ecore_Ipc_Server **server;
348
349 ret = ECORE_CONFIG_ERR_SUCC;
350 server = (Ecore_Ipc_Server **) data;
351
352 if (!server)
353 return ECORE_CONFIG_ERR_FAIL;
354
355 if (*server)
356 {
357 ecore_ipc_server_del(*server);
358 *server = NULL;
359 }
360
361 ecore_ipc_shutdown();
362 ecore_shutdown();
363
364 return ret;
365}
366
367/*****************************************************************************/
368
369int
370_ecore_config_ipc_ecore_poll(void **data)
371{
372 Ecore_Ipc_Server **server;
373
374 server = (Ecore_Ipc_Server **) data;
375
376 if (!server)
377 return ECORE_CONFIG_ERR_FAIL;
378
379 ecore_main_loop_iterate();
380
381 return ECORE_CONFIG_ERR_SUCC;
382}
383
384/*****************************************************************************/
diff --git a/libraries/ecore/src/lib/ecore_config/ecore_config_ipc_main.c b/libraries/ecore/src/lib/ecore_config/ecore_config_ipc_main.c
deleted file mode 100644
index 35bd783..0000000
--- a/libraries/ecore/src/lib/ecore_config/ecore_config_ipc_main.c
+++ /dev/null
@@ -1,275 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5/* ############## bad */
6#define HAVE_EVAS2
7
8#include <signal.h>
9#include <dlfcn.h>
10#include <stdio.h>
11#include <glob.h>
12#include <sys/param.h>
13#include <limits.h>
14#include <string.h>
15#include <stdlib.h> /* malloc(), free() */
16
17#include "Ecore.h"
18#include "Ecore_Config.h"
19#include "ecore_config_util.h"
20#include "ecore_config_ipc.h"
21
22#include "ecore_config_private.h"
23
24static Ecore_Config_Server *__ecore_config_servers;
25Ecore_Timer *ipc_timer = NULL;
26
27Ecore_Config_Server *
28_ecore_config_server_convert(void *srv)
29{
30 Ecore_Config_Server *srv_tmp;
31
32 srv_tmp = __ecore_config_servers;
33 while (srv_tmp)
34 {
35 if (srv_tmp->server == srv)
36 return srv_tmp;
37 srv_tmp = srv_tmp->next;
38 }
39
40 return __ecore_config_server_global;
41}
42
43/*****************************************************************************/
44/* INTERFACE FOR IPC MODULES */
45/*****************************/
46
47char *
48_ecore_config_ipc_prop_list(Ecore_Config_Server * srv, const long serial)
49{
50 Ecore_Config_Bundle *theme;
51 Ecore_Config_Prop *e;
52 estring *s;
53 int f;
54
55 theme = ecore_config_bundle_by_serial_get(srv, serial);
56 e = theme ? theme->data : NULL;
57 s = estring_new(8192);
58 f = 0;
59 while (e)
60 {
61 /* ignore system properties in listings, unless they have been overridden */
62 if (e->flags & ECORE_CONFIG_FLAG_SYSTEM && !(e->flags & ECORE_CONFIG_FLAG_MODIFIED))
63 {
64 e = e->next;
65 continue;
66 }
67 estring_appendf(s, "%s%s: %s", f ? "\n" : "", e->key,
68 ecore_config_type_get(e));
69 if (e->flags & ECORE_CONFIG_FLAG_BOUNDS)
70 {
71 if (e->type == ECORE_CONFIG_FLT)
72 estring_appendf(s, ", range %le..%le",
73 (float)e->lo / ECORE_CONFIG_FLOAT_PRECISION,
74 (float)e->hi / ECORE_CONFIG_FLOAT_PRECISION);
75 else
76 estring_appendf(s, ", range %d..%d", e->lo, e->hi);
77 }
78 if (e->type == ECORE_CONFIG_THM)
79 estring_appendf(s, ", group %s", e->data ? e->data : "Main");
80 f = 1;
81 e = e->next;
82 }
83
84 return estring_disown(s);
85}
86
87char *
88_ecore_config_ipc_prop_desc(Ecore_Config_Server * srv, const long serial,
89 const char *key)
90{
91#ifdef HAVE_EVAS2
92 Ecore_Config_Prop *e;
93
94 e = ecore_config_get(key);
95 if (e)
96 {
97 estring *s = estring_new(512);
98
99 estring_appendf(s, "%s: %s", e->key, ecore_config_type_get(e));
100 if (e->flags & ECORE_CONFIG_FLAG_BOUNDS)
101 estring_appendf(s, ", range %d..%d", e->lo, e->hi);
102 return estring_disown(s);
103 }
104#endif
105 return strdup("<undefined>");
106}
107
108char *
109_ecore_config_ipc_prop_get(Ecore_Config_Server * srv, const long serial,
110 const char *key)
111{
112#ifdef HAVE_EVAS2
113 char *ret;
114
115 if ((ret = ecore_config_as_string_get(key)))
116 return ret;
117#endif
118 return strdup("<undefined>");
119}
120
121int
122_ecore_config_ipc_prop_set(Ecore_Config_Server * srv, const long serial,
123 const char *key, const char *val)
124{
125#ifdef HAVE_EVAS2
126 int ret;
127 Ecore_Config_Bundle *theme;
128
129 theme = ecore_config_bundle_by_serial_get(srv, serial);
130 ret = ecore_config_set(key, (char *)val);
131 ERR("ipc.prop.set(%s->%s,\"%s\") => %d\n", theme ? theme->identifier : "",
132 key, val, ret);
133 return ret;
134#else
135 return ECORE_CONFIG_ERR_NOTSUPP;
136#endif
137}
138
139/*****************************************************************************/
140
141char *
142_ecore_config_ipc_bundle_list(Ecore_Config_Server * srv)
143{
144 Ecore_Config_Bundle *ns;
145 estring *s;
146 int f;
147
148 ns = ecore_config_bundle_1st_get(srv);
149 s = estring_new(8192);
150 f = 0;
151 if (!ns)
152 return strdup("<no_bundles_created>");
153
154 while (ns)
155 {
156 estring_appendf(s, "%s%d: %s", f ? "\n" : "",
157 ecore_config_bundle_serial_get(ns),
158 ecore_config_bundle_label_get(ns));
159 f = 1;
160 ns = ecore_config_bundle_next_get(ns);
161 }
162
163 return estring_disown(s);
164}
165
166int
167_ecore_config_ipc_bundle_new(Ecore_Config_Server * srv, const char *label)
168{
169 if (ecore_config_bundle_new(srv, label))
170 return ECORE_CONFIG_ERR_SUCC;
171 return ECORE_CONFIG_ERR_FAIL;
172}
173
174char *
175_ecore_config_ipc_bundle_label_get(Ecore_Config_Server * srv, const long serial)
176{
177 Ecore_Config_Bundle *ns;
178 char *label;
179
180 ns = ecore_config_bundle_by_serial_get(srv, serial);
181 label = ecore_config_bundle_label_get(ns);
182 return strdup(label ? label : "<no such bundle>");
183}
184
185int
186_ecore_config_ipc_bundle_label_set(Ecore_Config_Server * srv, const long serial,
187 const char *label)
188{
189 Ecore_Config_Bundle *ns;
190
191 ns = ecore_config_bundle_by_serial_get(srv, serial);
192 if (!(ns->identifier = malloc(sizeof(label))))
193 return ECORE_CONFIG_ERR_OOM;
194 memcpy(ns->identifier, label, sizeof(label));
195 return ECORE_CONFIG_ERR_SUCC;
196}
197
198long
199_ecore_config_ipc_bundle_label_find(Ecore_Config_Server * srv,
200 const char *label)
201{
202 Ecore_Config_Bundle *ns;
203
204 ns = ecore_config_bundle_by_label_get(srv, label);
205 return ns ? ecore_config_bundle_serial_get(ns) : -1;
206}
207
208static Eina_Bool
209_ecore_config_ipc_poll(void *data __UNUSED__)
210{
211 Ecore_Config_Server *s;
212
213 s = __ecore_config_servers;
214 while (s)
215 {
216 _ecore_config_ipc_ecore_poll(&s->server);
217 s = s->next;
218 }
219
220 return EINA_TRUE;
221}
222
223int
224_ecore_config_ipc_exit(void)
225{
226 Ecore_Config_Server *l;
227
228 if (ipc_timer)
229 ecore_timer_del(ipc_timer);
230
231 l = __ecore_config_servers;
232 while (l)
233 {
234 _ecore_config_ipc_ecore_exit(&l->server);
235 if (l->name)
236 free(l->name);
237 l = l->next;
238 }
239
240 return ECORE_CONFIG_ERR_SUCC;
241}
242
243Ecore_Config_Server *
244_ecore_config_ipc_init(const char *pipe_name)
245{
246 int ret;
247 Ecore_Config_Server *list;
248 Ecore_Config_Server *ret_srv;
249
250 list = NULL;
251 ret_srv = NULL;
252 list = NULL;
253
254 list = calloc(1, sizeof(Ecore_Config_Server));
255 if ((ret = _ecore_config_ipc_ecore_init(pipe_name, &list->server)) != ECORE_CONFIG_ERR_SUCC)
256 {
257 ERR("_ecore_config_ipc_init: failed to register %s, code %d",
258 pipe_name, ret);
259 }
260
261 ERR("_ecore_config_ipc_init: registered \"%s\"...", pipe_name);
262
263 list->name = strdup(pipe_name);
264 list->next = __ecore_config_servers;
265
266 __ecore_config_servers = list;
267 if (!ret_srv)
268 ret_srv = list;
269
270 if (!ipc_timer)
271 ipc_timer = ecore_timer_add(100, _ecore_config_ipc_poll, NULL);
272
273 return ret_srv;
274}
275/*****************************************************************************/
diff --git a/libraries/ecore/src/lib/ecore_config/ecore_config_private.h b/libraries/ecore/src/lib/ecore_config/ecore_config_private.h
deleted file mode 100644
index b97f695..0000000
--- a/libraries/ecore/src/lib/ecore_config/ecore_config_private.h
+++ /dev/null
@@ -1,70 +0,0 @@
1#ifndef _ECORE_CONFIG_PRIVATE_H
2# define _ECORE_CONFIG_PRIVATE_H
3#ifdef ECORE_CONFIG_DEFAULT_LOG_COLOR
4# undef ECORE_CONFIG_DEFAULT_LOG_COLOR
5#endif
6#define ECORE_CONFIG_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
7 /* eina_log related things */
8
9extern int _ecore_config_log_dom;
10#ifdef ERR
11# undef ERR
12#endif
13#define ERR(...) EINA_LOG_DOM_ERR(_ecore_config_log_dom, __VA_ARGS__)
14
15#ifdef DBG
16# undef DBG
17#endif
18#define DBG(...) EINA_LOG_DOM_DBG(_ecore_config_log_dom, __VA_ARGS__)
19
20#ifdef INF
21# undef INF
22#endif
23#define INF(...) EINA_LOG_DOM_INFO(_ecore_config_log_dom, __VA_ARGS__)
24
25#ifdef WRN
26# undef WRN
27#endif
28#define WRN(...) EINA_LOG_DOM_WARN(_ecore_config_log_dom, __VA_ARGS__)
29
30#ifdef CRIT
31# undef CRIT
32#endif
33#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_config_log_dom, __VA_ARGS__)
34
35/* debug */
36extern int DEBUG;
37
38
39typedef struct _Ecore_Config_DB_File Ecore_Config_DB_File;
40
41int _ecore_config_mod_init(const char *pipe_name, void **data);
42int _ecore_config_mod_exit(void **data);
43int _ecore_config_mod_poll(void **data);
44
45Ecore_Config_DB_File *_ecore_config_db_open_read(const char *file);
46Ecore_Config_DB_File *_ecore_config_db_open_write(const char *file);
47void _ecore_config_db_close(Ecore_Config_DB_File *db);
48char **_ecore_config_db_keys_get(Ecore_Config_DB_File *db, int *num_ret);
49Ecore_Config_Type _ecore_config_db_key_type_get(Ecore_Config_DB_File *db, const char *key);
50int _ecore_config_db_read(Ecore_Config_DB_File *db, const char *key);
51void _ecore_config_db_write(Ecore_Config_DB_File *db, Ecore_Config_Prop *e);
52
53int _ecore_config_boolean_get(Ecore_Config_Prop *e);
54char *_ecore_config_string_get(Ecore_Config_Prop *e);
55long _ecore_config_int_get(Ecore_Config_Prop *e);
56int _ecore_config_argb_get(Ecore_Config_Prop *e, int *a, int *r,
57 int *g, int *b);
58char *_ecore_config_argbstr_get(Ecore_Config_Prop *e);
59long _ecore_config_argbint_get(Ecore_Config_Prop *e);
60float _ecore_config_float_get(Ecore_Config_Prop *e);
61char *_ecore_config_theme_get(Ecore_Config_Prop *e);
62
63int _ecore_config_ipc_ecore_init(const char *pipe_name, void **data);
64int _ecore_config_ipc_ecore_exit(void **data);
65int _ecore_config_ipc_ecore_poll(void **data);
66
67#include "Ecore.h"
68#include "ecore_private.h"
69
70#endif
diff --git a/libraries/ecore/src/lib/ecore_config/ecore_config_storage.c b/libraries/ecore/src/lib/ecore_config/ecore_config_storage.c
deleted file mode 100644
index d059645..0000000
--- a/libraries/ecore/src/lib/ecore_config/ecore_config_storage.c
+++ /dev/null
@@ -1,176 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <stdlib.h>
6#include <stdio.h>
7#include <string.h>
8#include <limits.h>
9
10#include <sys/param.h>
11#include <sys/types.h>
12#include <sys/stat.h>
13#include <unistd.h>
14
15#include "Ecore_Config.h"
16#include "ecore_config_private.h"
17
18/**
19 * Loads the default configuration.
20 * @return @c ECORE_CONFIG_ERR_SUCC on success. @c ECORE_CONFIG_ERR_NODATA
21 * is returned if the file cannot be loaded.
22 * @ingroup Ecore_Config_File_Group
23 */
24EAPI int
25ecore_config_load(void)
26{
27 char file[PATH_MAX];
28
29 if (!__ecore_config_app_name)
30 return ECORE_CONFIG_ERR_FAIL;
31
32 snprintf(file, PATH_MAX, "%s/.e/apps/%s/config.eet", getenv("HOME"),
33 __ecore_config_app_name);
34 return ecore_config_file_load(file);
35}
36
37/**
38 * Saves the current configuration to the default file.
39 * @return @c ECORE_CONFIG_ERR_SUCC is returned on success.
40 * @c ECORE_CONFIG_ERR_FAIL is returned if the data cannot be
41 * saved.
42 * @ingroup Ecore_Config_File_Group
43 */
44EAPI int
45ecore_config_save(void)
46{
47 char file[PATH_MAX];
48
49 if (!__ecore_config_app_name)
50 return ECORE_CONFIG_ERR_FAIL;
51
52 snprintf(file, PATH_MAX, "%s/.e/apps/%s/config.eet", getenv("HOME"),
53 __ecore_config_app_name);
54 return ecore_config_file_save(file);
55}
56
57/**
58 * Load the given configuration file to the local configuration.
59 * @param file Name of the file to load.
60 * @return @c ECORE_CONFIG_ERR_SUCC on success. @c ECORE_CONFIG_ERR_NODATA
61 * is returned if the file cannot be loaded.
62 * @ingroup Ecore_Config_File_Group
63 */
64EAPI int
65ecore_config_file_load(const char *file)
66{
67 Ecore_Config_DB_File *db;
68 char **keys;
69 int key_count;
70 int x;
71 // double ftmp; UNUSED
72 // int pt; UNUSED
73 // int itmp; UNUSED
74 // Ecore_Config_Type type; UNUSED
75 char *data;
76
77 db = NULL;
78 data = NULL;
79
80 db = _ecore_config_db_open_read(file);
81 if (!db)
82 {
83 ERR("Cannot open database from file %s!", file);
84 return ECORE_CONFIG_ERR_NODATA;
85 }
86 key_count = 0;
87 keys = _ecore_config_db_keys_get(db, &key_count);
88 if (keys)
89 {
90 for (x = 0; x < key_count; x++)
91 {
92 _ecore_config_db_read(db, keys[x]);
93 }
94 }
95 _ecore_config_db_close(db);
96 if (keys)
97 {
98 for (x = 0; x < key_count; x++)
99 {
100 free(keys[x]);
101 }
102 free(keys);
103 }
104 return ECORE_CONFIG_ERR_SUCC;
105}
106
107static void
108_ecore_config_recurse_mkdir(const char *file)
109{
110 char *file_ptr;
111 char *file_tmp;
112 struct stat status;
113
114 file_tmp = strdup(file);
115 file_ptr = file_tmp + strlen(file_tmp);
116 while (*file_ptr != '/' && file_ptr > file_tmp)
117 file_ptr--;
118 *file_ptr = '\0';
119
120 if ((file_tmp[0] != 0) && stat(file_tmp, &status))
121 {
122 _ecore_config_recurse_mkdir(file_tmp);
123 mkdir(file_tmp, S_IRUSR | S_IWUSR | S_IXUSR);
124 }
125 free(file_tmp);
126}
127
128/**
129 * Saves the local configuration to the given file.
130 * @param file Name of the file to save to.
131 * @return @c ECORE_CONFIG_ERR_SUCC is returned on success.
132 * @c ECORE_CONFIG_ERR_FAIL is returned if the data cannot be
133 * saved.
134 * @ingroup Ecore_Config_File_Group
135 */
136EAPI int
137ecore_config_file_save(const char *file)
138{
139 Ecore_Config_Prop *next;
140 Ecore_Config_DB_File *db;
141 struct stat status;
142
143 next = __ecore_config_bundle_local->data;
144 db = NULL;
145
146 /* if file does not exist check to see if the dirs exist, creating if not */
147 if (stat(file, &status))
148 _ecore_config_recurse_mkdir(file);
149
150 db = _ecore_config_db_open_write(file);
151 if (!db)
152 {
153 ERR("Cannot open database from file %s!", file);
154 return ECORE_CONFIG_ERR_FAIL;
155 }
156
157 while (next)
158 {
159 /* let the config_db deal with this
160 * handyande: hmm, not sure that it ever does - reinstating until
161 * further discussions satisfy me!
162 */
163 if (!(next->flags & ECORE_CONFIG_FLAG_MODIFIED) || next->flags & ECORE_CONFIG_FLAG_CMDLN)
164 {
165 next = next->next;
166 continue;
167 }
168
169 _ecore_config_db_write(db, next);
170
171 next = next->next;
172 }
173
174 _ecore_config_db_close(db);
175 return ECORE_CONFIG_ERR_SUCC;
176}
diff --git a/libraries/ecore/src/lib/ecore_config/ecore_config_util.c b/libraries/ecore/src/lib/ecore_config/ecore_config_util.c
deleted file mode 100644
index 6156936..0000000
--- a/libraries/ecore/src/lib/ecore_config/ecore_config_util.c
+++ /dev/null
@@ -1,129 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5/* azundris */
6
7#include <sys/types.h>
8#include <stdlib.h> /* malloc(), free() */
9#include <stdio.h>
10#include <string.h> /* str...() */
11
12#include <stdarg.h> /* varargs in sprintf/appendf */
13
14#include "Ecore.h"
15#include "ecore_private.h"
16
17#include "Ecore_Config.h"
18#include "ecore_config_util.h"
19
20#include "ecore_config_private.h"
21
22#define CHUNKLEN 4096
23
24/*****************************************************************************/
25/* STRINGS */
26/***********/
27
28estring *
29estring_new(int size)
30{
31 estring *e = malloc(sizeof(estring));
32
33 if (e)
34 {
35 memset(e, 0, sizeof(estring));
36 if ((size > 0) && (e->str = malloc(size)))
37 e->alloc = size;
38 }
39 return e;
40}
41
42char *
43estring_disown(estring * e)
44{
45 if (e)
46 {
47 char *r = e->str;
48
49 free(e);
50 return r;
51 }
52 return NULL;
53}
54
55int
56estring_appendf(estring * e, const char *fmt, ...)
57{
58 int need;
59 va_list ap;
60 char *p;
61
62 if (!e)
63 return ECORE_CONFIG_ERR_FAIL;
64
65 if (!e->str)
66 {
67 e->used = e->alloc = 0;
68 if (!(e->str = (char *)malloc(e->alloc = CHUNKLEN)))
69 return ECORE_CONFIG_ERR_OOM;
70 }
71
72 va_start(ap, fmt);
73 need = vsnprintf(NULL, 0, fmt, ap);
74 va_end(ap);
75
76 if (need >= (e->alloc - e->used))
77 {
78 e->alloc = e->used + need + (CHUNKLEN - (need % CHUNKLEN));
79
80 if (!(p = (char *)realloc(e->str, e->alloc)))
81 {
82 free(e->str);
83 e->alloc = e->used = 0;
84 return ECORE_CONFIG_ERR_OOM;
85 }
86 e->str = p;
87 }
88
89 va_start(ap, fmt);
90 need = vsnprintf(e->str + e->used, e->alloc - e->used, fmt, ap);
91 va_end(ap);
92
93 return e->used += need;
94}
95
96int
97esprintf(char **result, const char *fmt, ...)
98{
99 va_list ap;
100 size_t need;
101 char *n;
102
103 if (!result)
104 return ECORE_CONFIG_ERR_FAIL;
105
106 va_start(ap, fmt);
107 need = vsnprintf(NULL, 0, fmt, ap) + 1;
108 va_end(ap);
109 n = malloc(need + 1);
110
111 if (n)
112 {
113 va_start(ap, fmt);
114 need = vsnprintf(n, need, fmt, ap);
115 va_end(ap);
116
117 n[need] = 0;
118
119 if(*result)
120 free(result);
121 *result = n;
122
123 return need;
124 }
125
126 return ECORE_CONFIG_ERR_OOM;
127}
128
129/*****************************************************************************/
diff --git a/libraries/ecore/src/lib/ecore_config/ecore_config_util.h b/libraries/ecore/src/lib/ecore_config/ecore_config_util.h
deleted file mode 100644
index 5bee9d6..0000000
--- a/libraries/ecore/src/lib/ecore_config/ecore_config_util.h
+++ /dev/null
@@ -1,14 +0,0 @@
1#define TIMER_STOP 0
2#define TIMER_CONT 1
3
4typedef struct _estring
5{
6 char *str;
7 int alloc, used;
8} estring;
9
10estring *estring_new(int size);
11char *estring_disown(estring * e);
12int estring_appendf(estring * e, const char *fmt, ...);
13
14int esprintf(char **result, const char *fmt, ...);