summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiscomfitor <mike@zentific.com>2013-10-19 08:42:36 +0100
committerdiscomfitor <mike@zentific.com>2013-10-19 08:42:36 +0100
commitd92a4b041dd42987fed713b336ae7404d51ac03f (patch)
treeab2d2b76650fd918d82216e5e5e5d66d722cc44e
parent74b7e8eb87b1e78cd16f8638e1db4071fb24a84f (diff)
work on eldbus conversion
-rw-r--r--configure.ac2
-rw-r--r--src/bin/dbus.c126
-rw-r--r--src/lib/erssd_dbus.c56
-rw-r--r--src/lib/erssd_lib.c4
-rw-r--r--src/lib/erssd_private.h2
5 files changed, 95 insertions, 95 deletions
diff --git a/configure.ac b/configure.ac
index 85f7a4b..b02b4d1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -58,7 +58,7 @@ AC_FUNC_ALLOCA
58PKG_PROG_PKG_CONFIG 58PKG_PROG_PKG_CONFIG
59 59
60min_efl_version=1.7 60min_efl_version=1.7
61ERSSD_UTIL_REQUIRES="eina >= $min_efl_version eet >= $min_efl_version azy edbus2" 61ERSSD_UTIL_REQUIRES="eina >= $min_efl_version eet >= $min_efl_version azy eldbus"
62 62
63PKG_CHECK_MODULES(ERSSD_UTIL, [$ERSSD_UTIL_REQUIRES]) 63PKG_CHECK_MODULES(ERSSD_UTIL, [$ERSSD_UTIL_REQUIRES])
64PKG_CHECK_MODULES(ERSSD, [ecore >= $min_efl_version ecore-file >= $min_efl_version efreet >= $min_efl_version]) 64PKG_CHECK_MODULES(ERSSD, [ecore >= $min_efl_version ecore-file >= $min_efl_version efreet >= $min_efl_version])
diff --git a/src/bin/dbus.c b/src/bin/dbus.c
index 86193d9..2c9a0c2 100644
--- a/src/bin/dbus.c
+++ b/src/bin/dbus.c
@@ -13,8 +13,8 @@ _dbus_cfgfile_cb(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_M
13{ 13{
14 EDBus_Message *reply; 14 EDBus_Message *reply;
15 15
16 reply = edbus_message_method_return_new(msg); 16 reply = eldbus_message_method_return_new(msg);
17 edbus_message_arguments_append(reply, "s", erssd_eet_feed_cfgfile_get()); 17 eldbus_message_arguments_append(reply, "s", erssd_eet_feed_cfgfile_get());
18 return reply; 18 return reply;
19} 19}
20 20
@@ -23,8 +23,8 @@ _dbus_cachefile_cb(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus
23{ 23{
24 EDBus_Message *reply; 24 EDBus_Message *reply;
25 25
26 reply = edbus_message_method_return_new(msg); 26 reply = eldbus_message_method_return_new(msg);
27 edbus_message_arguments_append(reply, "s", erssd_eet_feed_cachefile_get()); 27 eldbus_message_arguments_append(reply, "s", erssd_eet_feed_cachefile_get());
28 return reply; 28 return reply;
29} 29}
30 30
@@ -37,8 +37,8 @@ _dbus_quit_cb(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_Mess
37 37
38static const EDBus_Method base_methods[] = 38static const EDBus_Method base_methods[] =
39{ 39{
40 { "FeedConfigFile", NULL, EDBUS_ARGS({"s", "Path to currently-used feed config file"}), _dbus_cfgfile_cb, 0}, 40 { "FeedConfigFile", NULL, ELDBUS_ARGS({"s", "Path to currently-used feed config file"}), _dbus_cfgfile_cb, 0},
41 { "FeedCacheFile", NULL, EDBUS_ARGS({"s", "Path to currently-used feed cache file"}), _dbus_cachefile_cb, 0}, 41 { "FeedCacheFile", NULL, ELDBUS_ARGS({"s", "Path to currently-used feed cache file"}), _dbus_cachefile_cb, 0},
42 { "Shutdown", NULL, NULL, _dbus_quit_cb, 0}, 42 { "Shutdown", NULL, NULL, _dbus_quit_cb, 0},
43 {NULL, NULL, NULL, NULL, 0} 43 {NULL, NULL, NULL, NULL, 0}
44}; 44};
@@ -56,19 +56,19 @@ _dbus_feed_add_cb(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_
56 EDBus_Message *reply; 56 EDBus_Message *reply;
57 const char *error_name, *error_text; 57 const char *error_name, *error_text;
58 58
59 if (edbus_message_error_get(msg, &error_name, &error_text)) 59 if (eldbus_message_error_get(msg, &error_name, &error_text))
60 { 60 {
61 ERR("%s: %s", error_name, error_text); 61 ERR("%s: %s", error_name, error_text);
62 goto error; 62 goto error;
63 } 63 }
64 if (!edbus_message_arguments_get(msg, "s", &url)) goto error; 64 if (!eldbus_message_arguments_get(msg, "s", &url)) goto error;
65 if ((!url) || (!url[0])) goto error; 65 if ((!url) || (!url[0])) goto error;
66 ret = erssd_feed_add_by_url(url); 66 ret = erssd_feed_add_by_url(url);
67 reply = edbus_message_method_return_new(msg); 67 reply = eldbus_message_method_return_new(msg);
68 edbus_message_arguments_append(reply, "b", ret); 68 eldbus_message_arguments_append(reply, "b", ret);
69 return reply; 69 return reply;
70error: 70error:
71 reply = edbus_message_error_new(msg, "org.erssd.error", "Ouch!"); 71 reply = eldbus_message_error_new(msg, "org.erssd.error", "Ouch!");
72 return reply; 72 return reply;
73} 73}
74 74
@@ -80,26 +80,26 @@ _dbus_feed_del_cb(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_
80 EDBus_Message *reply; 80 EDBus_Message *reply;
81 const char *error_name, *error_text; 81 const char *error_name, *error_text;
82 82
83 if (edbus_message_error_get(msg, &error_name, &error_text)) 83 if (eldbus_message_error_get(msg, &error_name, &error_text))
84 { 84 {
85 ERR("%s: %s", error_name, error_text); 85 ERR("%s: %s", error_name, error_text);
86 goto error; 86 goto error;
87 } 87 }
88 if (!edbus_message_arguments_get(msg, "s", &url)) goto error; 88 if (!eldbus_message_arguments_get(msg, "s", &url)) goto error;
89 if ((!url) || (!url[0])) goto error; 89 if ((!url) || (!url[0])) goto error;
90 ret = erssd_feed_del_by_url(url); 90 ret = erssd_feed_del_by_url(url);
91 reply = edbus_message_method_return_new(msg); 91 reply = eldbus_message_method_return_new(msg);
92 edbus_message_arguments_append(reply, "b", ret); 92 eldbus_message_arguments_append(reply, "b", ret);
93 return reply; 93 return reply;
94error: 94error:
95 reply = edbus_message_error_new(msg, "org.erssd.error", "Ouch!"); 95 reply = eldbus_message_error_new(msg, "org.erssd.error", "Ouch!");
96 return reply; 96 return reply;
97} 97}
98 98
99static Eina_Bool 99static Eina_Bool
100_dbus_feed_list_hasher(const Eina_Hash *h EINA_UNUSED, const char *key, void *data EINA_UNUSED, EDBus_Message_Iter *iter) 100_dbus_feed_list_hasher(const Eina_Hash *h EINA_UNUSED, const char *key, void *data EINA_UNUSED, EDBus_Message_Iter *iter)
101{ 101{
102 edbus_message_iter_basic_append(iter, 's', key); 102 eldbus_message_iter_basic_append(iter, 's', key);
103 return EINA_TRUE; 103 return EINA_TRUE;
104} 104}
105 105
@@ -109,11 +109,11 @@ _dbus_feed_list_cb(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus
109 EDBus_Message *reply; 109 EDBus_Message *reply;
110 EDBus_Message_Iter *iter, *array; 110 EDBus_Message_Iter *iter, *array;
111 111
112 reply = edbus_message_method_return_new(msg); 112 reply = eldbus_message_method_return_new(msg);
113 iter = edbus_message_iter_get(reply); 113 iter = eldbus_message_iter_get(reply);
114 array = edbus_message_iter_container_new(iter, 'a', "s"); 114 array = eldbus_message_iter_container_new(iter, 'a', "s");
115 eina_hash_foreach(erssd_feeds, (Eina_Hash_Foreach)_dbus_feed_list_hasher, array); 115 eina_hash_foreach(erssd_feeds, (Eina_Hash_Foreach)_dbus_feed_list_hasher, array);
116 edbus_message_iter_container_close(iter, array); 116 eldbus_message_iter_container_close(iter, array);
117 return reply; 117 return reply;
118} 118}
119 119
@@ -125,19 +125,19 @@ _dbus_feed_item_clear_read_cb(const EDBus_Service_Interface *iface EINA_UNUSED,
125 EDBus_Message *reply; 125 EDBus_Message *reply;
126 const char *error_name, *error_text; 126 const char *error_name, *error_text;
127 127
128 if (edbus_message_error_get(msg, &error_name, &error_text)) 128 if (eldbus_message_error_get(msg, &error_name, &error_text))
129 { 129 {
130 ERR("%s: %s", error_name, error_text); 130 ERR("%s: %s", error_name, error_text);
131 goto error; 131 goto error;
132 } 132 }
133 if (!edbus_message_arguments_get(msg, "s", &url)) goto error; 133 if (!eldbus_message_arguments_get(msg, "s", &url)) goto error;
134 if ((!url) || (!url[0])) goto error; 134 if ((!url) || (!url[0])) goto error;
135 feed = eina_hash_find(erssd_feeds, url); 135 feed = eina_hash_find(erssd_feeds, url);
136 if (!feed) goto error; 136 if (!feed) goto error;
137 erssd_feed_clear_read(feed); 137 erssd_feed_clear_read(feed);
138 return edbus_message_method_return_new(msg); 138 return eldbus_message_method_return_new(msg);
139error: 139error:
140 reply = edbus_message_error_new(msg, "org.erssd.error", "Ouch!"); 140 reply = eldbus_message_error_new(msg, "org.erssd.error", "Ouch!");
141 return reply; 141 return reply;
142} 142}
143 143
@@ -149,19 +149,19 @@ _dbus_feed_item_read_all_cb(const EDBus_Service_Interface *iface EINA_UNUSED, co
149 EDBus_Message *reply; 149 EDBus_Message *reply;
150 const char *error_name, *error_text; 150 const char *error_name, *error_text;
151 151
152 if (edbus_message_error_get(msg, &error_name, &error_text)) 152 if (eldbus_message_error_get(msg, &error_name, &error_text))
153 { 153 {
154 ERR("%s: %s", error_name, error_text); 154 ERR("%s: %s", error_name, error_text);
155 goto error; 155 goto error;
156 } 156 }
157 if (!edbus_message_arguments_get(msg, "s", &url)) goto error; 157 if (!eldbus_message_arguments_get(msg, "s", &url)) goto error;
158 if ((!url) || (!url[0])) goto error; 158 if ((!url) || (!url[0])) goto error;
159 feed = eina_hash_find(erssd_feeds, url); 159 feed = eina_hash_find(erssd_feeds, url);
160 if (!feed) goto error; 160 if (!feed) goto error;
161 erssd_feed_read(feed); 161 erssd_feed_read(feed);
162 return edbus_message_method_return_new(msg); 162 return eldbus_message_method_return_new(msg);
163error: 163error:
164 reply = edbus_message_error_new(msg, "org.erssd.error", "Ouch!"); 164 reply = eldbus_message_error_new(msg, "org.erssd.error", "Ouch!");
165 return reply; 165 return reply;
166} 166}
167 167
@@ -173,20 +173,20 @@ _dbus_feed_item_read_cb(const EDBus_Service_Interface *iface EINA_UNUSED, const
173 EDBus_Message *reply; 173 EDBus_Message *reply;
174 const char *error_name, *error_text; 174 const char *error_name, *error_text;
175 175
176 if (edbus_message_error_get(msg, &error_name, &error_text)) 176 if (eldbus_message_error_get(msg, &error_name, &error_text))
177 { 177 {
178 ERR("%s: %s", error_name, error_text); 178 ERR("%s: %s", error_name, error_text);
179 goto error; 179 goto error;
180 } 180 }
181 if (!edbus_message_arguments_get(msg, "ss", &url, &uuid)) goto error; 181 if (!eldbus_message_arguments_get(msg, "ss", &url, &uuid)) goto error;
182 if ((!url) || (!url[0])) goto error; 182 if ((!url) || (!url[0])) goto error;
183 if ((!uuid) || (!uuid[0])) goto error; 183 if ((!uuid) || (!uuid[0])) goto error;
184 feed = eina_hash_find(erssd_feeds, url); 184 feed = eina_hash_find(erssd_feeds, url);
185 if (!feed) goto error; 185 if (!feed) goto error;
186 if (erssd_feed_item_read_set(feed, uuid, EINA_TRUE)) 186 if (erssd_feed_item_read_set(feed, uuid, EINA_TRUE))
187 return edbus_message_method_return_new(msg); 187 return eldbus_message_method_return_new(msg);
188error: 188error:
189 reply = edbus_message_error_new(msg, "org.erssd.error", "Ouch!"); 189 reply = eldbus_message_error_new(msg, "org.erssd.error", "Ouch!");
190 return reply; 190 return reply;
191} 191}
192 192
@@ -198,32 +198,32 @@ _dbus_feed_item_unread_cb(const EDBus_Service_Interface *iface EINA_UNUSED, cons
198 EDBus_Message *reply; 198 EDBus_Message *reply;
199 const char *error_name, *error_text; 199 const char *error_name, *error_text;
200 200
201 if (edbus_message_error_get(msg, &error_name, &error_text)) 201 if (eldbus_message_error_get(msg, &error_name, &error_text))
202 { 202 {
203 ERR("%s: %s", error_name, error_text); 203 ERR("%s: %s", error_name, error_text);
204 goto error; 204 goto error;
205 } 205 }
206 if (!edbus_message_arguments_get(msg, "ss", &url, &uuid)) goto error; 206 if (!eldbus_message_arguments_get(msg, "ss", &url, &uuid)) goto error;
207 if ((!url) || (!url[0])) goto error; 207 if ((!url) || (!url[0])) goto error;
208 if ((!uuid) || (!uuid[0])) goto error; 208 if ((!uuid) || (!uuid[0])) goto error;
209 feed = eina_hash_find(erssd_feeds, url); 209 feed = eina_hash_find(erssd_feeds, url);
210 if (!feed) goto error; 210 if (!feed) goto error;
211 if (erssd_feed_item_read_set(feed, uuid, EINA_FALSE)) 211 if (erssd_feed_item_read_set(feed, uuid, EINA_FALSE))
212 return edbus_message_method_return_new(msg); 212 return eldbus_message_method_return_new(msg);
213error: 213error:
214 reply = edbus_message_error_new(msg, "org.erssd.error", "Ouch!"); 214 reply = eldbus_message_error_new(msg, "org.erssd.error", "Ouch!");
215 return reply; 215 return reply;
216} 216}
217 217
218static const EDBus_Method feed_methods[] = 218static const EDBus_Method feed_methods[] =
219{ 219{
220 { "Add", EDBUS_ARGS({"s", "url"}), EDBUS_ARGS({"b", "success"}), _dbus_feed_add_cb, 0}, 220 { "Add", ELDBUS_ARGS({"s", "url"}), ELDBUS_ARGS({"b", "success"}), _dbus_feed_add_cb, 0},
221 { "List", NULL, EDBUS_ARGS({"as", "urls"}), _dbus_feed_list_cb, 0}, 221 { "List", NULL, ELDBUS_ARGS({"as", "urls"}), _dbus_feed_list_cb, 0},
222 { "Del", EDBUS_ARGS({"s", "url"}), EDBUS_ARGS({"b", "success"}), _dbus_feed_del_cb, 0}, 222 { "Del", ELDBUS_ARGS({"s", "url"}), ELDBUS_ARGS({"b", "success"}), _dbus_feed_del_cb, 0},
223 { "ReadAll", EDBUS_ARGS({"s", "Feed URL"}), NULL, _dbus_feed_item_read_all_cb, 0}, 223 { "ReadAll", ELDBUS_ARGS({"s", "Feed URL"}), NULL, _dbus_feed_item_read_all_cb, 0},
224 { "ClearRead", EDBUS_ARGS({"s", "Feed URL"}), NULL, _dbus_feed_item_clear_read_cb, 0}, 224 { "ClearRead", ELDBUS_ARGS({"s", "Feed URL"}), NULL, _dbus_feed_item_clear_read_cb, 0},
225 { "ReadItem", EDBUS_ARGS({"s", "Feed URL"}, {"s", "uuid"}), NULL, _dbus_feed_item_read_cb, 0}, 225 { "ReadItem", ELDBUS_ARGS({"s", "Feed URL"}, {"s", "uuid"}), NULL, _dbus_feed_item_read_cb, 0},
226 { "UnreadItem", EDBUS_ARGS({"s", "Feed URL"}, {"s", "uuid"}), NULL, _dbus_feed_item_unread_cb, 0}, 226 { "UnreadItem", ELDBUS_ARGS({"s", "Feed URL"}, {"s", "uuid"}), NULL, _dbus_feed_item_unread_cb, 0},
227 {NULL, NULL, NULL, NULL, 0} 227 {NULL, NULL, NULL, NULL, 0}
228}; 228};
229 229
@@ -232,35 +232,35 @@ static const EDBus_Method feed_methods[] =
232 232
233static const EDBus_Signal feed_signals[] = 233static const EDBus_Signal feed_signals[] =
234{ 234{
235 [ERSSD_SIGNAL_FEED_ADD] = {"Add", EDBUS_ARGS({"s", "Feed URL"}), 0}, 235 [ERSSD_SIGNAL_FEED_ADD] = {"Add", ELDBUS_ARGS({"s", "Feed URL"}), 0},
236 [ERSSD_SIGNAL_FEED_DEL] = {"Del", EDBUS_ARGS({"s", "Feed URL"}), 0}, 236 [ERSSD_SIGNAL_FEED_DEL] = {"Del", ELDBUS_ARGS({"s", "Feed URL"}), 0},
237 [ERSSD_SIGNAL_FEED_UPDATED] = {"Updated", EDBUS_ARGS({"s", "Feed URL"}, {"u", "New item count"}), 0}, 237 [ERSSD_SIGNAL_FEED_UPDATED] = {"Updated", ELDBUS_ARGS({"s", "Feed URL"}, {"u", "New item count"}), 0},
238 [ERSSD_SIGNAL_FEED_ITEM_READ] = {"ItemRead", EDBUS_ARGS({"s", "Feed URL"}, {"s", "UUID for read item"}), 0}, 238 [ERSSD_SIGNAL_FEED_ITEM_READ] = {"ItemRead", ELDBUS_ARGS({"s", "Feed URL"}, {"s", "UUID for read item"}), 0},
239 {NULL, NULL, 0} 239 {NULL, NULL, 0}
240}; 240};
241 241
242void 242void
243erssd_dbus_signal_feed_add(const char *url) 243erssd_dbus_signal_feed_add(const char *url)
244{ 244{
245 edbus_service_signal_emit(erssd_feed_iface, ERSSD_SIGNAL_FEED_ADD, url); 245 eldbus_service_signal_emit(erssd_feed_iface, ERSSD_SIGNAL_FEED_ADD, url);
246} 246}
247 247
248void 248void
249erssd_dbus_signal_feed_del(const char *url) 249erssd_dbus_signal_feed_del(const char *url)
250{ 250{
251 edbus_service_signal_emit(erssd_feed_iface, ERSSD_SIGNAL_FEED_DEL, url); 251 eldbus_service_signal_emit(erssd_feed_iface, ERSSD_SIGNAL_FEED_DEL, url);
252} 252}
253 253
254void 254void
255erssd_dbus_signal_feed_item_read(const Rss_Feed *feed, const Azy_Rss_Item *item) 255erssd_dbus_signal_feed_item_read(const Rss_Feed *feed, const Azy_Rss_Item *item)
256{ 256{
257 edbus_service_signal_emit(erssd_feed_iface, ERSSD_SIGNAL_FEED_ITEM_READ, feed->url, azy_rss_item_uuid_get(item)); 257 eldbus_service_signal_emit(erssd_feed_iface, ERSSD_SIGNAL_FEED_ITEM_READ, feed->url, azy_rss_item_uuid_get(item));
258} 258}
259 259
260void 260void
261erssd_dbus_signal_feed_updated(const Rss_Feed *feed, unsigned int new_items) 261erssd_dbus_signal_feed_updated(const Rss_Feed *feed, unsigned int new_items)
262{ 262{
263 edbus_service_signal_emit(erssd_feed_iface, ERSSD_SIGNAL_FEED_UPDATED, feed->url, new_items); 263 eldbus_service_signal_emit(erssd_feed_iface, ERSSD_SIGNAL_FEED_UPDATED, feed->url, new_items);
264} 264}
265 265
266////////////// INIT /////////////////////////////// 266////////////// INIT ///////////////////////////////
@@ -273,19 +273,19 @@ static void
273_nameowned(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED) 273_nameowned(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
274{ 274{
275 unsigned int reply; 275 unsigned int reply;
276 if (edbus_message_error_get(msg, NULL, NULL)) 276 if (eldbus_message_error_get(msg, NULL, NULL))
277 { 277 {
278 ERR("name request fail!"); 278 ERR("name request fail!");
279 return; 279 return;
280 } 280 }
281 281
282 if (!edbus_message_arguments_get(msg, "u", &reply)) 282 if (!eldbus_message_arguments_get(msg, "u", &reply))
283 { 283 {
284 ERR("name request fail #2!"); 284 ERR("name request fail #2!");
285 return; 285 return;
286 } 286 }
287 287
288 if (reply != EDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER) 288 if (reply != ELDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER)
289 { 289 {
290 ERR("org.erssd already in use!"); 290 ERR("org.erssd already in use!");
291 return; 291 return;
@@ -297,29 +297,29 @@ erssd_dbus_init(void)
297{ 297{
298 EDBus_Service_Interface *iface; 298 EDBus_Service_Interface *iface;
299 299
300 if (!edbus_init()) return EINA_FALSE; 300 if (!eldbus_init()) return EINA_FALSE;
301 301
302 if (erssd_cf->system) 302 if (erssd_cf->system)
303 erssd_dbus_conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SYSTEM); 303 erssd_dbus_conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
304 else 304 else
305 erssd_dbus_conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SESSION); 305 erssd_dbus_conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
306 if (!erssd_dbus_conn) return EINA_FALSE; 306 if (!erssd_dbus_conn) return EINA_FALSE;
307 307
308 erssd_base_iface = iface = edbus_service_interface_register(erssd_dbus_conn, ERSSD_OBJECT, &base_desc); 308 erssd_base_iface = iface = eldbus_service_interface_register(erssd_dbus_conn, ERSSD_OBJECT, &base_desc);
309 edbus_name_request(erssd_dbus_conn, ERSSD_INTERFACE, EDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE, 309 eldbus_name_request(erssd_dbus_conn, ERSSD_INTERFACE, ELDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE,
310 _nameowned, iface); 310 _nameowned, iface);
311 311
312 if (!iface) return EINA_FALSE; 312 if (!iface) return EINA_FALSE;
313 313
314 erssd_feed_iface = edbus_service_interface_register(erssd_dbus_conn, ERSSD_OBJECT, &feed_desc); 314 erssd_feed_iface = eldbus_service_interface_register(erssd_dbus_conn, ERSSD_OBJECT, &feed_desc);
315 return EINA_TRUE; 315 return EINA_TRUE;
316} 316}
317 317
318void 318void
319erssd_dbus_shutdown(void) 319erssd_dbus_shutdown(void)
320{ 320{
321 if (erssd_dbus_conn) edbus_connection_unref(erssd_dbus_conn); 321 if (erssd_dbus_conn) eldbus_connection_unref(erssd_dbus_conn);
322 erssd_dbus_conn = NULL; 322 erssd_dbus_conn = NULL;
323 erssd_base_iface = NULL; 323 erssd_base_iface = NULL;
324 edbus_shutdown(); 324 eldbus_shutdown();
325} 325}
diff --git a/src/lib/erssd_dbus.c b/src/lib/erssd_dbus.c
index b5c4968..f3227bb 100644
--- a/src/lib/erssd_dbus.c
+++ b/src/lib/erssd_dbus.c
@@ -26,7 +26,7 @@ static const char *const signal_members[] =
26 [ERSSD_SIGNAL_FEED_ITEM_READ] = "ItemRead" 26 [ERSSD_SIGNAL_FEED_ITEM_READ] = "ItemRead"
27}; 27};
28 28
29static int conn_types[] = {EDBUS_CONNECTION_TYPE_SESSION, EDBUS_CONNECTION_TYPE_SYSTEM}; 29static int conn_types[] = {ELDBUS_CONNECTION_TYPE_SESSION, ELDBUS_CONNECTION_TYPE_SYSTEM};
30 30
31static EDBus_Connection *erssd_dbus_conn[2] = {NULL}; 31static EDBus_Connection *erssd_dbus_conn[2] = {NULL};
32 32
@@ -34,7 +34,7 @@ Eina_Bool
34_dbus_conn_setup(Eina_Bool system_bus) 34_dbus_conn_setup(Eina_Bool system_bus)
35{ 35{
36 if (!erssd_dbus_conn[system_bus]) 36 if (!erssd_dbus_conn[system_bus])
37 erssd_dbus_conn[system_bus] = edbus_connection_get(conn_types[system_bus]); 37 erssd_dbus_conn[system_bus] = eldbus_connection_get(conn_types[system_bus]);
38 return !!erssd_dbus_conn[system_bus]; 38 return !!erssd_dbus_conn[system_bus];
39} 39}
40 40
@@ -47,11 +47,11 @@ _dbus_string_return(void *data, const EDBus_Message *msg, EDBus_Pending *pending
47 Eina_Stringshare *s = NULL; 47 Eina_Stringshare *s = NULL;
48 const char *error_name, *error_text; 48 const char *error_name, *error_text;
49 49
50 if (edbus_message_error_get(msg, &error_name, &error_text)) 50 if (eldbus_message_error_get(msg, &error_name, &error_text))
51 { 51 {
52 ERR("%s: %s", error_name, error_text); 52 ERR("%s: %s", error_name, error_text);
53 } 53 }
54 else if (edbus_message_arguments_get(msg, "s", &str)) 54 else if (eldbus_message_arguments_get(msg, "s", &str))
55 s = eina_stringshare_add(str); 55 s = eina_stringshare_add(str);
56 cb = cbd->cb; 56 cb = cbd->cb;
57 cb(cbd->data, s); 57 cb(cbd->data, s);
@@ -68,15 +68,15 @@ _dbus_stringlist_return(void *data, const EDBus_Message *msg, EDBus_Pending *pen
68 char *str; 68 char *str;
69 const char *error_name, *error_text; 69 const char *error_name, *error_text;
70 70
71 if (edbus_message_error_get(msg, &error_name, &error_text)) 71 if (eldbus_message_error_get(msg, &error_name, &error_text))
72 { 72 {
73 ERR("%s: %s", error_name, error_text); 73 ERR("%s: %s", error_name, error_text);
74 } 74 }
75 else if (!edbus_message_arguments_get(msg, "as", &array)) 75 else if (!eldbus_message_arguments_get(msg, "as", &array))
76 ERR("args"); 76 ERR("args");
77 else 77 else
78 { 78 {
79 while (edbus_message_iter_get_and_next(array, 's', &str)) 79 while (eldbus_message_iter_get_and_next(array, 's', &str))
80 ret = eina_list_append(ret, eina_stringshare_add(str)); 80 ret = eina_list_append(ret, eina_stringshare_add(str));
81 } 81 }
82 82
@@ -95,11 +95,11 @@ _dbus_bool_return(void *data, const EDBus_Message *msg, EDBus_Pending *pending E
95 Eina_Bool b = EINA_FALSE; 95 Eina_Bool b = EINA_FALSE;
96 const char *error_name, *error_text; 96 const char *error_name, *error_text;
97 97
98 if (edbus_message_error_get(msg, &error_name, &error_text)) 98 if (eldbus_message_error_get(msg, &error_name, &error_text))
99 { 99 {
100 ERR("%s: %s", error_name, error_text); 100 ERR("%s: %s", error_name, error_text);
101 } 101 }
102 else if (!edbus_message_arguments_get(msg, "b", &b)) 102 else if (!eldbus_message_arguments_get(msg, "b", &b))
103 ERR("arg fetching"); 103 ERR("arg fetching");
104 cb = cbd->cb; 104 cb = cbd->cb;
105 if (cb) cb(cbd->data, b); 105 if (cb) cb(cbd->data, b);
@@ -113,7 +113,7 @@ _dbus_void_return(void *data, const EDBus_Message *msg, EDBus_Pending *pending E
113 Erssd_Util_Void_Cb cb; 113 Erssd_Util_Void_Cb cb;
114 const char *error_name, *error_text; 114 const char *error_name, *error_text;
115 115
116 if (edbus_message_error_get(msg, &error_name, &error_text)) 116 if (eldbus_message_error_get(msg, &error_name, &error_text))
117 { 117 {
118 ERR("%s: %s", error_name, error_text); 118 ERR("%s: %s", error_name, error_text);
119 } 119 }
@@ -130,7 +130,7 @@ _dbus_signal_feed_add(void *data, const EDBus_Message *msg)
130 CB_Data *cbd = data; 130 CB_Data *cbd = data;
131 Erssd_Util_Data_Cb cb; 131 Erssd_Util_Data_Cb cb;
132 132
133 if (edbus_message_arguments_get(msg, "s", &url)) 133 if (eldbus_message_arguments_get(msg, "s", &url))
134 s = eina_stringshare_add(url); 134 s = eina_stringshare_add(url);
135 135
136 cb = cbd->cb; 136 cb = cbd->cb;
@@ -146,7 +146,7 @@ _dbus_signal_feed_del(void *data, const EDBus_Message *msg)
146 CB_Data *cbd = data; 146 CB_Data *cbd = data;
147 Erssd_Util_Data_Cb cb; 147 Erssd_Util_Data_Cb cb;
148 148
149 if (edbus_message_arguments_get(msg, "s", &url)) 149 if (eldbus_message_arguments_get(msg, "s", &url))
150 s = eina_stringshare_add(url); 150 s = eina_stringshare_add(url);
151 151
152 cb = cbd->cb; 152 cb = cbd->cb;
@@ -163,7 +163,7 @@ _dbus_signal_feed_updated(void *data, const EDBus_Message *msg)
163 CB_Data *cbd = data; 163 CB_Data *cbd = data;
164 Erssd_Util_Data_Cb cb; 164 Erssd_Util_Data_Cb cb;
165 165
166 if (edbus_message_arguments_get(msg, "su", &url, &u)) 166 if (eldbus_message_arguments_get(msg, "su", &url, &u))
167 s = eina_stringshare_add(url); 167 s = eina_stringshare_add(url);
168 168
169 cb = cbd->cb; 169 cb = cbd->cb;
@@ -179,7 +179,7 @@ _dbus_signal_feed_item_read(void *data, const EDBus_Message *msg)
179 CB_Data *cbd = data; 179 CB_Data *cbd = data;
180 Erssd_Util_Data_Cb cb; 180 Erssd_Util_Data_Cb cb;
181 181
182 if (edbus_message_arguments_get(msg, "ss", &url, &uuid)) 182 if (eldbus_message_arguments_get(msg, "ss", &url, &uuid))
183 { 183 {
184 s = eina_stringshare_add(url); 184 s = eina_stringshare_add(url);
185 ss = eina_stringshare_add(uuid); 185 ss = eina_stringshare_add(uuid);
@@ -200,12 +200,12 @@ _dbus_call_helper(Eina_Bool system_bus, const char *method, void *cb, const void
200 200
201 EINA_SAFETY_ON_TRUE_RETURN_VAL(!_dbus_conn_setup(system_bus), EINA_FALSE); 201 EINA_SAFETY_ON_TRUE_RETURN_VAL(!_dbus_conn_setup(system_bus), EINA_FALSE);
202 202
203 msg = edbus_message_method_call_new(ERSSD_BUS, ERSSD_OBJECT, ERSSD_INTERFACE, method); 203 msg = eldbus_message_method_call_new(ERSSD_BUS, ERSSD_OBJECT, ERSSD_INTERFACE, method);
204 EINA_SAFETY_ON_NULL_RETURN_VAL(msg, EINA_FALSE); 204 EINA_SAFETY_ON_NULL_RETURN_VAL(msg, EINA_FALSE);
205 cbd = malloc(sizeof(CB_Data)); 205 cbd = malloc(sizeof(CB_Data));
206 cbd->cb = cb; 206 cbd->cb = cb;
207 cbd->data = (void*)data; 207 cbd->data = (void*)data;
208 ret = !!edbus_connection_send(erssd_dbus_conn[system_bus], msg, retcb, cbd, -1); 208 ret = !!eldbus_connection_send(erssd_dbus_conn[system_bus], msg, retcb, cbd, -1);
209 if (!ret) free(cbd); 209 if (!ret) free(cbd);
210 return ret; 210 return ret;
211} 211}
@@ -223,14 +223,14 @@ _dbus_feed_call_helper(Eina_Bool system_bus, const char *method, const char *fee
223 } 223 }
224 EINA_SAFETY_ON_TRUE_RETURN_VAL(!_dbus_conn_setup(system_bus), EINA_FALSE); 224 EINA_SAFETY_ON_TRUE_RETURN_VAL(!_dbus_conn_setup(system_bus), EINA_FALSE);
225 225
226 msg = edbus_message_method_call_new(ERSSD_BUS, ERSSD_OBJECT, ERSSD_FEED_INTERFACE, method); 226 msg = eldbus_message_method_call_new(ERSSD_BUS, ERSSD_OBJECT, ERSSD_FEED_INTERFACE, method);
227 EINA_SAFETY_ON_NULL_RETURN_VAL(msg, EINA_FALSE); 227 EINA_SAFETY_ON_NULL_RETURN_VAL(msg, EINA_FALSE);
228 if (feed_url) 228 if (feed_url)
229 edbus_message_arguments_append(msg, "s", feed_url); 229 eldbus_message_arguments_append(msg, "s", feed_url);
230 cbd = malloc(sizeof(CB_Data)); 230 cbd = malloc(sizeof(CB_Data));
231 cbd->cb = cb; 231 cbd->cb = cb;
232 cbd->data = (void*)data; 232 cbd->data = (void*)data;
233 ret = !!edbus_connection_send(erssd_dbus_conn[system_bus], msg, retcb, cbd, -1); 233 ret = !!eldbus_connection_send(erssd_dbus_conn[system_bus], msg, retcb, cbd, -1);
234 if (!ret) free(cbd); 234 if (!ret) free(cbd);
235 return ret; 235 return ret;
236} 236}
@@ -246,14 +246,14 @@ _dbus_feed_item_call_helper(Eina_Bool system_bus, const char *method, const char
246 EINA_SAFETY_ON_NULL_RETURN_VAL(item_uuid, EINA_FALSE); 246 EINA_SAFETY_ON_NULL_RETURN_VAL(item_uuid, EINA_FALSE);
247 EINA_SAFETY_ON_TRUE_RETURN_VAL(!_dbus_conn_setup(system_bus), EINA_FALSE); 247 EINA_SAFETY_ON_TRUE_RETURN_VAL(!_dbus_conn_setup(system_bus), EINA_FALSE);
248 248
249 msg = edbus_message_method_call_new(ERSSD_BUS, ERSSD_OBJECT, ERSSD_FEED_INTERFACE, method); 249 msg = eldbus_message_method_call_new(ERSSD_BUS, ERSSD_OBJECT, ERSSD_FEED_INTERFACE, method);
250 250
251 edbus_message_arguments_append(msg, "ss", feed_url, item_uuid); 251 eldbus_message_arguments_append(msg, "ss", feed_url, item_uuid);
252 EINA_SAFETY_ON_NULL_RETURN_VAL(msg, EINA_FALSE); 252 EINA_SAFETY_ON_NULL_RETURN_VAL(msg, EINA_FALSE);
253 cbd = malloc(sizeof(CB_Data)); 253 cbd = malloc(sizeof(CB_Data));
254 cbd->cb = cb; 254 cbd->cb = cb;
255 cbd->data = (void*)data; 255 cbd->data = (void*)data;
256 ret = !!edbus_connection_send(erssd_dbus_conn[system_bus], msg, retcb, cbd, -1); 256 ret = !!eldbus_connection_send(erssd_dbus_conn[system_bus], msg, retcb, cbd, -1);
257 if (!ret) free(cbd); 257 if (!ret) free(cbd);
258 return ret; 258 return ret;
259} 259}
@@ -272,7 +272,7 @@ _dbus_nameowner_cb(void *data, const char *bus EINA_UNUSED, const char *old EINA
272Eina_Bool 272Eina_Bool
273erssd_util_dbus_init(void) 273erssd_util_dbus_init(void)
274{ 274{
275 if (!edbus_init()) return EINA_FALSE; 275 if (!eldbus_init()) return EINA_FALSE;
276 276
277 return EINA_TRUE; 277 return EINA_TRUE;
278} 278}
@@ -285,7 +285,7 @@ erssd_util_dbus_shutdown(void)
285 for (x = 0; x < 2; x++) 285 for (x = 0; x < 2; x++)
286 { 286 {
287 if (erssd_dbus_conn[x]) 287 if (erssd_dbus_conn[x])
288 edbus_connection_unref(erssd_dbus_conn[x]); 288 eldbus_connection_unref(erssd_dbus_conn[x]);
289 erssd_dbus_conn[x] = NULL; 289 erssd_dbus_conn[x] = NULL;
290 nameowner[x].cb = NULL; 290 nameowner[x].cb = NULL;
291 nameowner[x].data = NULL; 291 nameowner[x].data = NULL;
@@ -299,7 +299,7 @@ erssd_util_dbus_shutdown(void)
299 callbacks[x][y].data = NULL; 299 callbacks[x][y].data = NULL;
300 } 300 }
301 } 301 }
302 edbus_shutdown(); 302 eldbus_shutdown();
303} 303}
304 304
305///////////////////////////////////////////////////////////// 305/////////////////////////////////////////////////////////////
@@ -372,7 +372,7 @@ erssd_util_nameowner_cb_set(Eina_Bool system_bus, Erssd_Util_Data_Cb cb, const v
372 EINA_SAFETY_ON_NULL_RETURN(cb); 372 EINA_SAFETY_ON_NULL_RETURN(cb);
373 EINA_SAFETY_ON_TRUE_RETURN(!_dbus_conn_setup(system_bus)); 373 EINA_SAFETY_ON_TRUE_RETURN(!_dbus_conn_setup(system_bus));
374 if (!nameowner[system_bus].cb) 374 if (!nameowner[system_bus].cb)
375 edbus_name_owner_changed_callback_add(erssd_dbus_conn[system_bus], ERSSD_BUS, _dbus_nameowner_cb, &nameowner[system_bus], EINA_TRUE); 375 eldbus_name_owner_changed_callback_add(erssd_dbus_conn[system_bus], ERSSD_BUS, _dbus_nameowner_cb, &nameowner[system_bus], EINA_TRUE);
376 nameowner[system_bus].cb = cb, nameowner[system_bus].data = (void*)data; 376 nameowner[system_bus].cb = cb, nameowner[system_bus].data = (void*)data;
377} 377}
378 378
@@ -400,9 +400,9 @@ erssd_util_feed_signal_cb_set(Eina_Bool system_bus, Erssd_Signals signal, Erssd_
400 break; 400 break;
401 default: break; 401 default: break;
402 } 402 }
403 if (handlers[signal][system_bus]) edbus_signal_handler_unref(handlers[signal][system_bus]); 403 if (handlers[signal][system_bus]) eldbus_signal_handler_unref(handlers[signal][system_bus]);
404 callbacks[signal][system_bus].cb = cb; 404 callbacks[signal][system_bus].cb = cb;
405 callbacks[signal][system_bus].data = (void*)data; 405 callbacks[signal][system_bus].data = (void*)data;
406 handlers[signal][system_bus] = edbus_signal_handler_add(erssd_dbus_conn[system_bus], 406 handlers[signal][system_bus] = eldbus_signal_handler_add(erssd_dbus_conn[system_bus],
407 ERSSD_BUS, ERSSD_OBJECT, ERSSD_FEED_INTERFACE, signal_members[signal], sig_cb, &callbacks[signal][system_bus]); 407 ERSSD_BUS, ERSSD_OBJECT, ERSSD_FEED_INTERFACE, signal_members[signal], sig_cb, &callbacks[signal][system_bus]);
408} 408}
diff --git a/src/lib/erssd_lib.c b/src/lib/erssd_lib.c
index 78f35a7..54617d7 100644
--- a/src/lib/erssd_lib.c
+++ b/src/lib/erssd_lib.c
@@ -13,10 +13,10 @@ erssd_util_init(void)
13 EINA_SAFETY_ON_TRUE_GOTO(erssd_util_log_dom < 0, eina_fail); 13 EINA_SAFETY_ON_TRUE_GOTO(erssd_util_log_dom < 0, eina_fail);
14 14
15 EINA_SAFETY_ON_TRUE_GOTO(!erssd_util_eet_init(), eet_fail); 15 EINA_SAFETY_ON_TRUE_GOTO(!erssd_util_eet_init(), eet_fail);
16 EINA_SAFETY_ON_TRUE_GOTO(!erssd_util_dbus_init(), edbus_fail); 16 EINA_SAFETY_ON_TRUE_GOTO(!erssd_util_dbus_init(), eldbus_fail);
17 17
18 return _erssd_init_count; 18 return _erssd_init_count;
19edbus_fail: 19eldbus_fail:
20 erssd_util_eet_shutdown(); 20 erssd_util_eet_shutdown();
21eet_fail: 21eet_fail:
22 eina_log_domain_unregister(erssd_util_log_dom); 22 eina_log_domain_unregister(erssd_util_log_dom);
diff --git a/src/lib/erssd_private.h b/src/lib/erssd_private.h
index adc43aa..ae935ca 100644
--- a/src/lib/erssd_private.h
+++ b/src/lib/erssd_private.h
@@ -2,7 +2,7 @@
2#define ERSSD_PRIVATE_H 2#define ERSSD_PRIVATE_H
3 3
4#include "Erssd.h" 4#include "Erssd.h"
5#include <EDBus.h> 5#include <Eldbus.h>
6#include <ctype.h> 6#include <ctype.h>
7 7
8/* this is the filename which we save feed configs to */ 8/* this is the filename which we save feed configs to */