]> Savannah Git Hosting - m4.git/log

Savannah Git Hosting - m4.git/log

git git@sv / m4.git / log
? search:
summary | shortlog | log | commit | commitdiff | tree
first ⋅ prev ⋅ next
m4.git
17 years agoFactor load functionality into include builtin. include-dso
commit | commitdiff | tree
Gary V. Vaughan [Tue, 6 May 2008 18:34:08 +0000 (14:34 -0400)]
Factor load functionality into include builtin.

* m4/module.c (m4__module_open): Instead of calling lt_dlopenext
right away, use the preload hint first incase path searching has
been disabled by POSIXLY_CORRECT. Otherwise fallback to a
manual path search to override libltdl's algorithm.
* m4/m4module.h: Adjust.
* m4/path.c (FILE_SUFFIXES): Order to try suffixes in our path
search algorithm.
(NO_SUFFIXES): Alternatively, how to to search a path without
adding file suffixes.
(m4_path_search): Add a new suffixes parameter defaulting to
NO_SUFFIXES. Adjust all callers.
(m4_load_filename): New generic load function that tries to
open a matched file first as a module, and if that fails fall
back to as (possibly frozen) m4 input.
(m4_fopen): New function with close on exec functionality.
* modules/m4.c (include, sinclude): Use m4_load_filename to
overload these builtins to work with modules too.
* modules/load.c (load): Removed this builtin.
* src/main.c: Remove Dynamic loading features section, and
M4MODPATH support.
(long_options): Remove "load-module", "unload-module" and
"module-directory" options.
(OPTSTRING): Remove 'M' and 'm' options.
(process_file): Use m4_load_filename to support module names
on the command line.
* Makefile.am (TESTS_ENVIRONMENT): No need for abs_top_builddir
any more.
* doc/m4.texinfo: Update examples.
(Dynamic loading features, Load): Removed.
(Command line files): Describe how non-option arguments are
treated to try to find a matching macro file or dso.
(Include): Describe additional dso loading features if a
suitable text file cannot be found.
(Modules): Updated.
* tests/builtins.at, tests/m4.in, tests/modules.at,
tests/options.at: Adjust test cases and calling conventions
to new semantics.
* NEWS: Updated.

17 years agoStage 22: allow builtin token concatenation outside $@.
commit | commitdiff | tree
Eric Blake [Sat, 3 May 2008 21:22:23 +0000 (15:22 -0600)]
Stage 22: allow builtin token concatenation outside $@.

* m4/m4module.h (m4_is_arg_composite): New prototype.
(m4_symbol_value_copy): Change return type.
(m4_arg_text): Add parameter.
(M4ARG): Adjust callers.
* m4/m4private.h: Adjust comments.
* m4/symtab.c (m4_symbol_value_copy): Detect when builtins are
flattened.
* m4/input.c (init_builtin_token): Add parameter, and allow
concatenating builtins.
(m4__next_token): Adjust caller.
* m4/macro.c (m4_is_arg_composite): New function.
(expand_argument): Allow builtin concatenation.
(m4_arg_text): Add parameter.
(m4__arg_adjust_refcount, m4__arg_print): Adjust callers.
(m4_arg_equal): Fix comparison of builtin tokens.
* modules/m4.c (define, pushdef): Warn when flattening builtins.
* doc/m4.texinfo (Define): Remove dead comment.
(Defn): Update to reflect code changes.
* tests/builtins.at (defn): Remove xfail.
* NEWS: Document this change.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoDocument define_blind.
commit | commitdiff | tree
Eric Blake [Sat, 3 May 2008 19:31:14 +0000 (13:31 -0600)]
Document define_blind.

* doc/m4.texinfo (Ifelse): Add a new composite macro.
* THANKS: Update.
Suggested by Mike R.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoAvoid -Wshadow compiler warnings.
commit | commitdiff | tree
Eric Blake [Thu, 1 May 2008 18:05:03 +0000 (12:05 -0600)]
Avoid -Wshadow compiler warnings.

* m4/output.c (threshold_diversion_CB): s/div/diversion/.
* m4/macro.c (make_argv_ref, arg_symbol, m4_arg_symbol)
(m4_is_arg_text, m4_is_arg_func, m4_arg_text, m4_arg_empty)
(m4_arg_len, m4_arg_func, m4__arg_print, m4_make_argv_ref)
(m4_push_arg, m4__push_arg_quote): s/index/arg/.
* modules/format.c (format): Likewise.
* modules/m4.c (ifelse): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoImprove debugmode testing, based on recent branch-1.6 regressions.
commit | commitdiff | tree
Eric Blake [Thu, 1 May 2008 14:53:18 +0000 (08:53 -0600)]
Improve debugmode testing, based on recent branch-1.6 regressions.

* doc/m4.texinfo (Debugmode): Enhance tests.
* tests/generate.awk: Run tests from stdin, not input.m4. Support
stderr munging when using -I examples.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoFix regression in define from 2008年02月22日.
commit | commitdiff | tree
Eric Blake [Thu, 1 May 2008 12:53:47 +0000 (06:53 -0600)]
Fix regression in define from 2008年02月22日.

* m4/m4module.h (m4_symbol_value_copy): Add parameter.
* m4/symtab.c (m4_symbol_value_copy): Support copying $@
back-references.
* m4/macro.c (expand_argument): Update callers.
* modules/m4.c (define, pushdef): Likewise.
* tests/builtins.at (define): Enhance test to catch this.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoSimplify previous patch.
commit | commitdiff | tree
Eric Blake [2008年4月22日 02:57:45 +0000 (20:57 -0600)]
Simplify previous patch.

* tests/m4.in: Compress assignment.
Suggested by Gary V. Vaughan.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoFix --disable-shared testsuite regression from previous patch.
commit | commitdiff | tree
Eric Blake [2008年4月21日 20:57:23 +0000 (14:57 -0600)]
Fix --disable-shared testsuite regression from previous patch.

* tests/m4.in: Export M4MODPATH, so that recursive m4 invocations
will also work.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoFix spelling of attribution to Christopher Strachey.
commit | commitdiff | tree
Eric Blake [2008年4月21日 22:27:01 +0000 (16:27 -0600)]
Fix spelling of attribution to Christopher Strachey.

* doc/m4.texinfo (History, Inhibiting Invocation): Fix typo.
* THANKS: Update.
Reported by Fernando Carrijo.

Signed-off-by: Eric Blake <ebb9@byu.net>
(cherry picked from commit 05528e98e0257bcccbb5001b8ff09293e42d19b6)

17 years agoFix testsuite bug when SIGPIPE is ignored.
commit | commitdiff | tree
Eric Blake [2008年4月17日 15:06:12 +0000 (09:06 -0600)]
Fix testsuite bug when SIGPIPE is ignored.

* tests/builtins.at (divert): Consume all of m4's output, to avoid
spurious write failure.
* src/main.c (main): In batch mode, restore default handling of
SIGPIPE.
* doc/m4.texinfo (Operation modes): Document SIGPIPE behavior.
* THANKS: Update.
Reported by Bob Proulx, via his autobuilder.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoFix 'make installcheck' after './configure --prefix-progname'.
commit | commitdiff | tree
Eric Blake [2008年4月16日 04:19:00 +0000 (22:19 -0600)]
Fix 'make installcheck' after './configure --prefix-progname'.

* tests/testsuite.at (AT_CHECK_M4): Allow overriding the m4
program name.
(HELP_OTHER, PREPARE_TESTS): Document and use $M4.
* tests/builtins.at (patsubst): Avoid space-tab.
(divert, mkdtemp, mkstemp): Adjust tests to use $M4.
* tests/options.at (--debugfile): Likewise.
* tests/others.at (stdin seekable): Likewise.
(fstab): Avoid space-tab.
* Makefile.am (installcheck-local): Accomodate transformed name.
(DISTCHECK_CONFIGURE_FLAGS): Ensure no regressions, by using gm4
during 'make distcheck'.
* cfg.mk: New file, borrowed from branch.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoUpdate prerequisite tools to match recent releases.
commit | commitdiff | tree
Eric Blake [2008年4月15日 19:41:21 +0000 (13:41 -0600)]
Update prerequisite tools to match recent releases.

* configure.ac (AC_PREREQ): Rely on released autoconf.
(LT_PREREQ): Rely on released libtool.
* tests/testsuite.at (m4_version_prereq): Update dependence.
* bootstrap: Mention prerequisites.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoWork around OS/2 limitation of printf(1).
commit | commitdiff | tree
Eric Blake [2008年4月15日 17:20:30 +0000 (11:20 -0600)]
Work around OS/2 limitation of printf(1).

* tests/null.m4: Use m4, not printf, to generate NUL byte.
* tests/null.out: Check for esyscmd failure.
Reported by Elbert Pol.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 21b: $@ concatenates builtins, m4wrap takes builtins.
commit | commitdiff | tree
Eric Blake [2008年4月14日 23:02:36 +0000 (17:02 -0600)]
Stage 21b: $@ concatenates builtins, m4wrap takes builtins.

