]> Savannah Git Hosting - m4.git/commitdiff

Savannah Git Hosting - m4.git/commitdiff

git git@sv / m4.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b466ccc)
modules: store module name in the module struct.
2013年9月20日 10:26:42 +0000 (17:26 +0700)
2013年9月20日 14:41:58 +0000 (21:41 +0700)
* m4/m4private.h (m4_module): Add name field.
* m4/module.c (m4__module_open): Save the name field.
* m4/path.c (m4_load_filename): Pass the raw filename to
m4_module_load.
* m4/module.c (m4_get_module_name): Replace all the ltdl
twiddling with returning the saved name field.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>

diff --git a/m4/m4private.h b/m4/m4private.h
index 359572239163a132dce0ff5759475ac5c91b81f3..916330ca83a600955f3af8bf51dc40c8e056f1b5 100644 (file)
--- a/m4/m4private.h
+++ b/m4/m4private.h
@@ -178,6 +178,7 @@ extern void m4__builtin_print (m4_obstack *, const m4__builtin *, bool,
/* Representation of a loaded m4 module. */
struct m4_module
{
+ const char *name; /* Name of the module. */
lt_dlhandle handle; /* All ltdl module information. */
m4__builtin *builtins; /* Sorted array of builtins. */
m4_macro *macros; /* Unsorted array of macros. */
diff --git a/m4/module.c b/m4/module.c
index a2215f0e4d7a9c52a8a604be5af2670234927247..db26198a55d4bb83921f5658c37b82a81a67168e 100644 (file)
--- a/m4/module.c
+++ b/m4/module.c
@@ -79,13 +79,8 @@ static lt_dlinterface_id iface_id = NULL;
const char *
m4_get_module_name (const m4_module *module)
{
- const lt_dlinfo *info;
-
- assert (module && module->handle);
-
- info = lt_dlgetinfo (module->handle);
-
- return info ? info->name : NULL;
+ assert (module);
+ return module->name;
}
void *
@@ -212,7 +207,7 @@ install_macro_table (m4 *context, m4_module *module)
m4_debug_message (context, M4_DEBUG_TRACE_MODULE,
_("module %s: macros loaded"),
- m4_get_module_name (module));
+ m4_get_module_name (module));
}
}
@@ -229,7 +224,7 @@ m4_module_load (m4 *context, const char *name, m4_obstack *obs)
{
install_builtin_table (context, module);
install_macro_table (context, module);
- }
+ }
}
return module;
@@ -417,6 +412,7 @@ m4__module_open (m4 *context, const char *name, m4_obstack *obs)
const char *err;
module = (m4_module *) xzalloc (sizeof *module);
+ module->name = xstrdup (name);
module->handle = handle;
/* clear out any stale errors, since we have to use
diff --git a/m4/path.c b/m4/path.c
index c69cdbac933159507e053efb71450fc77b627c61..9437e936c9941f844dd7d9c9a66be09a830449a5 100644 (file)
--- a/m4/path.c
+++ b/m4/path.c
@@ -299,7 +299,7 @@ m4_load_filename (m4 *context, const m4_call_info *caller,
&& suffix
&& (STREQ (suffix, LT_MODULE_EXT) || STREQ (suffix, ".la")))
{
- m4_module_load (context, filepath, obs);
+ m4_module_load (context, filename, obs);
}
else
{
GNU M4 source repository
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /