[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: Database on symbols, footprints and other (was "Re: gattrib")



On May 6, 2010, at 5:17 AM, Armin Faltl wrote:

> Thanks for all the hints on working with the current tools.
> 
> Still my current concern is how I get gparts working with PostgreSQL and I found
> these BUGS:
> *) configure doesn't react in a sensible way to a missing MySQL installation.
> It records "no" version and then make happily tries to compile the mysql-backend.

Currently, MySQL is the only supported database. The makefiles do not support
conditional compilation of backends yet.

> *) If more than one backend is supported, the system must decide somewhere,
> which database to use. Therefore I had a look into gparts-database.h and line 34 is

It is in gparts-login-ctrl.c on line 425. Currently, database support modules are
loaded in gparts-login-ctrl.c in the function gparts_login_ctrl_instance_init().

>   typedef struct _GPartsDatabase GPartsDatabase;
> 
> but there is no "struct _GPartsDatabase" in the entire source code. - does this compile?
> I think at least when the compiler tries to resolve a function call containing "GPartsDatabase"
> the bomb should blow up.

GPartsDatabase is an interface in the GObject framework, so it is never instantiated. Both
GPartsMySQLDatabase and GPartsPostgreSQLDatabase implement the interface. However,
PostgreSQL support has not been implemented. These classes and interface make up the
database abstraction layer. Other implementations could be created later, like SQLite,
which has been requested.

> Is there a special support for databases in glib/GDK/GTK?
> If not, why (the fucking bloody hell) is 'database' (declared in gparts-login-ctrl.c#416)
> initialized with  g_object_new() - remember, it's a pointer to a structure, that's type is not defined?

The call to g_object_new() would create GPartsMySQLDatabase (or GPartsPostgreSQLDatabase,
but it is not implemented yet.)

Cheers,
Ed


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user