C-API Examples

Ralf Habacker ralf.habacker at freenet.de
Mon May 8 12:21:09 PDT 2006


John (J5) Palmieri schrieb:
> On Wed, 2006-05-03 at 16:15 -0700, Kosina, Martin wrote:
>   
>> Hi all,
>>
>> Does anyone have good working examples of using the C API ? (Sample
>> client/server type scenarios, ideally). We are exploring a binding for a
>> custom component system and would like to utilize the C API directly.
>> I've seen lots of Glib and Qt stuff, but the low-level examples are a
>> bit harder to come by. (I do have John Palmieri's "Get on D-bus"
>> article, but having hard time getting it to work properly (is
>> "ListServices" still exported by org.freedesktop.Dbus ?) and would like
>> to see a simple server-side one, as well.
>>     
>
> Hey,
>
> That article is for RHEL-4, FC-3 and is based on version 0.23 of D-Bus.
> Things have change a lot since then (for instance change every place you
> see service with name -- i.e. ListServices -> ListNames).  What version
> are you targeting?
>
> Matthew Johnson posted his tutorial which is really good with the caveat
> that it does not use mainloops and filter functions.  Some simple
> example code can be seen in gnome-volume-manager which uses the glib
> mainloop.  If you are not going to use a mainloop Matthew's tutorial is
> a good start but most complicated programs will need a mainloop in which
> case if you do not choose the glib or Qt mainloop you will have to end
> up integrating d-bus into your own mainloop.  I've heard it is anything
> but trivial.
I recognized that some core tools like dbus-monitor uses the glib 
mainloop. What does this means relating to the binding split from the 
core ?
If glib will be a requirement for the core library, than on windows glib 
will be a requirement for dbus, which would not be good at all.
If glib will not be a requirement, a dbus only mainloop has to be 
implemented for unix and windows.

Ralf





>   
>   



More information about the dbus mailing list