<div dir="ltr">Hello Caolan, Tor, <div><br></div><div>I've done some research and I've more or less understood how it works now. </div><div><br></div><div>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. </div>
<div><br></div><div>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)?</div><table class="" style="font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif;font-size:13px;line-height:1.3;white-space:nowrap;font-weight:bold;margin-left:6px">
<tbody><tr><td class="" style="margin-left:6px"><a class="" href="http://avahi.org/download/doxygen/client_8h.html#a3d65e9ea7182c44fa8df04a72f1a56bb" style="color:rgb(70,101,162)">AvahiClient</a>* <a class="" href="http://avahi.org/download/doxygen/client_8h.html#a07b2a33a3e7cbb18a0eb9d00eade6ae6" style="color:rgb(70,101,162)">avahi_client_new</a></td>
<td>(</td><td class="">const <a class="" href="http://avahi.org/download/doxygen/struct_avahi_poll.html" style="color:rgb(70,101,162)">AvahiPoll</a> * </td><td class="" style="color:rgb(96,32,32)">poll_api,</td></tr><tr>
<td class="" style="text-align:right">
</td><td></td><td class=""><a class="" href="http://avahi.org/download/doxygen/client_8h.html#a46a797e5d352f6f98261834ae3b1a3ed" style="color:rgb(70,101,162)">AvahiClientFlags</a> </td><td class="" style="color:rgb(96,32,32)">
flags,</td></tr><tr><td class="" style="text-align:right"></td><td></td><td class=""><a class="" href="http://avahi.org/download/doxygen/client_8h.html#a24ece0cd8c27c269a1ddd3cf3acf6444" style="color:rgb(70,101,162)">AvahiClientCallback</a> </td>
<td class="" style="color:rgb(96,32,32)">callback,</td></tr><tr><td class="" style="text-align:right"></td><td></td><td class="">void * </td><td class="" style="color:rgb(96,32,32)">userdata,</td></tr><tr><td class="" style="text-align:right">
</td><td></td><td class="">int * </td><td class="" style="color:rgb(96,32,32)">error </td></tr><tr><td style="color:rgb(37,53,85);font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif;background-color:rgb(226,232,242)">
</td><td style="color:rgb(37,53,85);font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif;background-color:rgb(226,232,242)">)<br></td></tr></tbody></table><div> </div><div>Am I on the right track ? Any help or link to some tutorials would be appreciated!</div>
<div><br></div><div>Thanks!</div><div>Siqi</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 9, 2014 at 4:57 PM, Caolán McNamara <span dir="ltr"><<a href="mailto:caolanm@redhat.com" target="_blank">caolanm@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tue, 2014-01-07 at 15:31 +0100, Siqi Liu wrote:<br>
> Tor pushed a quick fix for that and disabled avahi temporarily so that<br>
> it doesn't get compiled unless specified. I'm thinking of fixing that<br>
> but not sure how to load Avahi dynamically depending on the presence<br>
> of Avahi library on the distribution.<br>
><br>
> Any pointers on how to achieve that?<br>
<br>
</div>We've done stuff like this plenty of times in the past. One current one<br>
is sc/source/core/opencl/clcc.cxx see the dlopen, dlsym hackery.<br>
<span class="HOEnZb"><font color="#888888"><br>
C.<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>--------</div><div><br></div><div>Cordialement,</div>Siqi LIU<div><br><div>Étudiant Ingénieur, 1ère année</div><div>École Supérieur d'Électricité (Supélec)</div>
</div><div><br></div></div>
</div>