From: Thomas Tanner Date: Thu, 11 May 2000 15:17:27 +0000 (+0000) Subject: * NEWS: update X-Git-Tag: release-1-3d~180 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=264e859d078fc90a0fbb15a75080aa5f0f82cf73;p=thirdparty%2Flibtool.git * NEWS: update * doc/libtool.texi (libltdl): rename lt_(find|next|add|remove)_dlloader to lt_dlloader_* * libltdl/ltdl.c: ditto * libltdl/ltdl.h: ditto, add declaration of lt_dlloader_(find|remove) --- diff --git a/ChangeLog b/ChangeLog index 018c79a24..a1ccedfe6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-05-11 Thomas Tanner + + * NEWS: update + * doc/libtool.texi (libltdl): rename lt_(find|next|add|remove)_dlloader + to lt_dlloader_* + * libltdl/ltdl.c: ditto + * libltdl/ltdl.h: ditto, add declaration of lt_dlloader_(find|remove) + 2000-05-06 Pavel Roskin * libltdl/ltdl.c: Typo. diff --git a/NEWS b/NEWS index 47c3a7c65..fb42441bd 100644 --- a/NEWS +++ b/NEWS @@ -11,8 +11,8 @@ New in 1.3d: 2000-??-??; CVS version 1.3c, Libtool team: * 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_next_dlloader, lt_dlloader_name, lt_find_dlloader and - lt_add_dlloader can be used for adding new types of module loaders. + lt_dlloader_next, lt_dlloader_name, lt_dlloader_find, lt_dlloader_add and + lt_dlloader_remove can be used for adding new types of module loaders. lt_dladderror, lt_dlseterror integrate user module loaders with lt_dlerror. * "-Xcompiler" and "-Wc," does now work in compile mode, too. * Start of support code for cross-compiling to win32. diff --git a/doc/libtool.texi b/doc/libtool.texi index b49e594bf..99f24b6e5 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -3233,8 +3233,8 @@ which they can be allocated to an instance of @code{lt_user_dlloader} and registered. Registering the loader requires that you choose a name for it, so that it -can be recognised by @code{lt_find_dlloader} and removed with -@code{lt_remove_dlloader}. The name you choose must be unique, and not +can be recognised by @code{lt_dlloader_find} and removed with +@code{lt_dlloader_remove}. The name you choose must be unique, and not already in use by libltdl's builtin loaders: @table @asis @@ -3270,7 +3270,7 @@ level types. @deftypefn {Type} {struct} lt_user_dlloader @{@w{const char *@var{sym_prefix};} @w{lt_module_open_t *@var{module_open};}@w{lt_module_close_t *@var{module_close};} @w{lt_find_sym_t *@var{find_sym};} @w{lt_dlloader_exit_t *@var{dlloader_exit};} @w{lt_dlloader_data_t @var{dlloader_data};} @} If you want to define a new way to open dynamic modules, and have the @code{lt_dlopen} @sc{api} use it, you need to instantiate one of these -structures and pass it to @code{lt_add_dlloader}. You can pass whatever +structures and pass it to @code{lt_dlloader_add}. You can pass whatever you like in the @var{dlloader_data} field, and it will be passed back as the value of the first parameter to each of the functions specified in the function pointer fields. @@ -3308,7 +3308,7 @@ Implementation of such a function should free any resources associated with the loader, including any user specified data in the @code{dlloader_data} field of the @code{lt_user_dlloader}. If non-@code{NULL}, the function will be called by @code{lt_dlexit}, and -@code{lt_remove_dlloader}. +@code{lt_dlloader_remove}. @end deftypefn For example: @@ -3331,7 +3331,7 @@ register_myloader (void) dlloader.dlloader_data = (lt_dlloader_data_t)myloader_function; /* Add my loader as the default module loader. */ - if (lt_add_dlloader (lt_next_dlloader (NULL), &dlloader, "myloader") != 0) + if (lt_dlloader_add (lt_dlloader_next (NULL), &dlloader, "myloader") != 0) return ERROR; return OK; @@ -3351,25 +3351,25 @@ during the initialisation phase. libltdl provides the following functions for writing your own module loaders: -@deftypefun int lt_add_dlloader (@w{lt_dlloader_t *@var{place},} @w{lt_user_dlloader *@var{dlloader},} @w{const char *@var{loader_name}}) +@deftypefun int lt_dlloader_add (@w{lt_dlloader_t *@var{place},} @w{lt_user_dlloader *@var{dlloader},} @w{const char *@var{loader_name}}) Add a new module loader to the list of all loaders, either as the last loader (if @var{place} is @code{NULL}), else immediately before the loader passed as @var{place}. @var{loader_name} will be returned by @code{lt_dlloader_name} if it is subsequently passed a newly registered loader. These @var{loader_name}s must be unique, or -@code{lt_remove_dlloader} and @code{lt_find_dlloader} cannot +@code{lt_dlloader_remove} and @code{lt_dlloader_find} cannot work. Returns 0 for success. @example @{ /* Make myloader be the last one. */ - if (lt_add_dlloader (NULL, myloader) != 0) + if (lt_dlloader_add (NULL, myloader) != 0) perror (lt_dlerror ()); @} @end example @end deftypefun -@deftypefun int lt_remove_dlloader (@w{const char *@var{loader_name}}) +@deftypefun int lt_dlloader_remove (@w{const char *@var{loader_name}}) Remove the loader identified by the unique name, @var{loader_name}. Before this can succeed, all modules opened by the named loader must have been closed. Returns 0 for success, otherwise an error message can @@ -3378,27 +3378,27 @@ be obtained from @code{lt_dlerror}. @example @{ /* Remove myloader. */ - if (lt_remove_dlloader ("myloader") != 0) + if (lt_dlloader_remove ("myloader") != 0) perror (lt_dlerror ()); @} @end example @end deftypefun -@deftypefun {lt_dlloader_t *}lt_next_dlloader (@w{lt_dlloader_t *@var{place}}) +@deftypefun {lt_dlloader_t *}lt_dlloader_next (@w{lt_dlloader_t *@var{place}}) Iterate over the module loaders, returning the first loader if @var{place} is @code{NULL}, and the next one on subsequent calls. The handle is for use with -@code{lt_add_dlloader}. +@code{lt_dlloader_add}. @example @{ /* Make myloader be the first one. */ - if (lt_add_dlloader (lt_next_dlloader (NULL), myloader) != 0) + if (lt_dlloader_add (lt_dlloader_next (NULL), myloader) != 0) return ERROR; @} @end example @end deftypefun -@deftypefun {lt_dlloader_t *}lt_find_dlloader (@w{const char *@var{loader_name}}) +@deftypefun {lt_dlloader_t *}lt_dlloader_find (@w{const char *@var{loader_name}}) Return the first loader with a matching @var{loader_name} identifier, or else @code{NULL}, if the identifier is not found. @@ -3411,7 +3411,7 @@ the host dependent module loading @sc{api} -- @code{shl_load} and @{ /* Add a user loader as the next module loader to be tried if the standard dlopen loader were to fail when lt_dlopening. */ - if (lt_add_dlloader (lt_find_dlloader ("dlopen"), myloader) != 0) + if (lt_dlloader_add (lt_dlloader_find ("dlopen"), myloader) != 0) return ERROR; @} @end example @@ -3419,14 +3419,14 @@ the host dependent module loading @sc{api} -- @code{shl_load} and @deftypefun {const char *}lt_dlloader_name (@w{lt_dlloader_t *@var{place}}) Return the identifying name of @var{PLACE}, as obtained from -@code{lt_next_dlloader} or @code{lt_find_dlloader}. If this function fails, +@code{lt_dlloader_next} or @code{lt_dlloader_find}. If this function fails, it will return @code{NULL} and set an error for retrieval with @code{lt_dlerror}. @end deftypefun @deftypefun {lt_dlloader_data_t *}lt_dlloader_data (@w{lt_dlloader_t *@var{place}}) Return the address of the @code{dlloader_data} of @var{PLACE}, as -obtained from @code{lt_next_dlloader} or @code{lt_find_dlloader}. If +obtained from @code{lt_dlloader_next} or @code{lt_dlloader_find}. If this function fails, it will return @code{NULL} and set an error for retrieval with @code{lt_dlerror}. @end deftypefun diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 711586f8a..134fbab36 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -284,7 +284,6 @@ strrchr(str, ch) # endif #endif -/*ARGSUSED*/ static lt_module_t sys_dl_open (loader_data, filename) lt_dlloader_data_t loader_data; @@ -301,7 +300,6 @@ sys_dl_open (loader_data, filename) return module; } -/*ARGSUSED*/ static int sys_dl_close (loader_data, module) lt_dlloader_data_t loader_data; @@ -318,7 +316,6 @@ sys_dl_close (loader_data, module) return 0; } -/*ARGSUSED*/ static lt_ptr_t sys_dl_sym (loader_data, module, symbol) lt_dlloader_data_t loader_data; @@ -388,7 +385,6 @@ static struct lt_user_dlloader sys_dl = { #define LTDL_BIND_FLAGS (BIND_IMMEDIATE | BIND_NONFATAL | DYNAMIC_PATH) -/*ARGSUSED*/ static lt_module_t sys_shl_open (loader_data, filename) lt_dlloader_data_t loader_data; @@ -401,7 +397,6 @@ sys_shl_open (loader_data, filename) return module; } -/*ARGSUSED*/ static int sys_shl_close (loader_data, module) lt_dlloader_data_t loader_data; @@ -414,7 +409,6 @@ sys_shl_close (loader_data, module) return 0; } -/*ARGSUSED*/ static lt_ptr_t sys_shl_sym (loader_data, module, symbol) lt_dlloader_data_t loader_data; @@ -448,7 +442,6 @@ sys_shl = { 0, sys_shl_open, sys_shl_close, sys_shl_sym, 0, 0 }; /* Forward declaration; required to implement handle search below. */ static lt_dlhandle handles; -/*ARGSUSED*/ static lt_module_t sys_wll_open (loader_data, filename) lt_dlloader_data_t loader_data; @@ -513,7 +506,6 @@ sys_wll_open (loader_data, filename) return module; } -/*ARGSUSED*/ static int sys_wll_close (loader_data, module) lt_dlloader_data_t loader_data; @@ -526,7 +518,6 @@ sys_wll_close (loader_data, module) return 0; } -/*ARGSUSED*/ static lt_ptr_t sys_wll_sym (loader_data, module, symbol) lt_dlloader_data_t loader_data; @@ -551,7 +542,6 @@ sys_wll = { 0, sys_wll_open, sys_wll_close, sys_wll_sym, 0, 0 }; #include -/*ARGSUSED*/ static lt_module_t sys_bedl_open (loader_data, filename) lt_dlloader_data_t loader_data; @@ -575,7 +565,6 @@ sys_bedl_open (loader_data, filename) return (lt_module_t) image; } -/*ARGSUSED*/ static int sys_bedl_close (loader_data, module) lt_dlloader_data_t loader_data; @@ -588,7 +577,6 @@ sys_bedl_close (loader_data, module) return 0; } -/*ARGSUSED*/ static lt_ptr_t sys_bedl_sym (loader_data, module, symbol) lt_dlloader_data_t loader_data; @@ -619,7 +607,6 @@ sys_bedl = { 0, sys_bedl_open, sys_bedl_close, sys_bedl_sym, 0, 0 }; #include #endif -/*ARGSUSED*/ static lt_module_t sys_dld_open (loader_data, filename) lt_dlloader_data_t loader_data; @@ -638,7 +625,6 @@ sys_dld_open (loader_data, filename) return module; } -/*ARGSUSED*/ static int sys_dld_close (loader_data, module) lt_dlloader_data_t loader_data; @@ -652,7 +638,6 @@ sys_dld_close (loader_data, module) return 0; } -/*ARGSUSED*/ static lt_ptr_t sys_dld_sym (loader_data, module, symbol) lt_dlloader_data_t loader_data; @@ -681,7 +666,6 @@ typedef struct lt_dlsymlists_t { static const lt_dlsymlist *default_preloaded_symbols = 0; static lt_dlsymlists_t *preloaded_symbols = 0; -/*ARGSUSED*/ static int presym_init (loader_data) lt_dlloader_data_t loader_data; @@ -707,7 +691,6 @@ presym_free_symlists LTDL_PARAMS((void)) return 0; } -/*ARGSUSED*/ static int presym_exit (loader_data) lt_dlloader_data_t loader_data; @@ -740,7 +723,6 @@ presym_add_symlist (preloaded) return 0; } -/*ARGSUSED*/ static lt_module_t presym_open (loader_data, filename) lt_dlloader_data_t loader_data; @@ -770,7 +752,6 @@ presym_open (loader_data, filename) return 0; } -/*ARGSUSED*/ static int presym_close (loader_data, module) lt_dlloader_data_t loader_data; @@ -781,7 +762,6 @@ presym_close (loader_data, module) return 0; } -/*ARGSUSED*/ static lt_ptr_t presym_sym (loader_data, module, symbol) lt_dlloader_data_t loader_data; @@ -823,21 +803,21 @@ lt_dlinit LTDL_PARAMS((void)) user_search_path = 0; /* empty search path */ #if HAVE_LIBDL && !defined(__CYGWIN__) - errors += lt_add_dlloader (lt_next_dlloader(0), &sys_dl, "dlopen"); + errors += lt_dlloader_add (lt_dlloader_next(0), &sys_dl, "dlopen"); #endif #if HAVE_SHL_LOAD - errors += lt_add_dlloader (lt_next_dlloader(0), &sys_shl, "dlopen"); + errors += lt_dlloader_add (lt_dlloader_next(0), &sys_shl, "dlopen"); #endif #ifdef _WIN32 - errors += lt_add_dlloader (lt_next_dlloader(0), &sys_wll, "dlopen"); + errors += lt_dlloader_add (lt_dlloader_next(0), &sys_wll, "dlopen"); #endif #ifdef __BEOS__ - errors += lt_add_dlloader (lt_next_dlloader(0), &sys_bedl, "dlopen"); + errors += lt_dlloader_add (lt_dlloader_next(0), &sys_bedl, "dlopen"); #endif #if HAVE_DLD - errors += lt_add_dlloader (lt_next_dlloader(0), &sys_dld, "dld"); + errors += lt_dlloader_add (lt_dlloader_next(0), &sys_dld, "dld"); #endif - errors += lt_add_dlloader (lt_next_dlloader(0), &presym, "dlpreload"); + errors += lt_dlloader_add (lt_dlloader_next(0), &presym, "dlpreload"); if (presym_init(presym.dlloader_data)) { last_error = LT_DLSTRERROR(INIT_LOADER); return 1; @@ -1798,9 +1778,8 @@ lt_dlforeach (func, data) return 0; } - int -lt_add_dlloader (place, dlloader, loader_name) +lt_dlloader_add (place, dlloader, loader_name) lt_dlloader_t *place; const struct lt_user_dlloader *dlloader; const char *loader_name; @@ -1862,10 +1841,10 @@ lt_add_dlloader (place, dlloader, loader_name) } int -lt_remove_dlloader (loader_name) +lt_dlloader_remove (loader_name) const char *loader_name; { - lt_dlloader_t *place = lt_find_dlloader (loader_name); + lt_dlloader_t *place = lt_dlloader_find (loader_name); lt_dlhandle handle; int result = 0; @@ -1902,7 +1881,7 @@ lt_remove_dlloader (loader_name) } lt_dlloader_t * -lt_next_dlloader (place) +lt_dlloader_next (place) lt_dlloader_t *place; { return place ? place->next : loaders; @@ -1927,7 +1906,7 @@ lt_dlloader_data (place) } lt_dlloader_t * -lt_find_dlloader (loader_name) +lt_dlloader_find (loader_name) const char *loader_name; { lt_dlloader_t *place = 0; @@ -1939,7 +1918,6 @@ lt_find_dlloader (loader_name) return place; } - static const char **user_error_strings = 0; static int errorcode = LTDL_ERROR_MAX; diff --git a/libltdl/ltdl.h b/libltdl/ltdl.h index fdb7626a0..96e076faa 100644 --- a/libltdl/ltdl.h +++ b/libltdl/ltdl.h @@ -113,7 +113,6 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA #include - /* Defining error strings alongside their symbolic names in a macro in this way allows us to expand the macro in different contexts with confidence that the enumeration of symbolic names will map correctly @@ -148,7 +147,6 @@ enum { }; #undef LTDL_ERROR - /* An opaque handle for a successfully lt_dlopened module instance. */ #ifdef _LTDL_COMPILE_ typedef struct lt_dlhandle_t *lt_dlhandle; @@ -221,7 +219,6 @@ extern const lt_dlinfo *lt_dlgetinfo LTDL_PARAMS((lt_dlhandle handle)); extern int lt_dlforeach LTDL_PARAMS(( int (*func)(lt_dlhandle handle, lt_ptr_t data), lt_ptr_t data)); - /* User module loader API. */ struct lt_user_dlloader { const char *sym_prefix; @@ -232,11 +229,13 @@ struct lt_user_dlloader { lt_dlloader_data_t dlloader_data; }; -extern lt_dlloader_t *lt_next_dlloader LTDL_PARAMS((lt_dlloader_t *place)); +extern lt_dlloader_t *lt_dlloader_next LTDL_PARAMS((lt_dlloader_t *place)); +extern lt_dlloader_t *lt_dlloader_find LTDL_PARAMS((const char *loader_name)); extern const char *lt_dlloader_name LTDL_PARAMS((lt_dlloader_t *place)); extern lt_dlloader_data_t *lt_dlloader_data LTDL_PARAMS((lt_dlloader_t *place)); extern lt_dlloader_t *lt_find_dlloader LTDL_PARAMS((const char *loader_name)); -extern int lt_add_dlloader LTDL_PARAMS((lt_dlloader_t *place, const struct lt_user_dlloader *dlloader, const char *loader_name)); +extern int lt_dlloader_add LTDL_PARAMS((lt_dlloader_t *place, const struct lt_user_dlloader *dlloader, const char *loader_name)); +extern int lt_dlloader_remove LTDL_PARAMS((const char *loader_name)); /* Integrated lt_dlerror() messages for user loaders. */ extern int lt_dladderror LTDL_PARAMS((const char *diagnostic));