]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/ltdl.c (lt_dlhandle_find): New function to find a handle
authorGary V. Vaughan <gary@gnu.org>
Tue, 18 Nov 2003 22:39:39 +0000 (22:39 +0000)
committerGary V. Vaughan <gary@gnu.org>
Tue, 18 Nov 2003 22:39:39 +0000 (22:39 +0000)
by module name.
* libltdl/ltdl.h (lt_dlhandle_find): Declare it.
* doc/libtool.texi (User defined module data): Document it.
* NEWS: Updated.

ChangeLog
NEWS
doc/libtool.texi
libltdl/ltdl.c
libltdl/ltdl.h

index c011d95ec783a77d86dbbcb08baf8b0572800696..d78f636708cc617b09445bf30e00665d73f47e58 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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
diff --git a/NEWS b/NEWS
index edf2ea522a518e5378a60d9266b246cf9507f9cd..67dc329ecd1a5a7536963874125f00d30f376b1f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,8 @@ New in 1.5b: 2003-??-??; CVS version 1.5a, Libtool team:
 * 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.
index 5b9cca6981f26414a0c8c69658e0ffa44c6c852d..fbc585ce9570560e6bec111b0fcb15b806dda0b7 100644 (file)
@@ -3199,6 +3199,12 @@ If @var{place} is the last element in the list of loaded modules, this
 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
index d1bf706247638ba4687fe0b77e77ef5198ff5f7e..4e992c58191171e76a2782965a851ec9f791a11f 100644 (file)
@@ -4130,6 +4130,25 @@ lt_dlhandle_next (place)
   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));
index f9b2c44bc68866a95a308412843759848974a538..0f1e133484436782036891f9442fa1e288cc80ed 100644 (file)
@@ -242,6 +242,8 @@ typedef     struct {
 
 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));