C-API Examples

William Lachance wrlach at gmail.com
Mon May 8 17:17:29 PDT 2006

On 5/3/06, Kosina, Martin <martin.kosina at intel.com> 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.
> Are there any other docs available besides doxygen for the low-level API
> ?

For what it's worth, I've been working on a WvStreams binding for
D-Bus (for those who don't know, WvStreams is a C++
network-programming library, used in the popular wvdial program and
the Nitix operating system). It's anything but ready for public
consumption, but the mainloop stuff, etc. is working (it even has a
server abstraction, for unit-testing purposes). It might be useful as
an alternate reference to the low-level API.

You can browse the API here:


.. the interesting directories are dbus/ and include/. Instructions on
checking out the whole thing are here (substitute branches/uniservice
for releases/freesw):


I've been using the glib bindings and the aforementioned C-API
tutorial as reference during development. Working with D-Bus at this
level is definitely not trivial, but it's also not impossible (I've
come pretty far in just a few months of working on this in my spare
time). Good luck!

William Lachance
wrlach at gmail.com

More information about the dbus mailing list