by module name.
* libltdl/ltdl.h (lt_dlhandle_find): Declare it.
* doc/libtool.texi (User defined module data): Document it.
* NEWS: Updated.
+2003-11-18 Gary V. Vaughan <gary@gnu.org>
+
+ * libltdl/ltdl.c (lt_dlhandle_find): New function to find a handle
+ by module name.
+ * libltdl/ltdl.h (lt_dlhandle_find): Declare it.
+ * doc/libtool.texi (User defined module data): Document it.
+ * NEWS: Updated.
+
2003-11-17 Gary V. Vaughan <gary@gnu.org>
* m4/libtool.m4 (AC_LIBTOOL_SETUP): Uncomment call to
* Mode inferrence removed, shorthand for choosing modes added.
* Specifying -allow-undefined is now an error.
* Speed up max_cmd_len check.
+* New function in libltdl: lt_dlhandle_find provides access to module handles
+ by module name.
* make install now deletes preexisting $prefix/share/libtool before installing
latest files.
* Extracting symbols from an import library on cygwin and win32 now works.
function returns @code{NULL}.
@end deftypefun
+@deftypefun lt_dlhandle lt_dlhandle_find (@w{const char *@var{module_name}})
+Search through the loaded module handles for a module named
+@var{module_name}, returning its handle if found or else @code{NULL}
+if no such named module has been loaded.
+@end deftypefun
+
Of course, you would still need to maintain your own list of loaded
module handles to parallel the list maintained by libltdl if there are
any other data that you need to associate with each handle for the
return place ? place->next : handles;
}
+lt_dlhandle
+lt_dlhandle_find (module_name)
+ const char *module_name;
+{
+ lt_dlhandle cur = handles;
+
+ if (cur)
+ {
+ do
+ {
+ if (cur->info.name && strcmp (cur->info.name, module_name) == 0)
+ break;
+ }
+ while ((cur = cur->next));
+ }
+
+ return cur;
+}
+
int
lt_dlforeach (func, data)
int (*func) LT_PARAMS((lt_dlhandle handle, lt_ptr data));
LT_SCOPE const lt_dlinfo *lt_dlgetinfo LT_PARAMS((lt_dlhandle handle));
LT_SCOPE lt_dlhandle lt_dlhandle_next LT_PARAMS((lt_dlhandle place));
+LT_SCOPE lt_dlhandle lt_dlhandle_find LT_PARAMS((
+ const char *module_name));
LT_SCOPE int lt_dlforeach LT_PARAMS((
int (*func) (lt_dlhandle handle, lt_ptr data),
lt_ptr data));