gupnp-binding-tool
- From: Michael Rumpf <michael rumpf gmail com>
- To: gupnp-list <gupnp-list gnome org>
- Subject: gupnp-binding-tool
- Date: Sun, 5 Jun 2011 22:55:02 +0200
Hi,
I'm very new to gupnp and I might still have some issues understanding the concepts behind it. Here is what I'm trying to do. I use the gupnp-binding-tool in order to generate the server side stub code for 3 service description.xml files.
1. when I #include all the 3 generated files in my code (each one generated with a different prefix) I get a linker error that the function _free_cb_data() has been defined 3 times.
I see 3 possible solutions:
a) Use the --prefix also for the function _free_cb_data()
b) Move the function _free_cb_data() into the gupnp library
c) Use a #ifndef #define #endif sequence in order to define the method only once
Currently I help myself with the following script
../../base/bin/gupnp-binding-tool --prefix renderingcontrol --mode server RenderingControl/description.xml > audio-renderer-renderingcontrol.c1
cat audio-renderer-renderingcontrol.c1 | sed -e 's/_free_cb_data/_renderingcontrol_free_cb_data/g' > audio-renderer-renderingcontrol.c
rm audio-renderer-renderingcontrol.c1
2. The generated code contains methods for connecting the action callback handlers and for the state variable handlers. But the code does not provide a method where all action callback and state variable handlers get connected. I still need to add calls like this
<PREFIX>_<ACTIONNAME>_action_connect(GUPNP_SERVICE (myServiceInfo), G_CALLBACK(<PREFIX>_<ACTIONNAME>_action_set), NULL);
<PREFIX>_<ACTIONNAME>_action_connect(GUPNP_SERVICE (myServiceInfo), G_CALLBACK(<PREFIX>_<ACTIONNAME>_action_get), NULL);
It would be no problem for the gupnp-binding-tool to generate one function like this
action_connect_all (GUPnPService *service)
This would be a dummy implementation where no individual userdata can be passed to the different action_connect functions, but it would save a lot of typing/scripting in order to get a service up and running.
Regards,
Michael
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]