[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: accomodate ltdl HEAD interface changes [m4--devo--1.0--patch-23]
From: |
Gary V. Vaughan |
Subject: |
FYI: accomodate ltdl HEAD interface changes [m4--devo--1.0--patch-23] |
Date: |
Thu, 27 Oct 2005 17:05:24 +0100 (BST) |
User-agent: |
mailnotify/0.7 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Applied to HEAD. You'll need to use libltdl from CVS libtool in order
to compile CVS M4 now...
* looking for address@hidden/m4--devo--1.0--patch-22 to compare with
* comparing to address@hidden/m4--devo--1.0--patch-22
M ChangeLog
M m4/builtin.c
M modules/load.c
M src/freeze.c
M m4/m4private.h
M m4/module.c
* modified files
Index: Changelog
from Gary V. Vaughan <address@hidden>
* m4/module.c (caller_id): To match libtool-2.0 interface, changed
to ...
(iface_id): ...an lt_dlinterface_id type.
(m4__module_find): New abstraction for lt_dlhandle_fetch. Use
throughout, instead of calling obsolete lt_dlhandle_find directly.
(m4__module_next): Use multiloader-safe lt_dlhandle_iterate. Use
throughout, instead of calling obsolete lt_dlhandle_next.
* m4/m4private.h (m4__module_find): Declare it.
* m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
Use m4__module_next instead of obsolete lt_dlhandle_next.
--- orig/m4/builtin.c
+++ mod/m4/builtin.c
@@ -1,5 +1,5 @@
/* GNU m4 -- A simple macro processor
- Copyright (C) 1989-1994, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1989-1994, 1999, 2000, 2005 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
const m4_builtin *
m4_builtin_find_by_name (lt_dlhandle handle, const char *name)
{
- lt_dlhandle cur = handle ? handle : lt_dlhandle_next (0);
+ lt_dlhandle cur = handle ? handle : m4__module_next (0);
do
{
@@ -41,7 +41,7 @@
return builtin;
}
}
- while (!handle && (cur = lt_dlhandle_next (cur)));
+ while (!handle && (cur = m4__module_next (cur)));
return 0;
}
@@ -51,7 +51,7 @@
const m4_builtin *
m4_builtin_find_by_func (lt_dlhandle handle, m4_builtin_func *func)
{
- lt_dlhandle cur = handle ? handle : lt_dlhandle_next (0);
+ lt_dlhandle cur = handle ? handle : m4__module_next (0);
do
{
@@ -65,7 +65,7 @@
return builtin;
}
}
- while (!handle && (cur = lt_dlhandle_next (cur)));
+ while (!handle && (cur = m4__module_next (cur)));
return 0;
}
--- orig/m4/m4private.h
+++ mod/m4/m4private.h
@@ -1,7 +1,7 @@
/* GNU m4 -- A simple macro processor
- Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1998, 1999, 2004,
- 2005 Free Software Foundation, Inc.
+ Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1998, 1999, 2004, 2005
+ Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -137,6 +137,7 @@
m4_obstack *obs);
extern void m4__module_exit (m4 *context);
extern lt_dlhandle m4__module_next (lt_dlhandle);
+extern lt_dlhandle m4__module_find (const char *name);
--- orig/m4/module.c
+++ mod/m4/module.c
@@ -1,5 +1,6 @@
/* GNU m4 -- A simple macro processor
- Copyright (C) 1989-1994, 1998, 1999, 2002, 2003, 2004 Free Software
Foundation, Inc.
+ Copyright (C) 1989-1994, 1998, 1999, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -90,7 +91,7 @@
static int m4__module_interface (lt_dlhandle handle,
const char *id_string);
-static lt_dlcaller_id caller_id = 0;
+static lt_dlinterface_id iface_id = 0;
const char *
m4_get_module_name (lt_dlhandle handle)
@@ -108,7 +109,7 @@
m4_module_import (m4 *context, const char *module_name,
const char *symbol_name, m4_obstack *obs)
{
- lt_dlhandle handle = lt_dlhandle_find (module_name);
+ lt_dlhandle handle = m4__module_find (module_name);
lt_ptr symbol_address = 0;
/* Try to load the module if it is not yet available (errors are
@@ -253,7 +254,7 @@
assert (context);
if (name)
- handle = lt_dlhandle_find (name);
+ handle = m4__module_find (name);
if (!handle)
{
@@ -287,11 +288,23 @@
/* Return successive loaded modules that pass the interface test registered
- with the caller id. */
+ with the interface id. */
lt_dlhandle
m4__module_next (lt_dlhandle handle)
{
- return handle ? lt_dlhandle_next (handle) : lt_dlhandle_first (caller_id);
+ assert (iface_id);
+
+ return lt_dlhandle_iterate (iface_id, handle);
+}
+
+/* Return the first loaded module that passes the registered interface test
+ and is called NAME. */
+lt_dlhandle
+m4__module_find (const char *name)
+{
+ assert (iface_id);
+
+ return lt_dlhandle_fetch (iface_id, name);
}
@@ -304,9 +317,9 @@
{
int errors = 0;
- /* Do this only once! If we already have a caller_id, then the
+ /* Do this only once! If we already have an iface_id, then the
module system has already been initialised. */
- if (caller_id)
+ if (iface_id)
{
M4ERROR ((m4_get_warning_status_opt (context), 0,
_("Warning: multiple module loader initialisations")));
@@ -319,9 +332,9 @@
ltdl module handles. */
if (!errors)
{
- caller_id = lt_dlcaller_register ("m4 libm4", m4__module_interface);
+ iface_id = lt_dlinterface_register ("m4 libm4", m4__module_interface);
- if (!caller_id)
+ if (!iface_id)
{
const char *error_msg = _("libltdl client registration failed");
@@ -369,7 +382,7 @@
m4_module_init_func * init_func = 0;
assert (context);
- assert (caller_id);
+ assert (iface_id); /* need to have called m4__module_init */
if (handle)
{
@@ -423,18 +436,18 @@
void
m4__module_exit (m4 *context)
{
- lt_dlhandle handle = lt_dlhandle_first (caller_id);
+ lt_dlhandle handle = m4__module_next (0);
int errors = 0;
while (handle && !errors)
{
+ const lt_dlinfo *info = lt_dlgetinfo (handle);
lt_dlhandle pending = handle;
- const lt_dlinfo *info = lt_dlgetinfo (pending);
/* If we are about to unload the final reference, move on to the
next handle before we unload the current one. */
if (info->ref_count <= 1)
- handle = lt_dlhandle_next (pending);
+ handle = m4__module_next (handle);
errors = module_remove (context, pending, 0);
}
--- orig/modules/load.c
+++ mod/modules/load.c
@@ -1,5 +1,5 @@
/* GNU m4 -- A simple macro processor
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2005 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -93,14 +93,14 @@
{
/* The expansion of this builtin is a comma separated list of
loaded modules. */
- lt_dlhandle handle = lt_dlhandle_next (NULL);
+ lt_dlhandle handle = m4__module_next (NULL);
if (handle)
do
{
m4_shipout_string (context, obs, m4_get_module_name (handle), 0, true);
- if ((handle = lt_dlhandle_next (handle)))
+ if ((handle = m4__module_next (handle)))
obstack_1grow (obs, ',');
}
while (handle);
--- orig/src/freeze.c
+++ mod/src/freeze.c
@@ -1,5 +1,6 @@
/* GNU m4 -- A simple macro processor
- Copyright (C) 1989, 90, 91, 92, 93, 94, 04 Free Software Foundation, Inc.
+ Copyright (C) 1989, 90, 91, 92, 93, 94, 2004, 2005
+ Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -463,7 +464,7 @@
lt_dlhandle handle = 0;
if (number[2] > 0)
- handle = lt_dlhandle_find (string[2]);
+ handle = m4__module_find (string[2]);
if (handle)
bp = m4_builtin_find_by_name (handle, string[1]);
@@ -660,7 +661,7 @@
lt_dlhandle handle = 0;
if (number[2] > 0)
- handle = lt_dlhandle_find (string[2]);
+ handle = m4__module_find (string[2]);
m4_set_symbol_value_text (token, xstrdup (string[1]));
VALUE_HANDLE (token) = handle;
- --
Gary V. Vaughan ())_. address@hidden,gnu.org}
Research Scientist ( '/ http://tkd.kicks-ass.net
GNU Hacker / )= http://www.gnu.org/software/libtool
Technical Author `(_~)_ http://sources.redhat.com/autobook
_________________________________________________________
This patch notification generated by tlaapply version 1.0
http://tkd.kicks-ass.net/arch/address@hidden/cvs-utils--tla--1.0
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
iD8DBQFDYPrCFRMICSmD1gYRAlArAKDLu/r1VBC3L5beEfbS5NMFMMu8NQCfVO5T
D05dW++Un+I6jXZree+EGBg=
=cC/n
-----END PGP SIGNATURE-----
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: accomodate ltdl HEAD interface changes [m4--devo--1.0--patch-23],
Gary V. Vaughan <=