I am trying, as in not being very successfully, to make a python biding for gegl. I had hit a first road block. When I call gegl_init from my binding it gives me a segmentation fault. The problem seems to be in the babl library, it has a 'db' global that is being used uninitialized. I particularly think that such globals should be a class variable, gobject do suport them or am I mistaken? Anyway I first thought that this was a problem of the name that was conflicting with some other symbol elsewhere. I then proceeded to rename all instances of the variable "db" to "babl_internal_db", I think that this is much more sane and is easier to search and replace if this bad scheme is to be changed in the future (I know I know, "who the hell does he think he is to say that...", sorry if it made someone mad, it is my opinion). I am attaching the "cvs diff" in this email so people could use if this is desired. I also would want to share my work in this python bindings, but I fear it is a little too big to post here... :-)
? babl/.babl-component.c.swp ? babl/.babl-db.c.swp ? tests/.deps ? tests/.libs Index: babl/babl-component.c =================================================================== RCS file: /cvs/gnome/babl/babl/babl-component.c,v retrieving revision 1.14 diff -r1.14 babl-component.c 116c116 < Babl *ret = babl_db_insert (db, babl); --- > Babl *ret = babl_db_insert (babl_internal_db, babl); Index: babl/babl-conversion.c =================================================================== RCS file: /cvs/gnome/babl/babl/babl-conversion.c,v retrieving revision 1.24 diff -r1.24 babl-conversion.c 263c263 < Babl *ret = babl_db_insert (db, babl); --- > Babl *ret = babl_db_insert (babl_internal_db, babl); Index: babl/babl-extension.c =================================================================== RCS file: /cvs/gnome/babl/babl/babl-extension.c,v retrieving revision 1.6 diff -r1.6 babl-extension.c 101,102c101,102 < if (!db) < db = babl_db_init (); --- > if (!babl_internal_db) > babl_internal_db = babl_db_init (); 109c109 < Babl *ret = babl_db_insert (db, babl); --- > Babl *ret = babl_db_insert (babl_internal_db, babl); 174,175c174,175 < < dl_handle = dlopen (path, RTLD_NOW); --- > > dl_handle = dlopen (path, 2); //RTLD_NOW); 200c200 < if (babl_db_insert (db, babl) == babl) --- > if (babl_db_insert (babl_internal_db, babl) == babl) Index: babl/babl-fish.c =================================================================== RCS file: /cvs/gnome/babl/babl/babl-fish.c,v retrieving revision 1.23 diff -r1.23 babl-fish.c 54,56c54,56 < if (!db) < db = babl_db_init (); < return db; --- > if (!babl_internal_db) > babl_internal_db = babl_db_init (); > return babl_internal_db; Index: babl/babl-format.c =================================================================== RCS file: /cvs/gnome/babl/babl/babl-format.c,v retrieving revision 1.26 diff -r1.26 babl-format.c 299c299 < Babl *ret = babl_db_insert (db, babl); --- > Babl *ret = babl_db_insert (babl_internal_db, babl); 309c309 < return babl_db_count (db); --- > return babl_db_count (babl_internal_db); Index: babl/babl-internal.h =================================================================== RCS file: /cvs/gnome/babl/babl/babl-internal.h,v retrieving revision 1.17 diff -r1.17 babl-internal.h 104c104 < static BablDb *db=NULL; --- > static BablDb *babl_internal_db=NULL; 107,108c107,108 < if (db==NULL) < db=NULL; --- > if (babl_internal_db==NULL) > babl_internal_db=NULL; 181c181 < babl_db_each (db, each_fun, user_data); \ --- > babl_db_each (babl_internal_db, each_fun, user_data); \ 189c189 < babl = babl_db_exist (db, id, NULL); \ --- > babl = babl_db_exist (babl_internal_db, id, NULL); \ 207c207 < babl = babl_db_exist (db, 0, name); \ --- > babl = babl_db_exist (babl_internal_db, 0, name); \ 236,237c236,237 < if (!db) \ < db=babl_db_init (); \ --- > if (!babl_internal_db) \ > babl_internal_db=babl_db_init (); \ 246,247c246,247 < babl_db_each (db,each_babl_##type_name##_destroy, NULL); \ < babl_db_destroy (db); \ --- > babl_db_each (babl_internal_db,each_babl_##type_name##_destroy, NULL); \ > babl_db_destroy (babl_internal_db); \ Index: babl/babl-model.c =================================================================== RCS file: /cvs/gnome/babl/babl/babl-model.c,v retrieving revision 1.19 diff -r1.19 babl-model.c 166c166 < Babl *ret = babl_db_insert (db, babl); --- > Babl *ret = babl_db_insert (babl_internal_db, babl); Index: babl/babl-type.c =================================================================== RCS file: /cvs/gnome/babl/babl/babl-type.c,v retrieving revision 1.16 diff -r1.16 babl-type.c 135c135 < Babl *ret = babl_db_insert (db, babl); --- > Babl *ret = babl_db_insert (babl_internal_db, babl);
_______________________________________________ Gegl-developer@xxxxxxxxxxxxxxxxxxxxxx https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer