From 4af40c4d6f65e3d311ef4643b6b3bdb9729a9db6 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Mon, 11 Feb 2008 07:14:20 -0700 Subject: 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 --- m4/m4module.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'm4/m4module.h') 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. */ -- cgit v1.2.1