Commit Graph

22 Commits

Author SHA1 Message Date
Carsten Haitzler 39b48ca430 Revert "fix warnings about redefinting EWAPI etc. due to windows EAPI changes"
This reverts commit e2d6691d52.
This reverts commit c02b796fdb.
This reverts commit 6c969f6b7d.
This reverts commit 74204bccd7.
This reverts commit 1304d95717.
This reverts commit 7c85be9674.

revert the EAPI changes that break cxx bindings build. sorry :( more
fixes needed than i thought
2021-05-26 15:46:25 +01:00
Felipe Magno de Almeida 1304d95717 eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library
Summary:
=  The Rationale =

EAPI was designed to be able to pass
`__attribute__ ((visibility ("default")))` for symbols with
GCC, which would mean that even if -fvisibility=hidden was used
when compiling the library, the needed symbols would get exported.

MSVC __almost__ works like GCC (or mingw) in which you can
declare everything as export and it will just work (slower, but
it will work). But there's a caveat: global variables will not
work the same way for MSVC, but works for mingw and GCC.

For global variables (as opposed to functions), MSVC requires
correct DSO visibility for MSVC: instead of declaring a symbol as
export for everything, you need to declare it as import when
importing from another DSO and export when defining it locally.

With current EAPI definitions, we get the following example
working in mingw and MSVC (observe it doesn't define any global
variables as exported symbols).

Example 1:
dll1:
```
EAPI void foo(void);

EAPI void bar()
{
  foo();
}
```
dll2:
```
EAPI void foo()
{
  printf ("foo\n");
}
```

This works fine with API defined as __declspec(dllexport) in both
cases and for gcc defining as
`__atttribute__((visibility("default")))`.

However, the following:
Example 2:

dll1:

```
EAPI extern int foo;
EAPI void foobar(void);

EAPI void bar()
{
  foo = 5;
  foobar();
}
```

dll2:

```
EAPI int foo = 0;
EAPI void foobar()
{
  printf ("foo %d\n", foo);
}
```

This will work on mingw but will not work for MSVC. And that's why
EAPI is the only solution that worked for MSVC.

Co-authored-by: João Paulo Taylor Ienczak Zanette <jpaulotiz@gmail.com>
Co-authored-by: Ricardo Campos <ricardo.campos@expertise.dev>
Co-authored-by: Lucas Cavalcante de Sousa <lucks.sousa@gmail.com>

Reviewers: vtorri, raster

Subscribers: raster, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12270
2021-05-23 20:47:13 +01:00
junsu choi 65be14db24 eldbus_proxy: Prevent dangling pointer. 2019-09-06 11:25:22 +09:00
Mike Blumenkrantz dded40c73b eldbus: don't print warnings for user-canceled calls
Summary:
these are intentionally canceled and not something to be concerned with

@fix
Depends on D8974

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8976
2019-05-29 12:29:04 -04:00
Carsten Haitzler 3de08599bf eldbus lower error print levesl from ER to WRN in get all props
this is generally unnecessary noise as the majority of the time i see
this it's because the message was canceled by the caller... thats not
an error though then... it's intended. less debug noise to sift through.
2017-07-30 23:04:35 +09:00
Mike Blumenkrantz 2444e127dd eldbus: add more debug prints for proxy and signal handler 2016-02-13 11:26:03 -05:00
Guilherme Lepsch 10fa1b5b4b eldbus: add efl.model implementation.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-10 12:02:30 -08:00
Guilherme Lepsch ef6456c541 eldbus: refactoring code.
Summary:
Code smells: Don't Repeat Yourself

Depends on D1927

Reviewers: felipealmeida, larryolj, cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1928

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-09 22:03:19 +01:00
Guilherme Lepsch c5c70e54fc eldbus: eina_value not allocated from mempool.
Summary: Eina_Value must be allocated with eina_value_new() to be freed by eina_value_free().
@fix

Reviewers: felipealmeida, larryolj, cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1927

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-05 15:37:15 +01:00
José Roberto de Souza 63abe9b00c eldbus: Fix crash when removing the last reference of the message container inside of the message callback
If user try to remove the last reference of proxy, object, connection
or eldbus(lib) inside of message callback it was causing the
eldbus_pending_dispatch() being called 2 times, one because of the
eldbus_cancel() that is triggered when the last reference of the
message parent is removed and another after the return of the user
callback.

==6545== Invalid read of size 8
==6545==    at 0x52F784E: eldbus_cbs_free_dispatch (eldbus_core.c:266)
==6545==    by 0x53064AA: eldbus_pending_dispatch (eldbus_pending.c:227)
==6545==    by 0x5305961: cb_pending (eldbus_pending.c:74)
==6545==    by 0x6B29DB1: ??? (in /usr/lib/libdbus-1.so.3.8.9)
==6545==    by 0x6B2D280: dbus_connection_dispatch (in /usr/lib/libdbus-1.so.3.8.9)
==6545==    by 0x52F93B4: eldbus_idler (eldbus_core.c:773)
==6545==    by 0x4E4B300: _ecore_call_task_cb (ecore_private.h:305)
==6545==    by 0x4E4B78F: _ecore_idler_all_call (ecore_idler.c:143)
==6545==    by 0x4E4EA73: _ecore_main_loop_spin_core (ecore_main.c:1768)
==6545==    by 0x4E4EAF1: _ecore_main_loop_spin_timers (ecore_main.c:1802)
==6545==    by 0x4E4ED01: _ecore_main_loop_iterate_internal (ecore_main.c:1925)
==6545==    by 0x4E4D03B: ecore_main_loop_begin (ecore_main.c:983)
==6545==  Address 0x701aa78 is 104 bytes inside a block of size 128 free'd
==6545==    at 0x4C2B200: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6545==    by 0x530655B: eldbus_pending_dispatch (eldbus_pending.c:241)
==6545==    by 0x5306763: eldbus_pending_cancel (eldbus_pending.c:259)
==6545==    by 0x52F29DB: _eldbus_proxy_clear (eldbus_proxy.c:146)
==6545==    by 0x52F3057: _eldbus_proxy_unref (eldbus_proxy.c:244)
==6545==    by 0x52F3393: eldbus_proxy_unref (eldbus_proxy.c:264)
==6545==    by 0x401039: on_get_playlists (banshee.c:53)
==6545==    by 0x5306493: eldbus_pending_dispatch (eldbus_pending.c:225)
==6545==    by 0x5305961: cb_pending (eldbus_pending.c:74)
==6545==    by 0x6B29DB1: ??? (in /usr/lib/libdbus-1.so.3.8.9)
==6545==    by 0x6B2D280: dbus_connection_dispatch (in /usr/lib/libdbus-1.so.3.8.9)
==6545==    by 0x52F93B4: eldbus_idler (eldbus_core.c:773)

Now we will remove the pending from parent pending list before
call the user callback, this way only the pending messages will
be canceled.

Also we need increase the eldbus reference before call
dbus_connection_dispatch() or user could remove the last reference of
eldbus inside of a message callback when we still are
holding one reference of the connection.

@fix
ref T1908
2014-12-17 17:05:35 -02:00
José Roberto de Souza b9c1dfdf03 eldbus: Add timeout parameter to eldbus_proxy_send_and_block()
As all other send functions have, we need to have here.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-05 09:53:08 -05:00
Chris Michael e62dfdd79e eldbus: Add actual API function code for eldbus_proxy_send_and_block
Summary: This adds the actual code to send a dbus message and block
while waiting for a reply.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-04 09:49:02 -05:00
Wonguk Jeong f796679af6 eldbus: do not ignore numeric "0" in property_set
"0" value was considered to be error even if signature was numeric

@fix
2014-08-10 22:55:38 +02:00
Daniel Juyung Seo 76d8532b54 efl: Unified eina critical manro to CRI.
Being annoyed by different types of eina critical macros - CRI, CRIT,
 CRITICAL -, I concluded to unify them to one. Discussed on IRC and
 finally, CRI was chosen to meet the consistency with other macros -
 ERR, WRN, INF, DBG - in terms of the number of characters.
If there is any missing bits, please let me know.
2013-12-26 12:27:13 +09:00
José Roberto de Souza 64687356b0 eldbus: Fix crash caused when the object of an monitored proxy is deleted
This happen because proxy was already freed and we try print some information
about the proxy in error message.

This fix: https://phab.enlightenment.org/T543
2013-11-29 17:21:14 -02:00
José Roberto de Souza b25fd77827 Revert "workaround for T543"
This reverts commit b663b5b8c7.
2013-11-29 16:39:10 -02:00
Mike Blumenkrantz b663b5b8c7 workaround for T543
this prevents crashing in efm:u2, but is really bad and needs to be fixed more competently before release
2013-11-21 14:44:43 -05:00
José Roberto de Souza 928f0e4f83 eldbus: Make properties_monitor() return a boolean indicating if props are already cached 2013-09-02 16:14:47 -03:00
José Roberto de Souza 8b69231897 eldbus: Add a new proxy event to notify when properties are cached 2013-09-02 16:14:43 -03:00
José Roberto de Souza cbd0ccbbbe eldbus: Check if property_get_all() returned a error before read properties 2013-07-25 14:22:40 -03:00
Mike Blumenkrantz 5ca64106a2 more descriptive error message in eldbus when property fetching fails 2013-06-20 08:13:55 +01:00
Lucas De Marchi 4e3804041f Rename edbus->eldbus
git grep -l edbus2 | while read f; do sed -i 's/edbus2/eldbus/g' "$f"; done
find . -name '*edbus2*' -exec rename edbus2 eldbus {} \;

git grep -l "EDBUS" | while read f; do sed -i 's/EDBUS/ELDBUS/g' "$f"; done
git grep -l "EDBus" | while read f; do sed -i 's/EDBus/Eldbus/g' "$f"; done
git grep -l "edbus (v2)" | while read f; do sed -i 's/edbus (v2)/eldbus/g' "$f"; done
git grep -l "Edbus" | while read f; do sed -i 's/Edbus/Eldbus/g' "$f"; done
git grep -l "edbus" | while read f; do sed -i 's/edbus/eldbus/g' "$f"; done

find . -name '*edbus*' -exec rename edbus eldbus {} \;
find . -name '*EDBus*' -exec rename EDBus Eldbus {} \;
2013-04-23 12:36:29 -03:00