Re: Problem accessing null-terminated arrays of GObjects from JavaScript



Hi Simon,

On Mon, 30 Aug 2010 17:57:11 +0200, Simón Pena <spenap gmail com>
wrote:
> 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?

FWIW, I never liked too much the array approach (we use GList in most
cases in Grilo so right know I feel like using arrays here is a bit
weird). I would be ok with changing the API to return GLists, not sure
what other people think.

Iago


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