[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
46-gary-new-function-lt_dlhandle_find.patch
From: |
Gary V. Vaughan |
Subject: |
46-gary-new-function-lt_dlhandle_find.patch |
Date: |
Tue, 18 Nov 2003 16:46:43 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20030925 Thunderbird/0.3 |
I added this function to CVS M4's copy of ltdl.c/h some months ago, which
allowed me to simplify the M4 module loader considerably.
Okay to commit?
--
())_. Gary V. Vaughan gary@(lilith.warpmail.net|gnu.org)
( '/ Research Scientist http://www.oranda.demon.co.uk ,_())____
/ )= GNU Hacker http://www.gnu.org/software/libtool \' `&
`(_~)_ Tech' Author http://sources.redhat.com/autobook =`---d__/
Index: ChangeLog
from Gary V. Vaughan <address@hidden>
* 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.
Index: NEWS
===================================================================
RCS file: /cvsroot/libtool/libtool/NEWS,v
retrieving revision 1.127
diff -u -p -u -r1.127 NEWS
--- NEWS 14 Nov 2003 17:33:04 -0000 1.127
+++ NEWS 18 Nov 2003 16:29:25 -0000
@@ -22,6 +22,8 @@ New in 1.5b: 2003-??-??; CVS version 1.5
* 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: doc/libtool.texi
===================================================================
RCS file: /cvsroot/libtool/libtool/doc/libtool.texi,v
retrieving revision 1.143
diff -u -p -u -r1.143 libtool.texi
--- doc/libtool.texi 14 Nov 2003 15:14:11 -0000 1.143
+++ doc/libtool.texi 18 Nov 2003 16:29:25 -0000
@@ -3199,6 +3199,12 @@ If @var{place} is the last element in th
function returns @code{NULL}.
@end deftypefun
address@hidden lt_dlhandle lt_dlhandle_find (@w{const char address@hidden)
+Search through the loaded module handles for a module named
address@hidden, returning its handle if found or else @code{NULL}
+if no such named module has been loaded.
address@hidden 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: libltdl/ltdl.c
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/ltdl.c,v
retrieving revision 1.183
diff -u -p -u -r1.183 ltdl.c
--- libltdl/ltdl.c 11 Nov 2003 16:53:31 -0000 1.183
+++ libltdl/ltdl.c 18 Nov 2003 16:29:25 -0000
@@ -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: libltdl/ltdl.h
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/ltdl.h,v
retrieving revision 1.59
diff -u -p -u -r1.59 ltdl.h
--- libltdl/ltdl.h 6 Nov 2003 12:31:00 -0000 1.59
+++ libltdl/ltdl.h 18 Nov 2003 16:29:25 -0000
@@ -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));
pgpM5CbMxUbQt.pgp
Description: PGP signature
- 46-gary-new-function-lt_dlhandle_find.patch,
Gary V. Vaughan <=