diff options
author | Tim Janik <timj@gtk.org> | 2000-03-01 09:44:10 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 2000-03-01 09:44:10 +0000 |
commit | db8baf697889c80c0632d7cc91343c18a2647429 (patch) | |
tree | 0c33983550e73a88b4aa2d7f09bc905cf3e4c0b5 /gmodule | |
parent | d568a76ae4976e0aa01e26e868121a07b4e91338 (diff) | |
download | glib-db8baf697889c80c0632d7cc91343c18a2647429.tar.gz |
minor optimization.
Wed Mar 1 10:39:39 2000 Tim Janik <timj@gtk.org>
* gslist.c (g_slist_reverse): minor optimization.
* testglib.c (g_node_test): added a couple of tests for
g_node_copy().
* glib.h:
* gnode.c (g_node_copy): new function to copy subtrees,
supplied by dbsears@ix.netcom.com.
changed iterator to walk the children list backwards, so
we get down from O(n^2) to O(n).
* gnode.c (g_node_first_sibling): applied patch from
dbsears@ix.netcom.com to optimize access if node->parent
is present.
* gutils.c (g_get_any_init): backed out HAVE_PW_GECOS check around
assignment of g_real_name, sicne HAVE_PW_GECOS is never defined and
thus breaks the original code.
* merged changes from 1.2.7.
Sat Feb 19 19:43:29 2000 Tim Janik <timj@gtk.org>
* testgmodule.c (main): added test to check that not yet bound symbols
in shared libraries of the main module are retrievable, from David Gero.
Fri Jan 28 11:37:41 2000 Owen Taylor <otaylor@redhat.com>
Bug #4156 - Changes vaguely modelled after Scott Gifford's patch
* gtimer.c (g_timer_elapsed): Never report negative times -
clip times to 0.
* gmain.c (g_timeout_prepare): Guard against unexpected
clock shifts by never setting a timeout of more than
data->interval msecs.
Diffstat (limited to 'gmodule')
-rw-r--r-- | gmodule/ChangeLog | 5 | ||||
-rw-r--r-- | gmodule/testgmodule.c | 29 |
2 files changed, 28 insertions, 6 deletions
diff --git a/gmodule/ChangeLog b/gmodule/ChangeLog index f37adc135..2095d835f 100644 --- a/gmodule/ChangeLog +++ b/gmodule/ChangeLog @@ -22,6 +22,11 @@ Wed Mar 1 05:34:47 2000 Tim Janik <timj@gtk.org> * merges from glib-1-2. +Sat Feb 19 19:43:29 2000 Tim Janik <timj@gtk.org> + + * testgmodule.c (main): added test to check that not yet bound symbols + in shared libraries of the main module are retrievable, from David Gero. + 2000-01-13 Martin Baulig <martin@home-of-linux.org> * gmodule.c (g_module_open): Check whether `check_init' is not NULL diff --git a/gmodule/testgmodule.c b/gmodule/testgmodule.c index 42c28e6ed..70ebe2d3a 100644 --- a/gmodule/testgmodule.c +++ b/gmodule/testgmodule.c @@ -26,6 +26,7 @@ #undef G_LOG_DOMAIN #include <gmodule.h> +#include "gmoduleconf.h" G_MODULE_EXPORT void @@ -37,7 +38,7 @@ g_clash_func (void) typedef void (*SimpleFunc) (void); typedef void (*GModuleFunc) (GModule *); -SimpleFunc gplugin_clash_func; +static SimpleFunc plugin_clash_func = NULL; int main (int arg, @@ -55,7 +56,10 @@ main (int arg, #ifdef G_OS_WIN32 plugin_a = g_strconcat (string, "\\libgplugin_a.dll", NULL); plugin_b = g_strconcat (string, "\\libgplugin_b.dll", NULL); -#else /* !G_OS_WIN32 */ +#elif (G_MODULE_IMPL == G_MODULE_IMPL_DLD) + plugin_a = g_strconcat (string, "/.libs/", "libgplugin_a.sl", NULL); + plugin_b = g_strconcat (string, "/.libs/", "libgplugin_b.sl", NULL); +#else /* G_MODULE_IMPL != G_MODULE_IMPL_DLD && !G_OS_WIN32 */ plugin_a = g_strconcat (string, "/.libs/", "libgplugin_a.so", NULL); plugin_b = g_strconcat (string, "/.libs/", "libgplugin_b.so", NULL); #endif /* G_OS_WIN32 */ @@ -70,6 +74,15 @@ main (int arg, g_print ("error: %s\n", g_module_error ()); return 1; } + g_print ("check that not yet bound symbols in shared libraries of main module are retrievable:\n"); + string = "g_module_close"; + g_print ("retrive symbol `%s' from \"%s\":\n", string, g_basename (g_module_name (module_self))); + if (!g_module_symbol (module_self, string, (gpointer) &f_self)) + { + g_print ("error: %s\n", g_module_error ()); + return 1; + } + g_print ("retrived symbol `%s' as %p\n", string, f_self); g_print ("load plugin from \"%s\"\n", plugin_a); module_a = g_module_open (plugin_a, G_MODULE_BIND_LAZY); if (!module_a) @@ -137,6 +150,10 @@ main (int arg, /* get and call clashing plugin functions */ string = "gplugin_clash_func"; + g_print ("retrive symbol `%s' from \"%s\"\n", string, g_basename (g_module_name (module_self))); + if (!g_module_symbol (module_self, string, (gpointer) &f_self)) + f_self = NULL; + g_print ("retrived function `%s' from self: %p\n", string, f_self); g_print ("retrive symbol `%s' from \"%s\"\n", string, g_basename (g_module_name (module_a))); if (!g_module_symbol (module_a, string, (gpointer) &f_a)) { @@ -150,11 +167,11 @@ main (int arg, return 1; } g_print ("call plugin function(%p) A: ", f_a); - gplugin_clash_func = f_a; - gplugin_clash_func (); + plugin_clash_func = f_a; + plugin_clash_func (); g_print ("call plugin function(%p) B: ", f_b); - gplugin_clash_func = f_b; - gplugin_clash_func (); + plugin_clash_func = f_b; + plugin_clash_func (); /* call gmodule function form A */ |