From 61510e8475ec83781a33da1e9bf77049c7bbbf0b Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Mon, 8 Jan 2001 01:52:12 +0000 Subject: [PATCH] * NEWS: Updated. * doc/libtool.texi (User defined module data): Updated. * libltdl/ltdl.c (lt_dlhandle_next): New function. * libltdl/ltdl.h (lt_dlhandle_next): Prototypes. --- ChangeLog | 7 +++++++ NEWS | 13 +++++++------ doc/libtool.texi | 11 +++++++++-- libltdl/ltdl.c | 7 +++++++ libltdl/ltdl.h | 5 +++-- 5 files changed, 33 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index e7e325baf..615e236b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-01-07 Gary V. Vaughan + + * NEWS: Updated. + * doc/libtool.texi (User defined module data): Updated. + * libltdl/ltdl.c (lt_dlhandle_next): New function. + * libltdl/ltdl.h (lt_dlhandle_next): Prototypes. + 2001-01-05 Gary V. Vaughan * NEWS: Updated. diff --git a/NEWS b/NEWS index a65624a40..3e7c2e335 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,7 @@ NEWS - list of user-visible changes between releases of GNU Libtool New in 1.3d: 2000-??-??; CVS version 1.3c, Libtool team: * ltconfig is no more. Generation of libtool happens directly from - the configure file. + the configure file. * New -no-install flag to avoid the use of executable wrapper scripts. * New --with-pic, -prefer-pic and -prefer-non-pic flags to control the generation of PIC/non-PIC code. @@ -12,7 +12,8 @@ New in 1.3d: 2000-??-??; CVS version 1.3c, Libtool team: * Support -dlopen and -dlpreopen for libraries. * Libtool now allows you to link shared libraries against static code. * New functions in libltdl: - lt_dlgetinfo, lt_dlforeach provide access to module specific data in handles. + lt_dlgetinfo, lt_dlhandle_next and lt_dlforeach provide access to module + specific data in handles. lt_dlcaller_register, lt_dlcaller_set_data and lt_dlcaller_get_data provide management for user storage of per module data. lt_dlloader_next, lt_dlloader_name, lt_dlloader_find, lt_dlloader_add and @@ -101,10 +102,10 @@ New in 1.3: 1999-04-29, Libtool team: libtool libraries. Linking of uninstalled libtool libraries into libraries is under development for 1.4. * Do not drop library dependencies on platforms that allow them. -* Linking with uninstalled libraries no longer picks installed ones by +* Linking with uninstalled libraries no longer picks installed ones by mistake. * Use libraries from the build tree when running uninstalled - executables (may require double linking). + executables (may require double linking). * Allow developers to optimize for build-tree executions. * Support -export-symbols-regex for controlled symbol exporting. * Support -R to hardcode directories in library search paths. @@ -175,11 +176,11 @@ New in 1.2d: 1998-12-16; CVS version 1.2c, Libtool team: It is still undocumented, but you can already find some examples in: * New mdemo directory, with tests of -module and dlopening examples. Be aware that libltdl is only known to work on a few platforms such as - GNU/Linux and Solaris2. Some mdemo tests are known to FAIL on several + GNU/Linux and Solaris2. Some mdemo tests are known to FAIL on several other platforms; please ignore these failures by now (or work to fix them :-). * Inter-library dependencies patch finally integrated, but there's - still much porting to do. See PORTING for details (some plans for the + still much porting to do. See PORTING for details (some plans for the future in mail/deplibs in the CVS tree). * New option -export-symbols to control symbol exporting when possible. * Fixed -export-dynamic problem with C++ programs in egcs 1.1. diff --git a/doc/libtool.texi b/doc/libtool.texi index c7fc1e4da..fe2048514 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -2958,8 +2958,8 @@ Return @code{NULL} on failure. @end deftypefun Furthermore, in order to save you from having to keep a list of the -handles of all the modules you have loaded, this function will supply -the @var{handle} for each loaded module to a given callback: +handles of all the modules you have loaded, these functions allow you to +iterate over libltdl's list of loaded modules: @deftypefun int lt_dlforeach (@w{int (*@var{func}) (lt_dlhandle @var{handle}, lt_ptr @var{data})}, @w{lt_ptr @var{data}}) For each loaded module call the function @var{func}. The argument @@ -2970,6 +2970,13 @@ As soon as @var{func} returns a non-zero value for one of the handles, Otherwise 0 is returned. @end deftypefun +@deftypefun lt_dlhandle lt_dlhandle_next (@w{lt_dlhandle place}) +Iterate over the loaded module handles, returning the first handle in the +list if @var{place} is @code{NULL}, and the next one on subsequent calls. +If @var{place} is the last element in the list of loaded modules, this +function returns @code{NULL}. +@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 diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 56c693c7c..6c36b4126 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -2488,6 +2488,13 @@ lt_dlgetinfo (handle) return &(handle->info); } +lt_dlhandle +lt_dlhandle_next (place) + lt_dlhandle place; +{ + return place ? place->next : (lt_dlhandle) 0; +} + int lt_dlforeach (func, data) int (*func) LT_PARAMS((lt_dlhandle handle, lt_ptr data)); diff --git a/libltdl/ltdl.h b/libltdl/ltdl.h index 4b6201626..c8d36931a 100644 --- a/libltdl/ltdl.h +++ b/libltdl/ltdl.h @@ -203,8 +203,9 @@ typedef struct { number of times lt_dlclosed. */ } lt_dlinfo; -extern const lt_dlinfo *lt_dlgetinfo LT_PARAMS((lt_dlhandle handle)); -extern int lt_dlforeach LT_PARAMS(( +extern const lt_dlinfo *lt_dlgetinfo LT_PARAMS((lt_dlhandle handle)); +extern lt_dlhandle lt_dlhandle_next LT_PARAMS((lt_dlhandle place)); +extern int lt_dlforeach LT_PARAMS(( int (*func) (lt_dlhandle handle, lt_ptr data), lt_ptr data)); -- 2.47.3