* m4/m4module.h (m4_push_builtin): Add parameter.
(m4_builtin_print, m4_push_wrapup_init, m4_push_wrapup_finish)
(m4_arg_print, m4_symbol_value_print): Rename and reduce scope...
* m4/m4private.h (m4__builtin_print, m4__push_wrapup_init)
(m4__push_wrapup_finish, m4__arg_print, m4__symbol_value_print):
...to these, in some cases adding a parameter.
(m4__append_builtin): New prototype.
* m4/builtin.c (m4_builtin_print): Alter signature to print
builtin to a growing symbol chain.
* m4/symtab.c (m4__symbol_value_print): Alter signature.
(m4_symbol_print, dump_symbol_CB): Adjust callers.
* m4/input.c (builtin_peek, builtin_read, builtin_unget)
(builtin_print, builtin_funcs): Delete, handled via composite
blocks now.
(struct m4_input_block): Delete u.builtin member.
(init_builtin_token): Only use composite block.
(m4__append_builtin): New function.
(m4_push_builtin, m4__push_wrapup_init): Alter signature.
(m4__push_symbol): Allow builtin tokens.
(m4__push_wrapup_finish): Rename.
(composite_print, m4_print_token): Adjust callers.
* m4/macro.c (m4_wrap_args, collect_arguments): Allow builtin
tokens.
(m4__arg_print): Alter signature.
(trace_prepre, trace_pre, m4_arg_text, m4_arg_equal): Adjust
callers.
* modules/m4.c (m4wrap): Allow builtin tokens.
(defn, errprint): Adjust callers.
* modules/gnu.c (builtin): Likewise.
* doc/m4.texinfo (M4wrap): New test.
(Debuglen): Adjust expected output.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 21a: Optimize checks for end of input.
commit | commitdiff | tree
Eric Blake [2008年4月14日 14:16:32 +0000 (08:16 -0600)]
Stage 21a: Optimize checks for end of input.

* m4/input.c (eof_funcs, input_eof): New objects.
(eof_peek, eof_read, eof_unget): New functions.
(file_clean, m4_push_string_init, pop_input, m4_push_wrapup_init)
(m4_pop_wrapup, next_char, peek_char, unget_input, m4_input_init)
(m4_input_exit): Use placeholder to guarantee non-NULL isp and
wsp.
(next_char): Rename retry to allow_unget, and change sense for
easier manipulation. All callers changed.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoImprove OS/2 detection.
commit | commitdiff | tree
Eric Blake [2008年4月14日 23:14:33 +0000 (17:14 -0600)]
Improve OS/2 detection.

* modules/gnu.c (m4_macro_table): Ensure all possible identifiers
are defined, not just the first. The testsuite ensures that
exactly one gets defined.
* m4/system_.h [__EMX__]: OS/2 is not Unix-compatible, no matter
what other pre-defined macros it has.
* THANKS: Update.
Reported by Elbert Pol.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoEnsure __m4_version__ is unquoted.
commit | commitdiff | tree
Eric Blake [2008年4月10日 22:27:47 +0000 (16:27 -0600)]
Ensure __m4_version__ is unquoted.

* tests/builtins.at (__m4_@&t@version__): Augment test.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoAvoid GNU make failure on tarball.
commit | commitdiff | tree
Eric Blake [2008年4月14日 12:31:13 +0000 (06:31 -0600)]
Avoid GNU make failure on tarball.

* Makefile.am (EXTRA_DIST): Distribute cfg.mk and maint.mk.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoAllow back-referenced macro names; fixes 2008年03月13日 regression.
commit | commitdiff | tree
Eric Blake [2008年4月10日 17:51:27 +0000 (11:51 -0600)]
Allow back-referenced macro names; fixes 2008年03月13日 regression.

* m4/m4module.h (m4_symbol_value_lookup): Change prototype.
* m4/utility.c (m4_symbol_value_lookup): Change signature.
* modules/m4.c (undefine, popdef, ifdef, m4_dump_symbols, defn):
Adjust all callers.
* tests/others.at (ifndef): New test.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoBe namespace clean for M4 version; fixes 2008年04月08日 regression.
commit | commitdiff | tree
Eric Blake [2008年4月10日 17:09:03 +0000 (11:09 -0600)]
Be namespace clean for M4 version; fixes 2008年04月08日 regression.

* configure.ac (version): Rename...
(M4_VERSION): ...to this, since using 'version' broke po.m4.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoMention 1.4.11 release.
commit | commitdiff | tree
Eric Blake [Wed, 9 Apr 2008 22:51:52 +0000 (16:51 -0600)]
Mention 1.4.11 release.

* doc/m4.texinfo (History, Defn, Ifdef, Ifelse, M4wrap)
(Extensions, Improved foreach): Distinguish 1.4.11 and 1.6.
(Format): Add test of C99 hex-float parsing.
* NEWS: Mention 1.4.11 release.
* tests/builtins.at (divert): Add additional test.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoOverhaul inter-version releases to work with git.
commit | commitdiff | tree
Eric Blake [Tue, 8 Apr 2008 18:12:53 +0000 (12:12 -0600)]
Overhaul inter-version releases to work with git.

* configure.ac (version): New variable, which has nicer version
contents when using git 1.5.5+, hardcoded to 1.9a otherwise.
(TIMESTAMP): Delete, since CVS id expansion died with transition
to git.
(AM_INIT_AUTOMAKE): Use version to decide gnu vs. gnits.
* build-aux/mkstamp: Delete, no longer used.
* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Kill, to speed up
rebuilds when timestamps don't matter.
(MKSTAMP): Delete, no longer used.
(EXTRA_DIST): No longer worry about mkstamp.
(.version): New rule and distributed file.
(doc/m4.1, tests/package.m4): Depend on .version, not
configure.ac, for timestamp.
* ltdl/m4/gnulib-cache.m4: Import git-version-gen module.
* modules/gnu.c (__m4_version__): TIMESTAMP no longer exists.
* src/main.c (main): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoUse GNUmakefile module.
commit | commitdiff | tree
Eric Blake [2008年3月28日 12:44:20 +0000 (06:44 -0600)]
Use GNUmakefile module.

* ltdl/m4/gnulib-cache.m4: Import gnumakefile module.
* Makefile.am: Split off maintainer rules...
* maint.mk: ...into this new file.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 20b: make m4wrap obey POSIX fifo ordering.
commit | commitdiff | tree
Eric Blake [2008年3月18日 20:00:39 +0000 (14:00 -0600)]
Stage 20b: make m4wrap obey POSIX fifo ordering.

* m4/m4module.h (m4_wrap_args): Add prototype.
* m4/m4private.h (enum m4__symbol_chain_type): Add M4__CHAIN_LOC.
(struct m4__symbol_chain): Add struct u_l.
* m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Use
new link type.
(composite_peek, composite_read, composite_clean): Handle location
link.
* m4/macro.c (m4_wrap_args): New function.
* modules/m4.c (m4wrap): Use it.
* doc/m4.texinfo (M4wrap): Sync with branch and POSIX.
(Extensions): Document extension of multiple arguments.
(Location, Improved m4wrap): Adjust example to match FIFO order.
* tests/builtins.at (wrap): Likewise.
* NEWS: Document this change.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 20a: reduce unget's in input engine.
commit | commitdiff | tree
Eric Blake [2008年3月17日 22:03:57 +0000 (16:03 -0600)]
Stage 20a: reduce unget's in input engine.

* m4/input.c (struct input_funcs): Alter read_func prototype.
(next_char, file_read, buildin_read, string_read, composite_read):
Add allow_argv parameter.
(init_builtin_token, init_argv_symbol): Require all prior input to
be consumed.
(m4_skip_line, match_input, consume_syntax): Adjust callers.
(m4__next_token): Consume first byte without peek.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoUpdate for fresh bootstrap.
commit | commitdiff | tree
Eric Blake [2008年3月17日 14:16:45 +0000 (08:16 -0600)]
Update for fresh bootstrap.

* ltdl/m4/gnulib-cache.m4: Updated copyright from upstream.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoDocument join, in order to fix bug in m4wrap example.
commit | commitdiff | tree
Eric Blake [2008年3月16日 02:52:36 +0000 (20:52 -0600)]
Document join, in order to fix bug in m4wrap example.

* examples/join.m4: New file.
* examples/wraplifo2.m4: Likewise.
* Makefile.am (EXTRA_DIST): Add new files.
* doc/m4.texinfo (Improved m4wrap): New node.
(Defn, Location): Enhance tests.
(Shift): Document the composit macro join.
(Incompatibilities): Move documentation of LIFO vs. FIFO...
(M4wrap): ...here, to match improved example.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 19c: allow builtin tokens in more macros.
commit | commitdiff | tree
Eric Blake [2008年3月14日 03:01:39 +0000 (21:01 -0600)]
Stage 19c: allow builtin tokens in more macros.

