Problem accessing null-terminated arrays of GObjects from JavaScript



Hi,

Playing a little with Grilo's introspection bindings from JavaScript, I
found that our functions returning a zero-terminated array of GObjects
can't get accessed. We have two functions returning zero-terminated arrays:

* grl_plugin_registry_get_sources_by_operations
* grl_plugin_registry_get_sources

The error I get is:

"FIXME: Only supporting null-terminated arrays of strings". Bug #560567
(generalize array support) [1] has done some work trying to fix this
issue. However, after some patches at the end of 2008 and some work at
the beginning of this year, it looks stalled right now.

JavaScript's support of functions returning GLists of GObjects works
just fine (like in, for example, our sync versions of search and browse).

The solutions I see for this issue:

* Keep waiting until it gets fixed upstream (We can't know how long will
it take)
* Modify get_sources* functions so they return a GList
(breaking/modifying the API)
* Add two additional, auxiliary functions which return a GList, so that
JavaScript users would use them instead of the others returning arrays.
Somehow we should hide them from C developers, and even other binding
consumers (such as Python's), and remove them once upstream bug gets fixed.

What do you think? How should we address this?

[1] https://bugzilla.gnome.org/show_bug.cgi?id=560567


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