Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index


Hello,

The code using avahi_client_new is already in LibreOffice (I've pushed it
during last summer).

I've tried to make a separate version of that same code broadcasting a
_impressremote._tcp service alone. Even though the code compiles fine using
dlopen, it does get an error code that I've never encountered before... In
theory avahi.cxx will broadcast avahi service in a event loop thread, does
dlopen change anything with respect to that? Also, internally avahi is
based on dbus, not sure if that has anything to do with the issue.

For now, the problem is that the service can not get committed
using avahi_entry_group_commit().

I've attached the code if you have some time to check if I've used dlopen
correctly.


The command that I've used to compile it is as follow

g++ avahi.cxx -I/usr/include/dbus-1.0 \
           -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include \
           -I/usr/include/glib-2.0 \
           -I/usr/lib/x86_64-linux-gnu/glib-2.0/include/ \
           -ldbus-1 \
           -ldbus-glib-1 \
           -lavahi-glib -lavahi-common -lavahi-core -lavahi-client -ldl


Thanks!
Siqi


On Wed, Jan 29, 2014 at 12:09 PM, Caolán McNamara <caolanm@redhat.com>wrote:

On Fri, 2014-01-24 at 22:51 +0100, Siqi Liu wrote:

For example, I can dlsym this function and get the void * to it, but
how can I use it if I don't have access to the struct AvahiClient
(declaired in the shared object)?
AvahiClient* avahi_client_new
(
const AvahiPoll *
poll_api,


AvahiClientFlags
flags,


AvahiClientCallback
callback,


void *
userdata,


int *
error



Well, it depends on usage if you can get away with including the
headers. e.g. if you just need to manipulate the returned thing through
a pointer to it and dlsymed functions then you can just shove e.g.
typedef struct _AvahiClient AvahiClient;
into your .cxx and that'll work.

e.g. see vcl/unx/gtk/window/xid_fullscreen_on_all_monitors.c for an
example

Is the code using avahi_client_new that you want to make runtime
optional already in LibreOffice or is it new code you want to add ?

C.




-- 
--------

Cordialement,
Siqi LIU

Étudiant Ingénieur, 1ère année
École Supérieur d'Électricité (Supélec)

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.