summaryrefslogtreecommitdiff
path: root/m4/m4module.h
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2008-02-11 07:14:20 -0700
committerEric Blake <ebb9@byu.net>2008-02-11 13:33:08 -0700
commit4af40c4d6f65e3d311ef4643b6b3bdb9729a9db6 (patch)
treedf8c65019d968f7175a1d837819cc8beb74c8f7a /m4/m4module.h
parent7a7a1413755c74b416295b13fe90eef3bffa7345 (diff)
downloadm4-4af40c4d6f65e3d311ef4643b6b3bdb9729a9db6.tar.gz
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>
Diffstat (limited to 'm4/m4module.h')
-rw-r--r--m4/m4module.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/m4/m4module.h b/m4/m4module.h
index 5f144be2..a807e70b 100644
--- a/m4/m4module.h
+++ b/m4/m4module.h
@@ -75,6 +75,9 @@ struct m4_macro
{
const char *name;
const char *value;
+ size_t min_args; /* 0-based minimum number of arguments */
+ /* max arguments, SIZE_MAX if unlimited; must be >= min_args */
+ size_t max_args;
};
/* Describe a pair of strings, such as begin and end quotes. */