From: Eric Blake Date: Fri, 25 Nov 2005 18:42:28 +0000 (+0000) Subject: * libltdl/ltdl.h, libltdl/ltdl.c (lt_dlinterface_free): New X-Git-Tag: release-2-1b~385 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0d0a9adc0451cb1846b7f5dadccb5bb41a01de3;p=thirdparty%2Flibtool.git * libltdl/ltdl.h, libltdl/ltdl.c (lt_dlinterface_free): New function. * doc/libtool.texi (User defined module data): Document it. --- diff --git a/ChangeLog b/ChangeLog index 156e5ccf0..58c94a77e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-11-25 Eric Blake , + Ralf Wildenhues + + * libltdl/ltdl.h, libltdl/ltdl.c (lt_dlinterface_free): New + function. + * doc/libtool.texi (User defined module data): Document it. + 2005-11-25 Ralf Wildenhues * libltdl/m4/libtool.m4 [aix] diff --git a/doc/libtool.texi b/doc/libtool.texi index 06bb9a266..37ada9957 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -3849,6 +3849,10 @@ You supply an @var{id_string} and @var{iface} so that the resulting returned by the iteration functions below. @end deftypefun +@deftypefun void lt_dlinterface_free (@w{lt_dlinterface_id @var{iface}}) +Release the data associated with @var{iface}. +@end deftypefun + @deftypefun int lt_dlhandle_map (@w{lt_dlinterface_id @var{iface}}, @w{int (*@var{func}) (lt_dlhandle @var{handle}, void * @var{data})}, @w{void * @var{data}}) For each module that matches @var{iface}, call the function @var{func}. When writing the @var{func} callback function, the diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 77a7ffeb0..3c265a352 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -2028,14 +2028,21 @@ lt_dlinterface_register (const char *id_string, lt_dlhandle_interface *iface) { interface_id->id_string = lt__strdup (id_string); if (!interface_id->id_string) - FREE (interface_id); + FREE (interface_id); else - interface_id->iface = iface; + interface_id->iface = iface; } return (lt_dlinterface_id) interface_id; } +void lt_dlinterface_free (lt_dlinterface_id key) +{ + lt__interface_id *interface_id = (lt__interface_id *)key; + FREE (interface_id->id_string); + FREE (interface_id); +} + void * lt_dlcaller_set_data (lt_dlinterface_id key, lt_dlhandle handle, void *data) { diff --git a/libltdl/ltdl.h b/libltdl/ltdl.h index 9135735a8..ecf3fe1d6 100644 --- a/libltdl/ltdl.h +++ b/libltdl/ltdl.h @@ -111,6 +111,7 @@ typedef int lt_dlhandle_interface (lt_dlhandle handle, const char *id_string); LT_SCOPE lt_dlinterface_id lt_dlinterface_register (const char *id_string, lt_dlhandle_interface *iface); +LT_SCOPE void lt_dlinterface_free (lt_dlinterface_id key); LT_SCOPE void * lt_dlcaller_set_data (lt_dlinterface_id key, lt_dlhandle handle, void *data); LT_SCOPE void * lt_dlcaller_get_data (lt_dlinterface_id key,