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


Hello Caolan, Tor,

I've done some research and I've more or less understood how it works now.

Now, with Avahi, I am supposed to use dlsym to import several functions
from libavahi-client.so.3 and libavahi-common.so.3 during the runtime.
However, the dlsym should return a pointer to the function which, in order
to be used, need to be casted with correct return type/argument types. The
problem is, these types are declared in the shared object and I still don't
have access to them.

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<http://avahi.org/download/doxygen/client_8h.html#a3d65e9ea7182c44fa8df04a72f1a56bb>
* 
avahi_client_new<http://avahi.org/download/doxygen/client_8h.html#a07b2a33a3e7cbb18a0eb9d00eade6ae6>
(const AvahiPoll <http://avahi.org/download/doxygen/struct_avahi_poll.html>
 * poll_api, 
AvahiClientFlags<http://avahi.org/download/doxygen/client_8h.html#a46a797e5d352f6f98261834ae3b1a3ed>
  
flags,AvahiClientCallback<http://avahi.org/download/doxygen/client_8h.html#a24ece0cd8c27c269a1ddd3cf3acf6444>
  callback,void * userdata, int * error  )

Am I on the right track ? Any help or link to some tutorials would be
appreciated!

Thanks!
Siqi


On Thu, Jan 9, 2014 at 4:57 PM, Caolán McNamara <caolanm@redhat.com> wrote:

On Tue, 2014-01-07 at 15:31 +0100, Siqi Liu wrote:
Tor pushed a quick fix for that and disabled avahi temporarily so that
it doesn't get compiled unless specified. I'm thinking of fixing that
but not sure how to load Avahi dynamically depending on the presence
of Avahi library on the distribution.

Any pointers on how to achieve that?

We've done stuff like this plenty of times in the past. One current one
is sc/source/core/opencl/clcc.cxx see the dlopen, dlsym hackery.

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.