* m4/m4module.h (m4_symbol_value_lookup, m4_builtin_print): New
prototypes.
* m4/m4private.h (enum m4__symbol_chain_type): Add
M4__CHAIN_FUNC.
(struct m4__symbol_chain): Add builtin member.
* m4/utility.c (m4_symbol_value_lookup): New method.
* m4/builtin.c (m4_builtin_print): New function.
* m4/symtab.c (m4_symbol_value_print): Use it.
* m4/input.c (builtin_print): Likewise.
(m4__push_symbol): Allow pushing builtin tokens.
(composite_peek, composite_read, composite_unget, composite_clean)
(composite_print): Handle builtin tokens.
(init_builtin_token): Allow builtin tokens from composite input.
(m4__next_token): Flatten builtins inside comment or string.
* m4/macro.c (expand_argument): Strengthen assertion.
(collect_arguments, m4_arg_equal, m4_arg_print, m4_push_args):
Handle builtin tokens.
(arg_symbol): Add parameter, and allow NULL level.
(m4_arg_symbol, m4__push_arg_quote): Adjust callers.
(m4_arg_text): Ensure all builtins have been flattened.
* modules/m4.c (defn, dumpdef, popdef, traceoff, traceon)
(undefine, m4_dump_symbols): Warn on invalid macro names.
(ifdef, ifelse, shift): Handle builtin tokens.
* modules/gnu.c (m4symbols): Likewise.
* doc/m4.texinfo (Defn, Ifdef, Ifelse): Document and test the new
behavior.
(Debuglen): Likewise, and remove xfail.
* NEWS: Mention the change.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 19b: invert sense of bit for handling builtin tokens.
commit | commitdiff | tree
Eric Blake [2008年3月13日 19:48:49 +0000 (13:48 -0600)]
Stage 19b: invert sense of bit for handling builtin tokens.

* m4/m4module.h (M4BUILTIN_ENTRY): New convenience macro.
(M4_BUILTIN_GROKS_MACRO): Rename...
(M4_BUILTIN_FLATTEN_ARGS): ...and invert sense.
(m4_symbol_value_groks_macro, m4_symbol_groks_macro): Likewise...
(m4_symbol_value_flatten_args, m4_symbol_flatten_args): ...to
this.
* m4/m4private.h (VALUE_MACRO_ARGS_BIT)
(m4_symbol_value_groks_macro): Likewise...
(VALUE_FLATTEN_ARGS_BIT, m4_symbol_value_flatten_args): ...to
this.
* m4/symtab.c (m4_symbol_value_groks_macro): Likewise...
(m4_symbol_value_flatten_args): ...to this.
* m4/macro.c (collect_arguments): Accomodate changed sense.
* m4/module.c (m4__module_open): Require arguments if flattening
is requested.
* m4/input.c (m4_push_string_finish): For now, flatten all
builtins pushed as back-references.
* modules/gnu.c (m4_builtin_table, builtin): Adjust all clients.
* modules/import.c (m4_builtin_table): Likewise.
* modules/load.c (m4_builtin_table): Likewise.
* modules/modtest.c (m4_builtin_table): Likewise.
* modules/mpeval.c (m4_builtin_table): Likewise.
* modules/perl.c (m4_builtin_table): Likewise.
* modules/shadow.c (m4_builtin_table): Likewise.
* modules/stdlib.c (m4_builtin_table): Likewise.
* modules/time.c (m4_builtin_table): Likewise.
* modules/m4.c (m4_builtin_table): Likewise.
(mkstemp): Undo #undef hack from 2006年10月23日, now that macro names
are stringized without preprocessor expansion.
* doc/m4.texinfo (Defn): Update comments to match reality.
(Debuglen): Update test now that user macros pass builtin tokens.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 19a: sort and cache builtins loaded by a module.
commit | commitdiff | tree
Eric Blake [2008年3月13日 19:43:15 +0000 (13:43 -0600)]
Stage 19a: sort and cache builtins loaded by a module.

