diff options
author | Lucas Rocha <lucasr@gnome.org> | 2008-10-07 21:25:01 +0000 |
---|---|---|
committer | Lucas Almeida Rocha <lucasr@src.gnome.org> | 2008-10-07 21:25:01 +0000 |
commit | 9045f204f1f911867c2dae885904f13f83b9ddab (patch) | |
tree | 4d58cd7402fe3f87ff1e5f4e1f192bedab286863 /girepository/ginvoke.c | |
parent | 9103a2f76dc5adac81af724f79a0c2baf425825f (diff) | |
download | gobject-introspection-9045f204f1f911867c2dae885904f13f83b9ddab.tar.gz |
Bug 555294: Add support for multiple shared libraries per typelib.
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
Diffstat (limited to 'girepository/ginvoke.c')
-rw-r--r-- | girepository/ginvoke.c | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/girepository/ginvoke.c b/girepository/ginvoke.c index c9180d9f..d5182dbf 100644 --- a/girepository/ginvoke.c +++ b/girepository/ginvoke.c @@ -162,42 +162,18 @@ g_function_info_invoke (GIFunctionInfo *info, gint n_args, n_invoke_args, in_pos, out_pos, i; gpointer *args; gboolean success = FALSE; - + symbol = g_function_info_get_symbol (info); - if (!g_module_symbol (g_base_info_get_typelib((GIBaseInfo *) info)->module, - symbol, &func)) + if (!g_typelib_symbol (g_base_info_get_typelib((GIBaseInfo *) info), + symbol, &func)) { - GModule *entire_app; + g_set_error (error, + G_INVOKE_ERROR, + G_INVOKE_ERROR_SYMBOL_NOT_FOUND, + "Could not locate %s: %s", symbol, g_module_error ()); - /* - * We want to be able to add symbols to an app or an auxiliary - * library to fill in gaps in an introspected library. However, - * normally we would only look for symbols in the main library - * (typelib->module). - * - * A more elaborate solution is probably possible, but as a - * simple approach for now, if we fail to find a symbol we look - * for it in the global module. - * - * This would not be very efficient if it happened often, since - * we always do the failed lookup above first, but very few - * symbols should be outside of typelib->module so it doesn't - * matter. - */ - entire_app = g_module_open (NULL, 0); - if (!g_module_symbol (entire_app, symbol, &func)) - { - g_set_error (error, - G_INVOKE_ERROR, - G_INVOKE_ERROR_SYMBOL_NOT_FOUND, - "Could not locate %s: %s", symbol, g_module_error ()); - - g_module_close (entire_app); - - return FALSE; - } - g_module_close (entire_app); + return FALSE; } is_method = (g_function_info_get_flags (info) & GI_FUNCTION_IS_METHOD) != 0 |