GDA becomming better introspectable

GNOME Data Access (GDA), is a C library for Database access, it provides a library to write clients and a set GTK+ widgets to help write GUI applications; it also provides a control center, a SQL browser and CLI a la PostgreSQL’s psql command.

It is really useful, but could be better if most of its advanced futures are available for GObject Introspection (GI). While GDA has support for GI for a while, there are some structures in C and some API witch has been marked as no-introspectable, automatically or hard coded.

Making a C library introspectable is a little easy, but requires a lot of work, by hiding structs members and provide getters and setters methods for its members (sealing); make sure you are handling correctly struct’s memory management, freeing on request, but most importantly, is to convert this struct as a GBoxed type, making easy for bindings to create, read/write members (using its setter/getter), free, copy  and pack it to a GValue.

The hard work on making a struct introspectable, is to substituted all direct access to its members to use its new API. This is a hard work as you can see when GdaBinary was sealed to make it introspectable.

You can follow GDA Instrospectable bug and its bug dependencies, in order to know how has been solved each case; may that will help you to create better C introspectable API or help us in the process.

Author: despinosa

Linux and GNOME user, full time, since 2001. Actual maintainer of GXml and contributor to other projects mainly on GObject Introspection support.

Leave a Reply

Your email address will not be published. Required fields are marked *