* m4/m4module.h (m4_set_symbol_value_builtin): Delete. Use
m4_builtin_find_by_* instead.
(m4_builtin_find_by_func): Change return type.
* m4/m4private.h (m4__builtin): New struct.
(m4_module): Add sorted list of loaded builtins.
(struct m4_symbol_value): Change type of builtin value.
(m4__set_symbol_value_builtin): New prototype and fast accessor.
(m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
new field type.
* m4/symtab.c (m4_set_symbol_value_builtin): Rename...
(m4__set_symbol_value_builtin): ...and populate additional fields,
based on new type.
(m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
new field type.
* m4/module.c (install_builtin_table): Use cached table.
(compare_builtin_CB): New helper function.
(m4__module_open): Populate table.
(module_remove): Free table.
* m4/builtin.c (compare_builtin_name_CB): New helper function.
(m4_builtin_find_by_name): Rewrite to use sorted table.
(m4_builtin_find_by_func): Change return type.
* m4/input.c (struct m4_input_block): Simplify u_b, since most
fields can be determined from builtin.
(builtin_peek, builtin_read, builtin_unget, init_builtin_token)
(m4__next_token): Alter parsing so that only init_builtin_token
consumes a builtin.
(builtin_print, m4_push_builtin): Adjust all users.
* tests/macros.at (Arity, defn, and freeze): Fix typo.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoConsistently cast malloc results, for C++ compilation.
commit | commitdiff | tree
Eric Blake [2008年3月13日 18:06:23 +0000 (12:06 -0600)]
Consistently cast malloc results, for C++ compilation.

* m4/builtin.c (m4_builtin_find_by_name): Add cast.
* m4/hash.c (m4_hash_new, m4_get_hash_iterator_next, node_new)
(m4_hash_resize, maybe_grow): Likewise.
* m4/m4.c (m4_create): Likewise.
* m4/macro.c (expand_macro): Likewise.
* m4/output.c (m4_tmpname): Likewise.
* m4/path.c (search_path_add): Likewise.
* m4/symtab.c (m4_symtab_create, m4_symbol_value_create)
(symtab_fetch): Likewise.
* m4/syntax.c (m4_syntax_create): Likewise.
* modules/gnu.c (regexp_compile): Likewise.
* src/main.c (main): Likewise.
* src/freeze.c (reload_frozen_state): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoFix nested builtin(`shift',$@) regression from 2008年02月23日.
commit | commitdiff | tree
Eric Blake [Fri, 7 Mar 2008 03:56:44 +0000 (20:56 -0700)]
Fix nested builtin(`shift',$@) regression from 2008年02月23日.

* m4/macro.c (make_argv_ref): Don't output expansion text when
making wrapper for builtin or indir.
* tests/builtins.at (builtin): New test.
* NEWS: Document the fix.
Reported by Andreas Schwab.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoThe gnulib module free was deprecated.
commit | commitdiff | tree
Eric Blake [Wed, 5 Mar 2008 00:22:55 +0000 (17:22 -0700)]
The gnulib module free was deprecated.

* ltdl/m4/gnulib-cache.m4: Remove free module.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoImport news from 1.4.10b.
commit | commitdiff | tree
Eric Blake [2008年2月29日 15:28:17 +0000 (08:28 -0700)]
Import news from 1.4.10b.

* NEWS: Update from branch.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 18: try harder to reuse argv in recursion.
commit | commitdiff | tree
Eric Blake [2008年2月23日 02:54:48 +0000 (19:54 -0700)]
Stage 18: try harder to reuse argv in recursion.

* m4/macro.c (make_argv_ref): Avoid wrapping $@ when possible.
(m4_push_args): Let make_argv_ref take care of pending data.
* doc/m4.texinfo (Improved foreach): Tweak wording to match new
performance capability.
* tests/others.at (recursion): Add tests to avoid performance
regression.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoUpdate NEWS.
commit | commitdiff | tree
Eric Blake [2008年2月22日 19:57:57 +0000 (12:57 -0700)]
Update NEWS.

* NEWS: Document change to __gnu__ on 2008年02月11日.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 17: pass argv through quoted strings.
commit | commitdiff | tree
Eric Blake [2008年2月22日 12:43:04 +0000 (05:43 -0700)]
Stage 17: pass argv through quoted strings.

* m4/m4module.h (m4_arg_equal, m4_arg_len): Add parameter.
(M4ARGLEN): Adjust definition.
* m4/m4private.h (struct m4__symbol_chain): Add has_func member.
(struct m4_symbol_value): Add wrapper and has_func members.
(struct m4_macro_args): Add flatten and has_func members.
* m4/input.c (append_quote_token): Return argv refs inside quoted
strings.
(init_argv_symbol): Populate new fields.
* m4/macro.c (expand_argument, collect_arguments, make_argv_ref)
(m4_make_argv_ref): Likewise.
(arg_symbol, arg_mark, m4_is_arg_text, m4_is_arg_func): Use new
fields.
(m4_arg_equal, m4_arg_len): Handle quoted argv references, and add
new parameter.
* modules/m4.c (ifelse): Adjust caller.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoFix regression in argument collection, from 2008年01月21日.
commit | commitdiff | tree
Gary V. Vaughan [2008年2月21日 16:15:28 +0000 (00:15 +0800)]
Fix regression in argument collection, from 2008年01月21日.

* m4/input.c (m4__next_token): When DEBUG_INPUT is defined,
undo argument collection optimisation for strings, so that
m4_print_token doesn't abort when it otherwise receives an
unprintable M4_SYMBOL_VOID type token.

17 years agoStage 16: cache quotes and improve m4_arg_print.
commit | commitdiff | tree
Eric Blake [2008年2月21日 04:37:30 +0000 (21:37 -0700)]
Stage 16: cache quotes and improve m4_arg_print.

* m4/m4module.h (m4_symbol_value_print, m4_symbol_print)
(m4_arg_print): Adjust prototypes.
(m4_dump_args): Delete.
(m4_push_wrapup): Split...
(m4_push_wrapup_init, m4_push_wrapup_finish): ...into these
prototypes.
* m4/m4private.h (struct m4_syntax_table): Add cached_quote
member.
(m4__quote_cache, m4__quote_uncache): New prototypes.
* m4/syntax.c (m4_syntax_create): Initialize the cache.
(m4__quote_cache): New function.
(m4_set_syntax): Update caller.
* m4/symtab.c (m4_symbol_value_print): Add parameter.
(m4_symbol_print, dump_symbol_CB): Adjust all callers.
* m4/utility.c (m4_dump_args): Delete; callers should use
m4_arg_print instead.
* m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Split
implementation, and allow embedded NUL.
(m4_print_token, pop_input, composite_print, composite_peek):
(composite_read, append_quote_token): Adjust all callers.
* m4/macro.c (trace_prepre, m4_arg_text, make_argv_ref):
Likewise.
(m4_arg_print): Add parameters.
(trace_pre): Rewrite in terms of m4_arg_print.
* modules/m4.c (errprint): Likewise.
(m4wrap): Rewrite to allow embedded NUL.
(dumpdef): Adjust caller.
* doc/m4.texinfo (Debuglen): Enhance debuglen test.
* tests/null.m4: Test for NUL in m4wrap.
* tests/null.out: Update expected output.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoRevert accidental checkin from previous patch.
commit | commitdiff | tree
Eric Blake [2008年2月21日 03:07:14 +0000 (20:07 -0700)]
Revert accidental checkin from previous patch.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoFix out-of-bounds read for sanitized macro names, from 2008年02月06日.
commit | commitdiff | tree
Eric Blake [2008年2月21日 00:11:02 +0000 (17:11 -0700)]
Fix out-of-bounds read for sanitized macro names, from 2008年02月06日.

* m4/utility.c (m4_verror_at_line): Properly terminate the string.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years ago* doc/m4.texinfo (Debuglen, Changesyntax): Fix typos.
commit | commitdiff | tree
Eric Blake [2008年2月20日 14:57:41 +0000 (07:57 -0700)]
* doc/m4.texinfo (Debuglen, Changesyntax): Fix typos.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoClean up example on filtering defined symbols.
commit | commitdiff | tree
Eric Blake [2008年2月19日 19:18:05 +0000 (12:18 -0700)]
Clean up example on filtering defined symbols.

* doc/m4.texinfo (Foreach, Improved foreach): Document another
shortcoming in foreach.m4, and improve filter example by using
foreach2.m4.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years ago* src/main.c (usage): Fix typo.
commit | commitdiff | tree
Eric Blake [2008年2月19日 15:59:45 +0000 (08:59 -0700)]
* src/main.c (usage): Fix typo.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoAvoid some magic numbers.
commit | commitdiff | tree
Eric Blake [2008年2月18日 13:24:08 +0000 (06:24 -0700)]
Avoid some magic numbers.

* m4/m4private.h (CHAR_EOF, CHAR_BUILTIN, CHAR_QUOTE, CHAR_ARGV)
(CHAR_RETRY): Define in terms of UCHAR_MAX.
* m4/syntax.c (m4_syntax_create, set_syntax_set)
(reset_syntax_set, check_is_single_quotes)
(check_is_single_comments, check_is_macro_escaped)
(m4_set_quotes, m4_set_comment): Likewise.
* modules/gnu.c (regexp_compile): Likewise.
* modules/m4.c (translit): Likewise.
* src/freeze.c (produce_syntax_dump): Likewise.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoAdd regression test for multi-character quote recursion.
commit | commitdiff | tree
Eric Blake [2008年2月16日 21:39:41 +0000 (14:39 -0700)]
Add regression test for multi-character quote recursion.

* examples/foreach2.m4: Use 0ドル rather than spelling out name.
* examples/foreachq2.m4: Likewise.
* examples/forloop2.m4: Likewise.
* examples/hanoi.m4: Likewise.
* examples/trace.m4: Likewise.
* doc/m4.texinfo (Improved forloop): Document advantage of 0ドル.
(Improved foreach): Adjust dump from file.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 15: return argv refs back to collect_arguments.
commit | commitdiff | tree
Eric Blake [2008年2月16日 05:12:03 +0000 (22:12 -0700)]
Stage 15: return argv refs back to collect_arguments.

* m4/m4private.h (CHAR_ARGV): New input engine sentinel.
(enum m4__token_type): Add M4_TOKEN_ARGV.
(struct m4__symbol_chain): Add skip_last member to argv link.
(m4__next_token): Add parameter.
* m4/input.c (peek_char, file_peek, builtin_peek, string_peek)
(composite_peek, m4__next_token): Add new parameter.
(composite_read, append_quote_token): Support argv in quotes.
(init_argv_symbol): New function.
(m4__push_symbol, match_input, consume_syntax)
(m4__next_token_is_open, m4_print_token): Adjust callers.
* m4/macro.c (m4_macro_expand_input, m4__arg_adjust_refcount)
(arg_mark, m4_arg_text, make_argv_ref): Likewise.
(expand_argument, collect_arguments): Handle new token.
(arg_symbol): Drill through $@ reference.
* m4/syntax.c (set_quote_age): Detect disabled comments.
* m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Fix debug code.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years ago* modules/gnu.c (regexp_compile): Use a fastmap for regex speed.
commit | commitdiff | tree
Eric Blake [2008年2月15日 23:46:50 +0000 (16:46 -0700)]
* modules/gnu.c (regexp_compile): Use a fastmap for regex speed.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoFix texinfo grammar.
commit | commitdiff | tree
Eric Blake [2008年2月14日 02:02:33 +0000 (19:02 -0700)]
Fix texinfo grammar.

* doc/m4.texinfo (Eval, Incompatibilities): Use @. after capital.
(History): Use @: after abbreviations.
(M4exit): Use correct Latin abbreviation.
(Dumpdef, Debugmode, Frozen file format 2): Use correct spacing
between sentences.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoAllow builtin text macros to specify number of arguments.
commit | commitdiff | tree
Eric Blake [2008年2月11日 14:14:20 +0000 (07:14 -0700)]
Allow builtin text macros to specify number of arguments.

* m4/m4module.h (struct m4_macro): Add argument limits to builtin
text macros.
* m4/module.c (install_macro_table): Allow text macros to warn on
extra arguments.
* modules/gnu.c (m4_macro_table): Update all clients.
* modules/load.c (m4_macro_table): Likewise.
* modules/mpeval.c (m4_macro_table): Likewise.
* modules/perl.c (m4_macro_table): Likewise.
* modules/shadow.c (m4_macro_table): Likewise.
* modules/traditional.c (m4_macro_table): Likewise.
* modules/modtest.c (m4_macro_table): Likewise. Also add text
macros, for testing this.
* doc/m4.texinfo (Standard Modules): Update text, and enhance
test.
* tests/modules.at (modules: text): New test.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoFix regression in command line -D option, from 2006年08月25日.
commit | commitdiff | tree
Eric Blake [2008年2月11日 18:32:12 +0000 (11:32 -0700)]
Fix regression in command line -D option, from 2006年08月25日.

* m4/m4private.h (m4_symbol_value_create): Delete fast accessor.
* m4/m4module.h: Fix typo.
* m4/symtab.c (m4_symbol_value_create): Prime the maximum number
of arguments.
* tests/macros.at (Command line define): Enhance test.
* tests/others.at (nul character): Enhance test.
* tests/null.m4: Likewise.
* tests/null.out: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoUse gnulib's git-merge-changelog driver when available.
commit | commitdiff | tree
Eric Blake [2008年2月11日 18:19:18 +0000 (11:19 -0700)]
Use gnulib's git-merge-changelog driver when available.

* .gitattributes: Add merge attributes for ChangeLog.
* bootstrap: Install driver, if not already present.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoFix security hole introduced 2007年11月23日.
commit | commitdiff | tree
Eric Blake [Wed, 6 Feb 2008 19:01:29 +0000 (12:01 -0700)]
Fix security hole introduced 2007年11月23日.

* m4/utility.c (m4_verror_at_line): Properly escape macro names.
* src/main.c (main): Manage quoteargs defaults.
* doc/m4.texinfo (Indir): Document and test this.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoUsing raw strtod is not portable.
commit | commitdiff | tree
Eric Blake [Wed, 6 Feb 2008 18:17:29 +0000 (11:17 -0700)]
Using raw strtod is not portable.

* ltdl/m4/gnulib-cache.m4: Import the strtod module.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoConsistently use size_t for number of arguments.
commit | commitdiff | tree
Eric Blake [Sat, 2 Feb 2008 21:55:08 +0000 (14:55 -0700)]
Consistently use size_t for number of arguments.

* m4/m4module.h (m4_builtin_func): Alter prototype.
(struct m4_builtin): Adjust type of min_args, max_args.
(M4BUILTIN, M4BUILTIN_HANDLER): Adjust all builtins.
(m4_bad_argc, m4_dump_args, m4_macro_call, m4_arg_argc)
(m4_arg_symbol, m4_is_arg_text, m4_is_arg_func, m4_arg_text)
(m4_arg_equal, m4_arg_empty, m4_arg_len, m4_arg_func)
(m4_arg_print, m4_push_arg): Adjust all clients.
* m4/m4private.h (struct m4__symbol_chain, m4_symbol_value)
(m4_macro_args): Adjust type of various fields.
(m4__push_arg_quote): Adjust all clients.
* m4/input.c (m4_pop_wrapup): Likewise.
* m4/macro.c (m4_macro_call, trace_pre, make_argv_ref)
(arg_symbol, m4_arg_symbol, m4_is_arg_text, m4_is_arg_func)
(m4_arg_text, m4_arg_equal, m4_arg_empty, m4_arg_len)
(m4_arg_func, m4_arg_print, m4_make_argv_ref, m4_push_arg)
(m4__push_arg_quote, m4_push_args, m4_arg_argc): Likewise.
* m4/utility.c (m4_bad_argc, m4_dump_args): Likewise.
* modules/evalparse.c (m4_evaluate): Likewise.
* modules/gnu.c (changesyntax): Likewise.
* modules/m4.c (m4_dump_symbols, undefine, popdef, ifelse, defn)
(undivert, traceon, traceoff): Likewise.
* modules/m4.h (m4_dump_symbols_func): Likewise.
* modules/perl.c (perleval): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 14b: allow pushing argv references.
commit | commitdiff | tree
Eric Blake [Sat, 2 Feb 2008 14:34:08 +0000 (07:34 -0700)]
Stage 14b: allow pushing argv references.

* m4/m4private.h (struct m4__symbol_chain): Add comma and quotes
fields.
(struct m4_macro_args): Add level field.
(m4__arg_adjust_refcount, m4__push_arg_quote): New prototypes.
* m4/input.c (m4__push_symbol, composite_peek, composite_read)
(composite_unget, composite_clean, composite_print): Support $@
refs.
* m4/macro.c (collect_arguments): Populate new field.
(expand_macro): Move argv cleanup...
(m4__arg_adjust_refcount): ...to this new function.
(m4_arg_symbol, m4_make_argv_ref, m4_push_arg): Factor...
(arg_symbol, make_argv_ref, m4__push_arg_quote): ...to these new
helper functions, to add parameters.
(m4_push_args): Adjust caller.
* m4/symtab.c (m4_symbol_value_print): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 14a: allow printing argv references.
commit | commitdiff | tree
Eric Blake [Sat, 2 Feb 2008 14:33:34 +0000 (07:33 -0700)]
Stage 14a: allow printing argv references.

* m4/m4module.h (m4_arg_print): New prototype.
(m4_symbol_value_print): Alter prototype.
* m4/input.c (struct input_funcs): Add parameter to peek_func.
(file_peek, builtin_peek, string_peek): Ignore new parameter.
(composite_peek): Ignore new parameter, for now.
(composite_clean, pop_input): Rework to minimize indirection, and
to avoid infinite recursion in next patch.
* m4/macro.c (trace_prepre, trace_pre): Adjust callers.
(m4_arg_print): New function.
* m4/symtab.c (m4_symbol_value_print): Update signature.
(m4_symbol_print): Update caller.
* m4/output.c (m4_shipout_string_trunc): Update comments.
* m4/syntax.c (set_quote_age): Require comma as argument separator
when dealing with $@ as a unit.
* tests/builtins.at (ifelse): Augment test.
* doc/m4.texinfo (Changesyntax): Document changesyntax deficiency.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoKill hack for M4 1.4.4.
commit | commitdiff | tree
Eric Blake [Fri, 1 Feb 2008 05:22:32 +0000 (22:22 -0700)]
Kill hack for M4 1.4.4.

* configure.ac (AM_GNU_GETTEXT_INTL_SUBDIR): Delete, now that
we require new enough autoconf which in turn requires M4 1.4.5.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoDepend on new libtool to use non-recursive build.
commit | commitdiff | tree
Eric Blake [Fri, 1 Feb 2008 04:44:38 +0000 (21:44 -0700)]
Depend on new libtool to use non-recursive build.

* configure.ac (LT_PREREQ): Bump to alpha release version.
(LTDL_INIT): Choose nonrecursive mode. Perform sanity check that
installed libtool has correct symbols.
* Makefile.am (SUBDIRS): Drop ltdl, now that it is built from the
top level.
(AM_CPPFLAGS): Drop directories covered by libtool.
(AM_LDFLAGS): Drop -no-undefined, covered by libtool.
(include_HEADERS, noinst_LTLIBRARIES, EXTRA_LTLIBRARIES): New
macros, used by libtool.
(lib_LTLIBRARIES): Also used by libtool.
(ltdl/libltdlc.la): Delete, now that libtool does this.
* bootstrap: Mention new requirements.
(LIBTOOLIZE): Provide default program, and run libtoolize prior to
autoreconf.
(autoreconf): Also neutralize libtoolize, since it is run early.
* HACKING: Mention updated prerequisites.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoFix whitespace.
commit | commitdiff | tree
Eric Blake [Fri, 1 Feb 2008 04:35:27 +0000 (21:35 -0700)]
Fix whitespace.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoFix build failure if installed libltdl is used.
commit | commitdiff | tree
Ralf Wildenhues [2008年1月29日 02:23:19 +0000 (19:23 -0700)]
Fix build failure if installed libltdl is used.

* Makefile.am (m4_libm4_la_DEPENDENCIES): Use $(LTDLDEPS).

17 years agoDepend on newer autoconf, for testsuite -C dir.
commit | commitdiff | tree
Eric Blake [2008年1月28日 15:03:16 +0000 (08:03 -0700)]
Depend on newer autoconf, for testsuite -C dir.

* Makefile.am (CD_TESTDIR): Delete, no longer required.
(check-local, installcheck-local, clean-local-tests): Use new -C
option from autotest.
* configure.ac (AC_PREREQ): Bump to 2.61a.347.
* bootstrap: Mention new dependency.
* HACKING: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 13: push composite text tokens.
commit | commitdiff | tree
Eric Blake [2008年1月27日 04:39:25 +0000 (21:39 -0700)]
Stage 13: push composite text tokens.

* m4/m4private.h (m4__push_symbol): Adjust prototype.
* m4/input.c (m4__push_symbol): Add parameter, and support
composite tokens.
(append_quote_token): Add parameter, and support inlining of short
text.
(m4__next_token): Adjust caller.
* m4/macro.c (m4_push_arg, m4_push_args): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 12c: add macro for m4_arg_len.
commit | commitdiff | tree
Eric Blake [2008年1月26日 07:08:48 +0000 (00:08 -0700)]
Stage 12c: add macro for m4_arg_len.

* m4/m4module.h (M4ARGLEN): New macro.
* m4/macro.c (process_macro): Adjust all callers.
* m4/utility.c (m4_dump_args): Likewise.
* modules/m4.c (divert, maketemp, mkstemp, m4wrap, len, index)
(substr): Likewise.
* modules/gnu.c (builtin, indir, mkdtemp, patsubst, regexp)
(renamesyms): Likewise.
* modules/stdlib.c (setenv): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 12b: add m4_string_pair.
commit | commitdiff | tree
Eric Blake [2008年1月26日 06:49:38 +0000 (23:49 -0700)]
Stage 12b: add m4_string_pair.

* m4/m4module.h (m4_string_pair): New type.
(m4_get_syntax_quotes, m4_get_syntax_comments): New prototypes.
(m4_symbol_value_print, m4_symbol_print, m4_shipout_string_trunc):
Alter signature.
* m4/m4private.h (struct m4_string): Delete.
(struct m4_syntax_table): Combine quote and comment members.
(m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
(m4_get_syntax_ecomm): Adjust accessors.
(m4_get_syntax_quotes, m4_get_syntax_comments): New fast
accessors.
* m4/symtab.c (m4_symbol_value_print, m4_symbol_print):
Alter signatures.
* m4/input.c (string_print, composite_print, m4_input_print):
All callers updated.
* m4/syntax.c (m4_syntax_delete, m4_set_syntax)
(check_is_single_quotes, m4_set_quotes, set_quote_age)
(m4_get_syntax_lquote, m4_get_syntax_rquote)
(m4_get_syntax_quotes, check_is_single_comments, m4_set_comment)
(m4_get_syntax_bcomm, m4_get_syntax_ecomm)
(m4_get_syntax_comments): Likewise.
* m4/macro.c (trace_prepre, trace_pre, m4_push_args): Likewise.
* m4/output.c (m4_shipout_string, m4_shipout_string_trunc):
Likewise.
* modules/m4.c (dumpdef, m4_make_temp): Likewise.
* src/freeze.c (produce_frozen_state): Likewise.
* tests/freeze.at (reloading unknown builtin): Update test.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 12a: make m4_symbol_chain a union.
commit | commitdiff | tree
Eric Blake [2008年1月26日 05:45:17 +0000 (22:45 -0700)]
Stage 12a: make m4_symbol_chain a union.

* m4/m4private.h (enum m4__symbol_chain_type): New enum.
(struct m4_symbol_chain): Rename...
(struct m4__symbol_chain): ...to this, since it is internal.
* m4/symtab.c (m4_symbol_value_copy, m4_symbol_value_print): All
callers updated.
* m4/input.c (struct m4_input_block, m4__push_symbol)
(composite_peek, composite_read, composite_unget)
(composite_clean, m4__make_text_link, append_quote_token): Likewise.
* m4/macro.c (expand_macro, arg_mark, m4_arg_symbol, m4_arg_text)
(m4_arg_equal, m4_arg_len, m4_make_argv_ref, m4_push_arg)
(m4_push_args): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoAdjust to recent libtool interface change.
commit | commitdiff | tree
Eric Blake [2008年1月24日 01:10:40 +0000 (18:10 -0700)]
Adjust to recent libtool interface change.

* configure.ac (LT_PREREQ): Require bleeding-edge libtool.
(LT_WITH_LTDL): Delete, now that it is obsolete.
(LTDL_INIT): Use new libtool macro.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoRely on newer automake.
commit | commitdiff | tree
Eric Blake [2008年1月22日 20:35:00 +0000 (13:35 -0700)]
Rely on newer automake.

* configure.ac (AM_INIT_AUTOMAKE): Require 1.10.1, and add lzma
distribution.
* bootstrap: Update automake requirement.
(func_version): Fix --version output, broken since 2007年08月06日.
* HACKING: Likewise. Add lzma requirement.
* Makefile.am (clean-local-src): Not needed any more with newest
Automake.
(clean-local): Adjust.
* TODO: Remove completed item.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoDoc tweak.
commit | commitdiff | tree
Eric Blake [2008年1月22日 18:53:46 +0000 (11:53 -0700)]
Doc tweak.

* doc/m4.texinfo (Renamesyms): Avoid underfull hbox, and improve
example.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 11: full circle for single argument references.
commit | commitdiff | tree
Eric Blake [2008年1月21日 19:04:45 +0000 (12:04 -0700)]
Stage 11: full circle for single argument references.

Pass quoted strings through to argument collection in a single
action, so that an argument can be reused throughout macro
recursion if it remains unchanged.
Memory impact: noticeable improvement, due to more reuse in
argument collection stacks.
Speed impact: noticeable improvement, due to less copying.
* m4/m4module.h (m4_arg_text): Add parameter.
(M4ARG): Adjust.
* m4/m4private.h (CHAR_QUOTE): New input engine sentinel.
(m4__make_text_link): New prototype.
(struct m4_symbol_chain): Add quote_age member.
(struct m4_symbol_value): Add end member to chained symbol.
(struct m4_macro_args): Add wrapper member.
* m4/symtab.c (m4_symbol_value_print): Print composite tokens.
(m4_symbol_value_copy, m4_symbol_value_delete): Recognize
composite tokens.
* m4/input.c (make_text_link): Rename...
(m4__make_text_link): ...to this, and export.
(m4_push_string_finish): Adjust caller.
(make_text_link, m4__push_symbol): Update new field.
(file_read, builtin_read, string_read, composite_read, next_char):
Add parameter.
(m4_skip_line, match_input, consume_syntax): Adjust callers.
(append_quote_token): New function.
(m4__next_token): Pass quoted strings onto argument collection.
(m4_print_token) [DEBUG_INPUT]: Update.
* m4/macro.c (expand_argument): Collect composite arguments.
(collect_arguments): Update new field.
(expand_macro): Reduce ref-count of back-references after use.
(arg_mark, m4_arg_symbol, m4_make_argv_ref): Adjust to new member
names.
(m4_is_arg_text): Also recognize composite symbols as text.
(m4_arg_text, m4_arg_len): Merge composite symbols as needed.
(m4_arg_equal): Compare composite symbols.
(m4_push_arg, m4_push_args): Handle composite symbols.
(m4_arg_symbol): Relax assertion.
(process_macro): Use single-argument references.
* m4/output.c (m4_shipout_string_trunc): Update comment.
* tests/macros.at (Rescanning macros): Augment test.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 10: avoid extra copying of strings and comments.
commit | commitdiff | tree
Eric Blake [2008年1月16日 14:28:32 +0000 (07:28 -0700)]
Stage 10: avoid extra copying of strings and comments.

* ltdl/m4/gnulib-cache.m4: Import intprops and vasnprintf-posix
modules.
* m4/m4private.h (m4__token_type): Adjust prototype.
* m4/input.c (m4__next_token): Support new parameter.
* m4/macro.c (m4_macro_expand_input, expand_token)
(expand_argument, collect_arguments): Adjust callers.
* modules/m4.c (ntoa): Tighten buffer size.
* m4/output.c (m4_tmpname): Guarantee no buffer overflow.
* modules/format.c (arg_int, arg_long, arg_double): New helper
functions, to detect overflow or unparsed characters.
(ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Adjust to check for
missing or excess arguments.
(format): Likewise, and also output directly into obstack if there
is room.
* doc/m4.texinfo (History): Update for new year.
(Format): Test for new warnings.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years ago* TODO: Update with some newer URLs.
commit | commitdiff | tree
Eric Blake [2008年1月15日 04:55:45 +0000 (21:55 -0700)]
* TODO: Update with some newer URLs.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoVerify linear `index'.
commit | commitdiff | tree
Eric Blake [2008年1月15日 04:43:02 +0000 (21:43 -0700)]
Verify linear `index'.

* tests/builtins.at (index): New test.
(translit): Make test take longer, to make quadratic algorithms
more apparent.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoGive better summaries of StageN patches in ChangeLog.
commit | commitdiff | tree
Eric Blake [Wed, 9 Jan 2008 16:37:50 +0000 (09:37 -0700)]
Give better summaries of StageN patches in ChangeLog.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 9: share rather than copy single-arg refs.
commit | commitdiff | tree
Eric Blake [2007年12月20日 17:56:29 +0000 (10:56 -0700)]
Stage 9: share rather than copy single-arg refs.

* ltdl/m4/gnulib-cache.m4: Import memmem and quote modules.
* m4/m4module.h (m4_arg_scratch): New prototype.
* m4/m4private.h (m4__push_symbol): Add parameter.
(m4_arg_scratch): Add fast accessor.
(struct m4): Add expansion_level member, taken...
* m4/macro.c (expansion_level): ...from here. Adjust all users.
(expand_argument): Minor cleanup.
(expand_macro): Track scratch space per macro call.
(m4_arg_scratch): New function.
(m4_make_argv_ref): Call new function.
(m4_push_arg): Push reference to 0ドル.
(m4_push_args): Rework separator usage, since separators will
usually be inlined.
(process_macro): Allow embedded NUL.
* m4/input.c (INPUT_INLINE_THRESHOLD): New define.
(m4__push_symbol): Add parameter. Inline short strings, and save
references through rescanning.
* m4/symtab.c (m4_set_symbol_value_text): Weaken assertion.
* modules/m4.c (errprint, index): Handle NUL transparently.
(dumpdef, translit): Use scratch space, rather than expansion
stack.
* modules/gnu.c (renamesyms, m4symbols): Likewise.
* tests/others.at (nul character): New test.
(iso8859): Quote absolute file name, remove XFAIL.
* tests/iso8859.m4: Avoid raw NUL in output.
* tests/null.m4: New file.
* tests/null.out: Likewise.
* tests/null.err: Likewise.
* Makefile.am (OTHER_FILES): Distribute new files.
* .gitattributes: Treat new files as text.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 8: extend life of references into argv.
commit | commitdiff | tree
Eric Blake [2007年12月17日 16:28:39 +0000 (09:28 -0700)]
Stage 8: extend life of references into argv.

* m4/system_.h (obstack_regrow): Delete.
* m4/m4private.h (struct m4_symbol_chain): Add level field.
(m4__push_symbol): Adjust prototype.
(m4__adjust_refcount): New prototype.
(DEBUG_MACRO) [DEBUG]: New debug control.
(struct m4__macro_arg_stacks): New structure.
(struct m4): Add arg_stacks, stacks_count fields.
* m4/m4module.h (m4_make_argv_ref): Add parameter.
* m4/macro.c (argc_stack, argv_stack): Delete, replaced by
context->arg_stacks.
(m4_macro_expand_input) [DEBUG_MACRO]: Add debug hooks,
conditional on M4_DEBUG_MACRO envvar.
(collect_arguments): Adjust signature.
(expand_macro): Rework obstack handling.
(m4__adjust_refcount, arg_mark): New functions.
(m4_make_argv_ref): Populate new field.
(m4_push_arg, m4_push_args): Track inuse.
(process_macro): One less cast.
* m4/m4.c (m4_delete): Clean up arg_stacks.
* m4/input.c (make_text_link): Use new field.
(m4__push_symbol, file_clean): Update signature.
(composite_read): Bump refcount when done with reference.
(composite_clean): New function.
(pop_input): Adjust caller.
* m4/debug.c (m4_debug_message): Make assertion match comment.
* modules/gnu.c (builtin, indir): Adjust callers.
* tests/builtins.at (ifelse): New test.
(exp): Move and rename...
* tests/others.at (countdown): ...to this.
* doc/m4.texinfo (Improved foreach): Fix tracing usage in
example.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoYet more rewording.
commit | commitdiff | tree
Eric Blake [2007年12月13日 18:47:55 +0000 (11:47 -0700)]
Yet more rewording.

* doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
the previous patch.

Signed-off-by: Eric Blake <ebb9@byu.net>
(cherry picked from commit da38cc2a2e8272f41366ed87aee5abe64e81c3f9)

17 years ago* THANKS: Update.
commit | commitdiff | tree
Eric Blake [2007年12月13日 17:53:26 +0000 (10:53 -0700)]
* THANKS: Update.

Signed-off-by: Eric Blake <ebb9@byu.net>
(cherry picked from commit 4167d5ca75e32eef51c7ad7d3efececdbe394d93)

17 years ago* doc/m4.texinfo: Fix quoting of a quoting example.
commit | commitdiff | tree
Paolo Bonzini [2007年12月13日 17:53:14 +0000 (10:53 -0700)]
* doc/m4.texinfo: Fix quoting of a quoting example.

Reported by Giovanni Toffetti.
(cherry picked from commit ba5c56ec45729eefb5687f4f272c6b08baa44030)

17 years agoStage 7: use chained input support in input parser.
commit | commitdiff | tree
Eric Blake [2007年12月11日 16:36:08 +0000 (09:36 -0700)]
Stage 7: use chained input support in input parser.

* m4/m4private.h (m4__push_symbol): New prototype.
(struct m4_symbol_chain): Add const-safety.
* m4/symtab.c (m4_symbol_value_print): Simplify.
(dump_symbol_CB): Update caller.
* m4/input.c (struct m4_input_block): Alter u_c member, first
introduced 2006年10月25日, but unused until now.
(composite_peek, composite_read, composite_unget)
(composite_print, init_builtin_token): Rewrite accordingly.
(m4_push_wrapup): No longer need trailing NUL.
(m4__push_symbol, make_text_link): New functions.
(m4_push_string_finish): Use them.
* m4/macro.c (m4_push_arg, m4_push_args): Likewise.
(expand_macro): Simplify logic of nesting_limit.
* src/main.c (main): Likewise.
* doc/m4.texinfo (Dumpdef): Augment test.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 6: convert builtins to push arg at a time.
commit | commitdiff | tree
Eric Blake [Sun, 9 Dec 2007 04:05:11 +0000 (21:05 -0700)]
Stage 6: convert builtins to push arg at a time.

* m4/m4module.h (m4_shipout_text): Rename...
(m4_divert_text): ...to this, to avoid confusion with m4_shipout_*
that does not worry about sync lines.
(m4_shipout_string_trunc): New prototype.
* m4/output.c (m4_shipout_text): Rename...
(m4_divert_text): ...to this.
(m4_shipout_string): Move guts...
(m4_shipout_string_trunc): ...to this new function.
* m4/macro.c (m4_push_arg, m4_push_args): New functions.
(expand_token, process_macro): Update callers.
* m4/input.c (string_print): Likewise.
* modules/m4.c (ifdef, ifelse, shift, substr, translit, divert):
Likewise.
* modules/gnu.c (patsubst): Likewise.
(debuglen): Use SIZE_MAX for unlimited debug length.
* src/main.c (main): Likewise.
* m4/m4.c (m4_create): Default max_debug_length to SIZE_MAX, not
zero.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoMinor security fix: Quote output of mkstemp.
commit | commitdiff | tree
Eric Blake [Fri, 7 Dec 2007 21:11:21 +0000 (14:11 -0700)]
Minor security fix: Quote output of mkstemp.

* modules/m4.c (m4_make_temp): Produce quoted output.
* doc/m4.texinfo (Mkstemp, Mkdtemp): Update the documentation and
tests.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 5: add notion of quote age.
commit | commitdiff | tree
Eric Blake [Fri, 7 Dec 2007 05:14:22 +0000 (22:14 -0700)]
Stage 5: add notion of quote age.

* m4/m4module.h (m4_get_symbol_value_quote_age): New prototype.
(m4_set_symbol_value_text): Adjust prototype.
(m4_has_syntax): Factor out the unsigned char cast.
* m4/m4private.h (struct m4_syntax_table): Add syntax_age and
quote_age members.
(m4__quote_age, m4__safe_quotes): New accessor macros, no need for
functions at this point.
(struct m4_symbol_value, struct m4_macro_args): Add quote_age
member.
(m4_set_symbol_value_text): Adjust fast accessor.
(m4_get_symbol_value_quote_age): New fast accessor.
* m4/symtab.c (m4_set_symbol_value_text): Add parameter.
(m4_get_symbol_value_quote_age): New function.
(m4_symbol_value_copy): Adjust callers.
* m4/macro.c (expand_token): Add parameter, and track quote age.
(expand_argument, collect_arguments): Track quote age.
(m4_macro_expand_input, process_macro, m4_make_argv_ref)
(m4_macro_expand_input): Update callers.
(m4_arg_text, m4_arg_len, m4_arg_func): Abort on type mismatch.
* m4/input.c: Comment cleanups.
(struct m4_input_block): Reduce size.
(m4__next_token): Report quote age.
(m4_push_builtin, init_builtin_token): Update callers.
* m4/utility.c (skip_space): Adjust callers.
* m4/module.c (install_macro_table): Likewise.
* m4/syntax.c (m4_set_syntax): Initialize and update quote age.
(m4_set_quotes, m4_set_comment): Detect no-op changes, and update
quote age.
(set_quote_age): New helper function.
(check_is_single_quotes, check_is_single_comments): Adjust
callers.
* src/freeze.c (reload_frozen_state): Likewise.
* src/main.c (main): Likewise.
* modules/m4.c (define, pushdef): No need to set macro text.
* tests/builtins.at (changequote, defn): New tests.
* examples/wrapfifo.m4: New file.
* examples/wraplifo.m4: New file.
* Makefile.am (dist_pkgdata_DATA): Distribute new examples.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agognulib-tool doesn't recognize config.*.
commit | commitdiff | tree
Eric Blake [Tue, 4 Dec 2007 16:00:30 +0000 (09:00 -0700)]
gnulib-tool doesn't recognize config.*.

* build-aux/.cvsignore: Explicitly ignore config.rpath, for gnulib-tool.
* build-aux/.gitignore: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoFix builds with OpenBSD make.
commit | commitdiff | tree
Eric Blake [Tue, 4 Dec 2007 13:43:29 +0000 (06:43 -0700)]
Fix builds with OpenBSD make.

* Makefile.am (HELP2MAN): New macro.
(dist_man_MANS, doc/m4.1): Fix rules for building m4.1 into
srcdir.
* README: Update copyright.
* HACKING: Mention help2man and makeinfo dependencies.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 4: route indir, builtin through ref; make argv opaque.
commit | commitdiff | tree
Eric Blake [2007年11月30日 04:26:22 +0000 (21:26 -0700)]
Stage 4: route indir, builtin through ref; make argv opaque.

* m4/system_.h (obstack_regrow): Fix precedence.
* m4/m4module.h (m4_arg_equal, m4_arg_empty, m4_make_argv_ref):
New prototypes.
(struct m4_macro_args): Move...
* m4/m4private.h (struct m4_macro_args): ...here, making it opaque
to modules. Add has_ref member.
(bool_bitfield): New helper typedef.
(struct m4_symbol_chain): Add flatten and len members.
* m4/macro.c (empty_symbol): New placeholder, for optimizing
comparison with empty string.
(m4_macro_expand_input): Initialize it.
(collect_arguments): Alter signature, and populate new fields.
(trace_pre, trace_post): Remove redundant parameter.
(expand_macro): Alter handling of obstacks.
(m4_arg_symbol): Account for wrapped argv.
(m4_arg_equal, m4_arg_empty, m4_make_argv_ref): New methods.
(m4_arg_text, m4_arg_len, m4_arg_func): Use new methods.
* modules/m4.c (ifelse, syscmd): Likewise.
* modules/evalparse.c (m4_evaluate): Likewise.
(undefine, popdef, m4_dump_symbols): Optimize.
* modules/gnu.c (builtin, indir, esyscmd, debugfile): Use new
methods.
(changesyntax, regexp): Optimize.
* m4/output.c (diversion_storage): Use typedef.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 3b: cache length, rather than computing it, in modules.
commit | commitdiff | tree
Eric Blake [2007年11月28日 21:03:48 +0000 (14:03 -0700)]
Stage 3b: cache length, rather than computing it, in modules.

* m4/hash.c (m4_hash_remove): Avoid double free on remove
failure.
* m4/output.c (m4_shipout_string): Change semantics of len param.
(m4_shipout_int): Use cached length.
* m4/input.c (m4_push_string_finish): Likewise.
* modules/m4.h (m4_make_temp_func): Add parameter.
* m4/macro.c (expand_token, m4_arg_len): Use cached length.
(collect_arguments, expand_macro): Alter signature.
(trace_format): Don't use out-of-scope buffer.
(process_macro): All callers changed.
* m4/utility.c (m4_dump_args): Likewise.
* m4/symtab.c (m4_symbol_value_print): Likewise.
* modules/gnu.c (__file__, __program__, builtin, indir)
(m4symbols, mkdtemp, regexp_compile, regexp_substitute,
renamesyms, patsubst, regexp, regexp_compile): Likewise.
* modules/load.c (m4modules): Likewise.
* modules/m4.c (defn, m4wrap, maketemp, m4_make_temp)
(numb_obstack, ifdef, ifelse, divert, len, substr): Likewise.
* modules/perl.c (perleval): Likewise.
* modules/stdlib.c (getcwd, getenv, getlogin, getpwnam, getpwuid)
(hostname, uname, setenv): Likewise.
* modules/mpeval.c (numb_obstack): Likewise.
* src/freeze.c (dump_symbol_CB): Likewise.
* doc/m4.texinfo (Renamesyms, Dumpdef, Changesyntax): Adjust test.
* tests/builtins.at (mkstemp): Likewise.
* tests/others.at (iso8859): XFAIL this test, now that
length-based handling allows NUL through part but not all of M4.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 3a: cache length, rather than computing it, in libm4.
commit | commitdiff | tree
Eric Blake [2007年11月28日 13:45:20 +0000 (06:45 -0700)]
Stage 3a: cache length, rather than computing it, in libm4.

* m4/m4module.h (struct m4_macro_args): Cache length.
(m4_get_symbol_len, m4_get_symbol_value_len): New accessors.
(m4_set_symbol_value_text): Change signature.
* m4/m4private.h (struct m4_symbol_value): Store string length.
(m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
(m4_set_symbol_value_placeholder): Update accordingly.
(m4_set_symbol_value_text): Change signature.
(m4_get_symbol_value_len): New accessor.
* m4/input.c (struct m4_input_block, string_peek, string_read)
(string_unget, string_print, m4_push_string_finish)
(m4_push_wrapup): Track length of string input.
(m4__next_token): Adjust all users of symbol text to track length,
too.
* m4/macro.c (expand_argument, collect_arguments): Likewise.
* m4/module.c (install_macro_table): Likewise.
* modules/gnu.c (builtin, indir): Likewise.
* modules/m4.c (define, pushdef): Likewise.
* src/main.c (main): Likewise.
* src/freeze.c (reload_frozen_state): Likewise.
* m4/symtab.c (m4_symbol_value_copy): Likewise.
(m4_get_symbol_value_len): New function.
(m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
(m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
Adjust implementation.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 2: use accessors, not direct reference, into argv.
commit | commitdiff | tree
Eric Blake [2007年11月27日 17:15:48 +0000 (10:15 -0700)]
Stage 2: use accessors, not direct reference, into argv.

* m4/m4private.h (m4_arg_argc): New fast accessor.
* m4/m4module.h (m4_arg_argc, m4_arg_symbol, m4_is_arg_text)
(m4_is_arg_func, m4_arg_text, m4_arg_len, m4_arg_func): New
prototypes.
(m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
(m4_macro_call): Make argc unsigned.
(M4ARG): Use new accessors.
* modules/m4.c (define, pushdef): Likewise.
(undefine, popdef, ifelse, m4_dump_symbols, defn, undivert)
(traceon, traceoff): Make argc unsigned.
* modules/m4.h (m4_dump_symbols_func): Likewise.
* modules/evalparse.c (m4_evaluate): Likewise.
* modules/gnu.c (builtin, indir): Use new accessors.
(changesyntax): Make argc unsigned.
* modules/perl.c (perleval): Likewise.
* m4/utility.c (m4_dump_args): Use new accessors.
* m4/macro.c (trace_pre): Likewise.
(m4_arg_symbol, m4_arg_argc, m4_is_arg_text, m4_is_arg_func)
(m4_arg_text, m4_arg_len, m4_arg_func): New functions.
(expand_macro, trace_pre, trace_post, m4_macro_call): Update argc
usage.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoStage 1: convert m4_symbol_value** into new object.
commit | commitdiff | tree
Eric Blake [2007年11月24日 23:23:47 +0000 (16:23 -0700)]
Stage 1: convert m4_symbol_value** into new object.

* ltdl/m4/gnulib-cache.m4: Import flexmember module.
* m4/m4module.h (m4_macro_args): New type, will be opaque to
modules later.
(m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
(m4_macro_call): Alter signature to use m4_macro_args object.
(M4ARG): Redefine to access new struct.
* m4/m4private.h (M4_SYMBOL_COMP): New enumerator.
(struct m4_symbol_chain): New type.
(struct m4_symbol_value): Add chain alternative.
* m4/macro.c (collect_arguments): Build new struct.
(expand_macro, m4_macro_call, process_macro, trace_pre)
(trace_post): Adjust implementation to use it.
* m4/utility.c (m4_dump_args): Likewise.
* modules/gnu.c (builtin, indir): Likewise.
* modules/format.c (format): Likewise.
* modules/m4.h (m4_dump_symbols_func): Likewise.
* modules/m4.c (m4_dump_symbols, define, pushdef, defn, ifelse)
(shift, include, errprint, m4wrap): Likewise.
* modules/evalparse.c (m4_evaluate): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoPass only macro name to utility functions.
commit | commitdiff | tree
Eric Blake [2007年11月24日 14:04:18 +0000 (07:04 -0700)]
Pass only macro name to utility functions.

* m4/m4module.h (m4_bad_argc, m4_numeric_arg): Adjust signature.
* m4/utility.c (m4_bad_argc, m4_numeric_arg): Adjust
implementation.
* m4/macro.c (m4_macro_call): Adjust callers.
* modules/gnu.c (builtin, debuglen): Likewise.
* modules/m4.c (ifelse, incr, decr, divert, undivert, m4exit)
(substr): Likewise.
* modules/evalparse.c (m4_evaluate): Likewise.
* modules/stdlib.c (setenv, getpwuid, srand): Likewise.
* modules/time.c (ctime, gmtime, localtime, mktime, strftime):
Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoAdd macro name to debugfile messages.
commit | commitdiff | tree
Eric Blake [2007年11月23日 23:14:17 +0000 (16:14 -0700)]
Add macro name to debugfile messages.

* m4/m4module.h (m4_debug_set_output): Add parameter.
* m4/debug.c (m4_debug_set_output, set_debug_file): Pass macro
name through.
* modules/gnu.c (debugfile): Adjust caller.
* modules/m4.c (m4exit): Likewise.
* src/main.c (main): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoFactor out handling of macro name in error messages.
commit | commitdiff | tree
Eric Blake [2007年11月23日 22:18:40 +0000 (15:18 -0700)]
Factor out handling of macro name in error messages.

* m4/m4module.h (m4_error, m4_error_at_line, m4_warn)
(m4_warn_at_line): Add new parameter.
* m4/utility.c (m4_verror_at_line): New helper method.
(m4_error, m4_error_at_line, m4_warn, m4_warn_at_line): Add new
parameter.
(m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg): All callers
changed.
* m4/debug.c: Likewise.
* m4/input.c: Likewise.
* m4/macro.c: Likewise.
* m4/module.c: Likewise.
* m4/output.c: Likewise.
* m4/path.c: Likewise.
* modules/evalparse.c: Likewise.
* modules/format.c: Likewise.
* modules/gnu.c: Likewise.
* modules/load.c: Likewise.
* modules/m4.c: Likewise.
* modules/mpeval.c: Likewise.
* src/freeze.c: Likewise.
* src/main.c: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoHandle some defn corner cases differently.
commit | commitdiff | tree
Eric Blake [2007年11月14日 23:39:43 +0000 (16:39 -0700)]
Handle some defn corner cases differently.

* doc/m4.texinfo (Defn): Update documentation; although this still
doesn't match the branch, since it may be changed before 2.0.
* m4/macro.c (expand_argument): Consistently ignore builtins in
concatenation contexts.
* m4/m4private.h (m4__symbol_type): Fix C89 compliance bug.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoFix memory leak in tail recursion.
commit | commitdiff | tree
Eric Blake [2007年11月13日 21:08:16 +0000 (14:08 -0700)]
Fix memory leak in tail recursion.

* m4/input.c (pop_input): Add flag parameter and return type.
(next_char): Adjust caller.
(m4_push_string_init): Let go of memory earlier.

Signed-off-by: Eric Blake <ebb9@byu.net>
(cherry picked from commit 6bfe1ba306cacd8d9316647f3b9f276cf56b31a8)

17 years agoMore corner case testing.
commit | commitdiff | tree
Eric Blake [Wed, 7 Nov 2007 15:13:43 +0000 (08:13 -0700)]
More corner case testing.

* tests/macros.at (Rescanning macros): Test more corner cases.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years ago* build-aux/mkstamp: Rename from ltdl/config/mkstamp.
commit | commitdiff | tree
Eric Blake [Tue, 6 Nov 2007 13:29:27 +0000 (06:29 -0700)]
* build-aux/mkstamp: Rename from ltdl/config/mkstamp.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years ago* Makefile.am (tests/package.m4): Work around bash bug.
commit | commitdiff | tree
Eric Blake [Tue, 6 Nov 2007 13:14:37 +0000 (06:14 -0700)]
* Makefile.am (tests/package.m4): Work around bash bug.

Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoIgnore bootstrap leftovers.
commit | commitdiff | tree
Eric Blake [Mon, 5 Nov 2007 20:14:03 +0000 (13:14 -0700)]
Ignore bootstrap leftovers.

Signed-off-by: Eric Blake <ebb9@byu.net>
17 years agoFor consistency with other GNU projects, use build-aux directory.
commit | commitdiff | tree
Eric Blake [Mon, 5 Nov 2007 20:11:17 +0000 (13:11 -0700)]
For consistency with other GNU projects, use build-aux directory.

* configure.ac (AC_CONFIG_AUX_DIR): Change ltdl/config to
build-aux.
* bootstrap (config_aux_dir): Likewise.
* Makefile.am (config_aux_dir): Likewise.
* ltdl/m4/gnulib-cache.m4: Use --aux-dir option.

Signed-off-by: Eric Blake <ebb9@byu.net>
next
GNU M4 source repository
RSS Atom

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