Monthly Archives: April 2009

Unused results

Work on libgdata is progressing nicely, and I've started on porting evolution-data-server to the shiny new calendar and contacts services provided by libgdata. One idea I recently had was to use the G_GNUC_WARN_UNUSED_RESULT macro (gcc's warn_unused_result attribute) on functions which return allocated data, to warn users of the library if they're not using the data, and thus leaking memory.

After a little research, I've found no real uses of that gcc attribute in this manner, which is rather surprising. Perhaps people think the effort of adding the attribute to all applicable functions is not worth it, given that 90% of the time, users of their libraries will correctly use the result of functions (if not free them)?

Anybody got any insights into the matter? I'll probably go ahead and add the attributes anyway, since there are definitely a few functions in libgdata which return allocated data when the user probably isn't expecting it.


It's about time to announce something I've been working on for about three months now: libgdata. It's a GLib-, libsoup- and libxml2-based library for accessing GData APIs, as used by most Google services. There already exist several such libraries in a variety of languages, but as far as I'm aware this is the first one written in C — and thus the first which is widely accessible to the GNOME stack. So far it has decent support for YouTube video queries, and the beginnings of Google Calendar support.

Having ported the Totem YouTube plugin to use libgdata, my next plan is to port the evolution-data-server Google Calendar backend as well. With that done, libgdata will hopefully be stable and fully-featured enough for people to get to work on starting to fulfil Rob Bradford's dream of tighter desktop integration with web services.