Rather than having bindings use g_function_info_invoke, which is basically
a toy/demo API, export a convenience utility function which takes the introspection
information and sets up things we need to pass to libffi.
Then invocation can be done directly to libffi by a binding.
As part of this work, remove some (unused by gjs) public functions from the
girffi API, and instead export a function to map to libffi which can work
semi-correctly.
https://bugzilla.gnome.org/show_bug.cgi?id=604074
Since GObject-Introspection depends on both ffi and GObject, it's
a convenient home for jdahlin's generic signal marshaller until
such time as GObject can directly depend on ffi.
When it gets added to GObject, we can simply point our marshaller
at that one.
svn path=/trunk/; revision=1022
Extract a function to convert GITypeTag to ffi_type from the internals
of ginvoke.c. This will be useful in figure out structure alignment.
Also fix handling of gsize and time_t to be portable. (Add a check
to configure.ac to figure out the width of time_t.)
svn path=/trunk/; revision=873
2008-10-27 Johan Bilien <jobi@via.ecp.fr>
Bug 558068 – when invoking a method, offset the in arguments by one,
not the out
* tests/invoke/invoke.c, tests/invoke/testfns.c,
tests/invoke/testfns-1.0.gir: Add testing of method and constructor.
* girepository/ginvoke.c: do not offset the index of given out
arguments by one for methods, "this" is provided as in argument only.
svn path=/trunk/; revision=820
2008-10-21 Johan Bilien <jobi@via.ecp.fr>
Bug 557241 – "throws" flag for functions
* tests/scanner/drawable-1.0-expected.gir,
tests/scanner/drawable-injected-1.0-expected.gir,
tests/scanner/drawable.[ch]: add simple test for throwing
function (has GError ** as last argument)
* giscanner/ast.py: add a 'throws' flag to Function
* giscanner/glibtransformer.py: if a function's last paramerter is
a GError, set the 'throws' flag and remove that parameter
* giscanner/girwriter.py: write out the 'throws' attribute
* giscanner/girparser.py: support parsing the 'throws' attribute
* tests/repository/gitestthrows.c: add a simple test to check the
throws flag in a typelib and invoke the function
* girepository/ginfo.c, girepository/girnode.[ch],
girepository/girnode.h, girepository/girparser.c,
girepository/girepository.h: Add and parse the GI_FUNCTION_THROWS flag
* girepository/ginvoke.c: if a function throws, add a GError as last
arguments, and propagate the error to the invoker.
svn path=/trunk/; revision=773
2008-10-06 Lucas Rocha <lucasr@gnome.org>
Bug 555294: Add support for multiple shared libraries per typelib.
* girepository/ginvoke.c (g_function_info_invoke),
girepository/ginfo.c(g_registered_type_info_get_g_type): use
g_typelib_symbol instead of g_module_symbol.
* girepository/girepository.h: remove g_typelib_set_module and add
g_typelib_symbol.
* girepository/gtypelib.[ch] (find_some_symbol, _g_typelib_init,
g_typelib_new_from_memory, g_typelib_new_from_const_memory,
g_typelib_free, g_typelib_symbol): chnage GTypeLib to hold a list of
modules instead of just one. The symbol lookup is now abstracted
behind g_typelib_symbol which tries to find the passed symbol name in
one of its modules.
* giscanner/girwriter.py, tools/g-ir-scanner: change scanner to read
and write shared_library attribute as a comma-separated list of libs.
svn path=/trunk/; revision=660
2008-04-22 Havoc Pennington <hp@pobox.com>
* girepository/ginvoke.c (g_function_info_invoke): If a symbol is
not in metadata->module, look for it in the global module, in case
some other object or the app itself provides the symbol.
svn path=/trunk/; revision=221
2008-02-21 Mark Doffman <mark.doffman@codethink.co.uk>
* girepository/ginvoke.c
* girepository/girepository.h
* girepository/gmetadata.c
* girepository/gmetadata.h
* tools/generate.c
* tools/gidlparser.c
Modify TYPE_TAG_INTERFACE to TYPE_TAG_SYMBOL
to avoid confusion with the interface blob.
* tools/generate.c
* tools/gidlparser.c
Remove magic numbers and replace with type-tag
enumeration symbols.
* girepository/gmetadata.c
Add validate declaration.
WARNING: This commit does not compile. It is a partial change.
svn path=/trunk/; revision=129