From 578bd023ea85d57d8488b8cb88265fbe3a3071e4 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Sun, 22 Sep 2013 09:49:06 +0700 Subject: configury: move usage examples into doc subdirectory. * examples: Move from here... * doc/examples: ...to here. * Makefile.am (EXTRA_DIST, dist_pkgdata_DATA): Adjust. * README, doc/m4.texi, tests/builtins.at, tests/generate.awk, tests/others.at: Likewise. Signed-off-by: Gary V. Vaughan --- Makefile.am | 146 +++++++++++------------ README | 4 +- doc/examples/COPYING | 8 ++ doc/examples/WWW/COPYING | 8 ++ doc/examples/WWW/Makefile | 45 +++++++ doc/examples/WWW/_footer.htm | 10 ++ doc/examples/WWW/_header.htm | 231 +++++++++++++++++++++++++++++++++++ doc/examples/WWW/m4lib/COPYING | 8 ++ doc/examples/WWW/m4lib/bugs.m4 | 53 ++++++++ doc/examples/WWW/m4lib/changelog.m4 | 18 +++ doc/examples/WWW/m4lib/download.m4 | 24 ++++ doc/examples/WWW/m4lib/features.m4 | 58 +++++++++ doc/examples/WWW/m4lib/feedback.m4 | 20 ++++ doc/examples/WWW/m4lib/html.m4 | 122 +++++++++++++++++++ doc/examples/WWW/m4lib/index.m4 | 36 ++++++ doc/examples/WWW/m4lib/layout.m4 | 65 ++++++++++ doc/examples/WWW/m4lib/lists.m4 | 32 +++++ doc/examples/WWW/m4lib/menu.m4 | 74 ++++++++++++ doc/examples/WWW/m4lib/modules.m4 | 18 +++ doc/examples/WWW/m4lib/news.m4 | 18 +++ doc/examples/WWW/m4lib/readme.m4 | 18 +++ doc/examples/WWW/m4lib/setup.m4 | 7 ++ doc/examples/WWW/m4lib/test.m4 | 29 +++++ doc/examples/WWW/m4lib/thanks.m4 | 18 +++ doc/examples/WWW/m4lib/thissite.m4 | 42 +++++++ doc/examples/WWW/m4lib/tmpl.m4 | 11 ++ doc/examples/WWW/m4lib/todo.m4 | 18 +++ doc/examples/WWW/m4lib/uses.m4 | 43 +++++++ doc/examples/WWW/m4lib/visions.m4 | 232 ++++++++++++++++++++++++++++++++++++ doc/examples/WWW/m4lib/whatis.m4 | 48 ++++++++ doc/examples/capitalize.m4 | 12 ++ doc/examples/capitalize2.m4 | 19 +++ doc/examples/comments.m4 | 7 ++ doc/examples/curry.m4 | 7 ++ doc/examples/ddivert.m4 | 4 + doc/examples/debug.m4 | 4 + doc/examples/esyscmd.m4 | 6 + doc/examples/exp.m4 | 3 + doc/examples/foreach.m4 | 8 ++ doc/examples/foreach2.m4 | 10 ++ doc/examples/foreachq.m4 | 9 ++ doc/examples/foreachq2.m4 | 10 ++ doc/examples/foreachq3.m4 | 9 ++ doc/examples/foreachq4.m4 | 13 ++ doc/examples/forloop.m4 | 6 + doc/examples/forloop2.m4 | 12 ++ doc/examples/forloop3.m4 | 13 ++ doc/examples/fstab.m4 | 6 + doc/examples/hanoi.m4 | 17 +++ doc/examples/incl-test.m4 | 3 + doc/examples/incl.m4 | 3 + doc/examples/include.m4 | 7 ++ doc/examples/indir.m4 | 10 ++ doc/examples/join.m4 | 15 +++ doc/examples/loop.m4 | 18 +++ doc/examples/misc.m4 | 8 ++ doc/examples/modtest.m4 | 7 ++ doc/examples/multiquotes.m4 | 17 +++ doc/examples/patsubst.m4 | 8 ++ doc/examples/pushpop.m4 | 25 ++++ doc/examples/quote.m4 | 9 ++ doc/examples/regexp.m4 | 12 ++ doc/examples/reverse.m4 | 4 + doc/examples/shadow.m4 | 57 +++++++++ doc/examples/stack.m4 | 16 +++ doc/examples/stack_sep.m4 | 17 +++ doc/examples/stdlib.m4 | 44 +++++++ doc/examples/sysv-args.m4 | 14 +++ doc/examples/time.m4 | 20 ++++ doc/examples/time2.m4 | 18 +++ doc/examples/trace.m4 | 30 +++++ doc/examples/translit.m4 | 8 ++ doc/examples/undivert.incl | 1 + doc/examples/undivert.m4 | 5 + doc/examples/wrap.m4 | 10 ++ doc/examples/wrapfifo.m4 | 10 ++ doc/examples/wraplifo.m4 | 10 ++ doc/examples/wraplifo2.m4 | 9 ++ doc/m4.texi | 154 ++++++++++++------------ examples/COPYING | 8 -- examples/WWW/COPYING | 8 -- examples/WWW/Makefile | 45 ------- examples/WWW/_footer.htm | 10 -- examples/WWW/_header.htm | 231 ----------------------------------- examples/WWW/m4lib/COPYING | 8 -- examples/WWW/m4lib/bugs.m4 | 53 -------- examples/WWW/m4lib/changelog.m4 | 18 --- examples/WWW/m4lib/download.m4 | 24 ---- examples/WWW/m4lib/features.m4 | 58 --------- examples/WWW/m4lib/feedback.m4 | 20 ---- examples/WWW/m4lib/html.m4 | 122 ------------------- examples/WWW/m4lib/index.m4 | 36 ------ examples/WWW/m4lib/layout.m4 | 65 ---------- examples/WWW/m4lib/lists.m4 | 32 ----- examples/WWW/m4lib/menu.m4 | 74 ------------ examples/WWW/m4lib/modules.m4 | 18 --- examples/WWW/m4lib/news.m4 | 18 --- examples/WWW/m4lib/readme.m4 | 18 --- examples/WWW/m4lib/setup.m4 | 7 -- examples/WWW/m4lib/test.m4 | 29 ----- examples/WWW/m4lib/thanks.m4 | 18 --- examples/WWW/m4lib/thissite.m4 | 42 ------- examples/WWW/m4lib/tmpl.m4 | 11 -- examples/WWW/m4lib/todo.m4 | 18 --- examples/WWW/m4lib/uses.m4 | 43 ------- examples/WWW/m4lib/visions.m4 | 232 ------------------------------------ examples/WWW/m4lib/whatis.m4 | 48 -------- examples/capitalize.m4 | 12 -- examples/capitalize2.m4 | 19 --- examples/comments.m4 | 7 -- examples/curry.m4 | 7 -- examples/ddivert.m4 | 4 - examples/debug.m4 | 4 - examples/esyscmd.m4 | 6 - examples/exp.m4 | 3 - examples/foreach.m4 | 8 -- examples/foreach2.m4 | 10 -- examples/foreachq.m4 | 9 -- examples/foreachq2.m4 | 10 -- examples/foreachq3.m4 | 9 -- examples/foreachq4.m4 | 13 -- examples/forloop.m4 | 6 - examples/forloop2.m4 | 12 -- examples/forloop3.m4 | 13 -- examples/fstab.m4 | 6 - examples/hanoi.m4 | 17 --- examples/incl-test.m4 | 3 - examples/incl.m4 | 3 - examples/include.m4 | 7 -- examples/indir.m4 | 10 -- examples/join.m4 | 15 --- examples/loop.m4 | 18 --- examples/misc.m4 | 8 -- examples/modtest.m4 | 7 -- examples/multiquotes.m4 | 17 --- examples/patsubst.m4 | 8 -- examples/pushpop.m4 | 25 ---- examples/quote.m4 | 9 -- examples/regexp.m4 | 12 -- examples/reverse.m4 | 4 - examples/shadow.m4 | 57 --------- examples/stack.m4 | 16 --- examples/stack_sep.m4 | 17 --- examples/stdlib.m4 | 44 ------- examples/sysv-args.m4 | 14 --- examples/time.m4 | 20 ---- examples/time2.m4 | 18 --- examples/trace.m4 | 30 ----- examples/translit.m4 | 8 -- examples/undivert.incl | 1 - examples/undivert.m4 | 5 - examples/wrap.m4 | 10 -- examples/wrapfifo.m4 | 10 -- examples/wraplifo.m4 | 10 -- examples/wraplifo2.m4 | 9 -- modules/README | 4 +- tests/builtins.at | 4 +- tests/generate.awk | 6 +- tests/others.at | 20 ++-- 159 files changed, 2073 insertions(+), 2073 deletions(-) create mode 100644 doc/examples/COPYING create mode 100644 doc/examples/WWW/COPYING create mode 100644 doc/examples/WWW/Makefile create mode 100644 doc/examples/WWW/_footer.htm create mode 100644 doc/examples/WWW/_header.htm create mode 100644 doc/examples/WWW/m4lib/COPYING create mode 100644 doc/examples/WWW/m4lib/bugs.m4 create mode 100644 doc/examples/WWW/m4lib/changelog.m4 create mode 100644 doc/examples/WWW/m4lib/download.m4 create mode 100644 doc/examples/WWW/m4lib/features.m4 create mode 100644 doc/examples/WWW/m4lib/feedback.m4 create mode 100644 doc/examples/WWW/m4lib/html.m4 create mode 100644 doc/examples/WWW/m4lib/index.m4 create mode 100644 doc/examples/WWW/m4lib/layout.m4 create mode 100644 doc/examples/WWW/m4lib/lists.m4 create mode 100644 doc/examples/WWW/m4lib/menu.m4 create mode 100644 doc/examples/WWW/m4lib/modules.m4 create mode 100644 doc/examples/WWW/m4lib/news.m4 create mode 100644 doc/examples/WWW/m4lib/readme.m4 create mode 100644 doc/examples/WWW/m4lib/setup.m4 create mode 100644 doc/examples/WWW/m4lib/test.m4 create mode 100644 doc/examples/WWW/m4lib/thanks.m4 create mode 100644 doc/examples/WWW/m4lib/thissite.m4 create mode 100644 doc/examples/WWW/m4lib/tmpl.m4 create mode 100644 doc/examples/WWW/m4lib/todo.m4 create mode 100644 doc/examples/WWW/m4lib/uses.m4 create mode 100644 doc/examples/WWW/m4lib/visions.m4 create mode 100644 doc/examples/WWW/m4lib/whatis.m4 create mode 100644 doc/examples/capitalize.m4 create mode 100644 doc/examples/capitalize2.m4 create mode 100644 doc/examples/comments.m4 create mode 100644 doc/examples/curry.m4 create mode 100644 doc/examples/ddivert.m4 create mode 100644 doc/examples/debug.m4 create mode 100644 doc/examples/esyscmd.m4 create mode 100644 doc/examples/exp.m4 create mode 100644 doc/examples/foreach.m4 create mode 100644 doc/examples/foreach2.m4 create mode 100644 doc/examples/foreachq.m4 create mode 100644 doc/examples/foreachq2.m4 create mode 100644 doc/examples/foreachq3.m4 create mode 100644 doc/examples/foreachq4.m4 create mode 100644 doc/examples/forloop.m4 create mode 100644 doc/examples/forloop2.m4 create mode 100644 doc/examples/forloop3.m4 create mode 100644 doc/examples/fstab.m4 create mode 100644 doc/examples/hanoi.m4 create mode 100644 doc/examples/incl-test.m4 create mode 100644 doc/examples/incl.m4 create mode 100644 doc/examples/include.m4 create mode 100644 doc/examples/indir.m4 create mode 100644 doc/examples/join.m4 create mode 100644 doc/examples/loop.m4 create mode 100644 doc/examples/misc.m4 create mode 100644 doc/examples/modtest.m4 create mode 100644 doc/examples/multiquotes.m4 create mode 100644 doc/examples/patsubst.m4 create mode 100644 doc/examples/pushpop.m4 create mode 100644 doc/examples/quote.m4 create mode 100644 doc/examples/regexp.m4 create mode 100644 doc/examples/reverse.m4 create mode 100644 doc/examples/shadow.m4 create mode 100644 doc/examples/stack.m4 create mode 100644 doc/examples/stack_sep.m4 create mode 100644 doc/examples/stdlib.m4 create mode 100644 doc/examples/sysv-args.m4 create mode 100644 doc/examples/time.m4 create mode 100644 doc/examples/time2.m4 create mode 100644 doc/examples/trace.m4 create mode 100644 doc/examples/translit.m4 create mode 100644 doc/examples/undivert.incl create mode 100644 doc/examples/undivert.m4 create mode 100644 doc/examples/wrap.m4 create mode 100644 doc/examples/wrapfifo.m4 create mode 100644 doc/examples/wraplifo.m4 create mode 100644 doc/examples/wraplifo2.m4 delete mode 100644 examples/COPYING delete mode 100644 examples/WWW/COPYING delete mode 100644 examples/WWW/Makefile delete mode 100644 examples/WWW/_footer.htm delete mode 100644 examples/WWW/_header.htm delete mode 100644 examples/WWW/m4lib/COPYING delete mode 100644 examples/WWW/m4lib/bugs.m4 delete mode 100644 examples/WWW/m4lib/changelog.m4 delete mode 100644 examples/WWW/m4lib/download.m4 delete mode 100644 examples/WWW/m4lib/features.m4 delete mode 100644 examples/WWW/m4lib/feedback.m4 delete mode 100644 examples/WWW/m4lib/html.m4 delete mode 100644 examples/WWW/m4lib/index.m4 delete mode 100644 examples/WWW/m4lib/layout.m4 delete mode 100644 examples/WWW/m4lib/lists.m4 delete mode 100644 examples/WWW/m4lib/menu.m4 delete mode 100644 examples/WWW/m4lib/modules.m4 delete mode 100644 examples/WWW/m4lib/news.m4 delete mode 100644 examples/WWW/m4lib/readme.m4 delete mode 100644 examples/WWW/m4lib/setup.m4 delete mode 100644 examples/WWW/m4lib/test.m4 delete mode 100644 examples/WWW/m4lib/thanks.m4 delete mode 100644 examples/WWW/m4lib/thissite.m4 delete mode 100644 examples/WWW/m4lib/tmpl.m4 delete mode 100644 examples/WWW/m4lib/todo.m4 delete mode 100644 examples/WWW/m4lib/uses.m4 delete mode 100644 examples/WWW/m4lib/visions.m4 delete mode 100644 examples/WWW/m4lib/whatis.m4 delete mode 100644 examples/capitalize.m4 delete mode 100644 examples/capitalize2.m4 delete mode 100644 examples/comments.m4 delete mode 100644 examples/curry.m4 delete mode 100644 examples/ddivert.m4 delete mode 100644 examples/debug.m4 delete mode 100644 examples/esyscmd.m4 delete mode 100644 examples/exp.m4 delete mode 100644 examples/foreach.m4 delete mode 100644 examples/foreach2.m4 delete mode 100644 examples/foreachq.m4 delete mode 100644 examples/foreachq2.m4 delete mode 100644 examples/foreachq3.m4 delete mode 100644 examples/foreachq4.m4 delete mode 100644 examples/forloop.m4 delete mode 100644 examples/forloop2.m4 delete mode 100644 examples/forloop3.m4 delete mode 100644 examples/fstab.m4 delete mode 100644 examples/hanoi.m4 delete mode 100644 examples/incl-test.m4 delete mode 100644 examples/incl.m4 delete mode 100644 examples/include.m4 delete mode 100644 examples/indir.m4 delete mode 100644 examples/join.m4 delete mode 100644 examples/loop.m4 delete mode 100644 examples/misc.m4 delete mode 100644 examples/modtest.m4 delete mode 100644 examples/multiquotes.m4 delete mode 100644 examples/patsubst.m4 delete mode 100644 examples/pushpop.m4 delete mode 100644 examples/quote.m4 delete mode 100644 examples/regexp.m4 delete mode 100644 examples/reverse.m4 delete mode 100644 examples/shadow.m4 delete mode 100644 examples/stack.m4 delete mode 100644 examples/stack_sep.m4 delete mode 100644 examples/stdlib.m4 delete mode 100644 examples/sysv-args.m4 delete mode 100644 examples/time.m4 delete mode 100644 examples/time2.m4 delete mode 100644 examples/trace.m4 delete mode 100644 examples/translit.m4 delete mode 100644 examples/undivert.incl delete mode 100644 examples/undivert.m4 delete mode 100644 examples/wrap.m4 delete mode 100644 examples/wrapfifo.m4 delete mode 100644 examples/wraplifo.m4 delete mode 100644 examples/wraplifo2.m4 diff --git a/Makefile.am b/Makefile.am index 0cc3e838..6c853c5f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -250,83 +250,83 @@ EXTRA_DIST += m4/system_.h ## --------- ## EXTRA_DIST += \ - examples/WWW/Makefile \ - examples/WWW/_footer.htm \ - examples/WWW/_header.htm \ - examples/WWW/m4lib/bugs.m4 \ - examples/WWW/m4lib/changelog.m4 \ - examples/WWW/m4lib/download.m4 \ - examples/WWW/m4lib/features.m4 \ - examples/WWW/m4lib/feedback.m4 \ - examples/WWW/m4lib/html.m4 \ - examples/WWW/m4lib/index.m4 \ - examples/WWW/m4lib/layout.m4 \ - examples/WWW/m4lib/lists.m4 \ - examples/WWW/m4lib/menu.m4 \ - examples/WWW/m4lib/modules.m4 \ - examples/WWW/m4lib/news.m4 \ - examples/WWW/m4lib/readme.m4 \ - examples/WWW/m4lib/setup.m4 \ - examples/WWW/m4lib/test.m4 \ - examples/WWW/m4lib/thanks.m4 \ - examples/WWW/m4lib/thissite.m4 \ - examples/WWW/m4lib/tmpl.m4 \ - examples/WWW/m4lib/todo.m4 \ - examples/WWW/m4lib/uses.m4 \ - examples/WWW/m4lib/visions.m4 \ - examples/WWW/m4lib/whatis.m4 + doc/examples/WWW/Makefile \ + doc/examples/WWW/_footer.htm \ + doc/examples/WWW/_header.htm \ + doc/examples/WWW/m4lib/bugs.m4 \ + doc/examples/WWW/m4lib/changelog.m4 \ + doc/examples/WWW/m4lib/download.m4 \ + doc/examples/WWW/m4lib/features.m4 \ + doc/examples/WWW/m4lib/feedback.m4 \ + doc/examples/WWW/m4lib/html.m4 \ + doc/examples/WWW/m4lib/index.m4 \ + doc/examples/WWW/m4lib/layout.m4 \ + doc/examples/WWW/m4lib/lists.m4 \ + doc/examples/WWW/m4lib/menu.m4 \ + doc/examples/WWW/m4lib/modules.m4 \ + doc/examples/WWW/m4lib/news.m4 \ + doc/examples/WWW/m4lib/readme.m4 \ + doc/examples/WWW/m4lib/setup.m4 \ + doc/examples/WWW/m4lib/test.m4 \ + doc/examples/WWW/m4lib/thanks.m4 \ + doc/examples/WWW/m4lib/thissite.m4 \ + doc/examples/WWW/m4lib/tmpl.m4 \ + doc/examples/WWW/m4lib/todo.m4 \ + doc/examples/WWW/m4lib/uses.m4 \ + doc/examples/WWW/m4lib/visions.m4 \ + doc/examples/WWW/m4lib/whatis.m4 dist_pkgdata_DATA = \ - examples/capitalize.m4 \ - examples/capitalize2.m4 \ - examples/comments.m4 \ - examples/curry.m4 \ - examples/ddivert.m4 \ - examples/debug.m4 \ - examples/esyscmd.m4 \ - examples/exp.m4 \ - examples/foreach.m4 \ - examples/foreach2.m4 \ - examples/foreachq.m4 \ - examples/foreachq2.m4 \ - examples/foreachq3.m4 \ - examples/foreachq4.m4 \ - examples/forloop.m4 \ - examples/forloop2.m4 \ - examples/forloop3.m4 \ - examples/fstab.m4 \ - examples/hanoi.m4 \ - examples/incl-test.m4 \ - examples/incl.m4 \ - examples/include.m4 \ - examples/indir.m4 \ - examples/join.m4 \ - examples/loop.m4 \ - examples/misc.m4 \ - examples/multiquotes.m4 \ - examples/patsubst.m4 \ - examples/pushpop.m4 \ - examples/quote.m4 \ - examples/regexp.m4 \ - examples/reverse.m4 \ - examples/stack.m4 \ - examples/stack_sep.m4 \ - examples/sysv-args.m4 \ - examples/trace.m4 \ - examples/translit.m4 \ - examples/undivert.incl \ - examples/undivert.m4 \ - examples/wrap.m4 \ - examples/wrapfifo.m4 \ - examples/wraplifo.m4 \ - examples/wraplifo2.m4 + doc/examples/capitalize.m4 \ + doc/examples/capitalize2.m4 \ + doc/examples/comments.m4 \ + doc/examples/curry.m4 \ + doc/examples/ddivert.m4 \ + doc/examples/debug.m4 \ + doc/examples/esyscmd.m4 \ + doc/examples/exp.m4 \ + doc/examples/foreach.m4 \ + doc/examples/foreach2.m4 \ + doc/examples/foreachq.m4 \ + doc/examples/foreachq2.m4 \ + doc/examples/foreachq3.m4 \ + doc/examples/foreachq4.m4 \ + doc/examples/forloop.m4 \ + doc/examples/forloop2.m4 \ + doc/examples/forloop3.m4 \ + doc/examples/fstab.m4 \ + doc/examples/hanoi.m4 \ + doc/examples/incl-test.m4 \ + doc/examples/incl.m4 \ + doc/examples/include.m4 \ + doc/examples/indir.m4 \ + doc/examples/join.m4 \ + doc/examples/loop.m4 \ + doc/examples/misc.m4 \ + doc/examples/multiquotes.m4 \ + doc/examples/patsubst.m4 \ + doc/examples/pushpop.m4 \ + doc/examples/quote.m4 \ + doc/examples/regexp.m4 \ + doc/examples/reverse.m4 \ + doc/examples/stack.m4 \ + doc/examples/stack_sep.m4 \ + doc/examples/sysv-args.m4 \ + doc/examples/trace.m4 \ + doc/examples/translit.m4 \ + doc/examples/undivert.incl \ + doc/examples/undivert.m4 \ + doc/examples/wrap.m4 \ + doc/examples/wrapfifo.m4 \ + doc/examples/wraplifo.m4 \ + doc/examples/wraplifo2.m4 EXTRA_DIST += \ - examples/modtest.m4 \ - examples/shadow.m4 \ - examples/time.m4 \ - examples/time2.m4 \ - examples/stdlib.m4 + doc/examples/modtest.m4 \ + doc/examples/shadow.m4 \ + doc/examples/time.m4 \ + doc/examples/time2.m4 \ + doc/examples/stdlib.m4 ## ----------- ## ## Test suite. ## diff --git a/README b/README index c07737ca..163c89f6 100644 --- a/README +++ b/README @@ -20,8 +20,8 @@ ahead and start with `./configure'. If you are trying to build `m4' from git, more information can be found in the version-control-only file HACKING. -In the subdirectories `tests' and `examples' you will find various m4 -files, ranging from trivial test files to rather advanced macros. If +In the subdirectories `tests' and `doc/examples' you will find various +m4 files, ranging from trivial test files to rather advanced macros. If you intend to use m4 seriously, you might find useful material down there. diff --git a/doc/examples/COPYING b/doc/examples/COPYING new file mode 100644 index 00000000..0b2d09ee --- /dev/null +++ b/doc/examples/COPYING @@ -0,0 +1,8 @@ +The files in this directory provide example uses of GNU M4. +The following copyright notice applies to each of these +description files. + +Copyright (C) 2006, 2010, 2013 Free Software Foundation, Inc. +This file is free software; the Free Software Foundation +gives unlimited permission to copy and/or distribute it, +with or without modifications, as long as this notice is preserved. diff --git a/doc/examples/WWW/COPYING b/doc/examples/WWW/COPYING new file mode 100644 index 00000000..0b2d09ee --- /dev/null +++ b/doc/examples/WWW/COPYING @@ -0,0 +1,8 @@ +The files in this directory provide example uses of GNU M4. +The following copyright notice applies to each of these +description files. + +Copyright (C) 2006, 2010, 2013 Free Software Foundation, Inc. +This file is free software; the Free Software Foundation +gives unlimited permission to copy and/or distribute it, +with or without modifications, as long as this notice is preserved. diff --git a/doc/examples/WWW/Makefile b/doc/examples/WWW/Makefile new file mode 100644 index 00000000..c296ccf4 --- /dev/null +++ b/doc/examples/WWW/Makefile @@ -0,0 +1,45 @@ +M4 = ./m4/src/m4 +M4OPTS = -Im4lib + +VPATH = .:m4lib + +HTM = _footer.htm _header.htm bugs.htm changelog.htm download.htm \ + features.htm feedback.htm index.htm lists.htm modules.htm \ + news.htm readme.htm thanks.htm thissite.htm todo.htm uses.htm \ + visions.htm whatis.htm + +M4LIB = m4lib/bugs.m4 m4lib/changelog.m4 m4lib/download.m4 \ + m4lib/features.m4 m4lib/feedback.m4 m4lib/html.m4 \ + m4lib/index.m4 m4lib/layout.m4 m4lib/lists.m4 m4lib/menu.m4 \ + m4lib/modules.m4 m4lib/news.m4 m4lib/readme.m4 \ + m4lib/setup.m4 m4lib/test.m4 m4lib/thanks.m4 \ + m4lib/thissite.m4 m4lib/tmpl.m4 m4lib/todo.m4 m4lib/uses.m4 \ + m4lib/visions.m4 m4lib/whatis.m4 + +all: ./m4 $(HTM) + +./m4: + ln -s ../.. m4 + +%.htm: %.m4 + @$(M4) $(M4OPTS) $< >new.htm && \ + if cmp new.htm $@ >/dev/null 2>&1; then \ + rm new.htm; \ + echo "$@ has not changed"; \ + else \ + echo "$@ updated"; \ + mv new.htm $@; \ + fi + +.FORCE: +$(HTM): .FORCE $(M4LIB) + +changelog.htm: m4/ChangeLog +readme.htm: m4/README +todo.htm: m4/TODO +news.htm: m4/NEWS +modules.htm: m4/modules/README + +.PHONY: man +man: + cd man; $(MAKE) diff --git a/doc/examples/WWW/_footer.htm b/doc/examples/WWW/_footer.htm new file mode 100644 index 00000000..6bed8f2c --- /dev/null +++ b/doc/examples/WWW/_footer.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/doc/examples/WWW/_header.htm b/doc/examples/WWW/_header.htm new file mode 100644 index 00000000..1aea7999 --- /dev/null +++ b/doc/examples/WWW/_header.htm @@ -0,0 +1,231 @@ + + + +GNU m4 - Development site + + + + + + + + + + + + - - - -
+ +

GNU m4

+ +

Discussion Forum

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+General info +

+ +
+

+ +What is m4
+Features
+Uses of m4
+ +

+ +
+ +
+

+Documentation +

+ +
+

+ +Manual + +

+ +
+ +
+

+Source files +

+ +
+

+ +README
+TODO
+NEWS
+ChangeLog
+Contributors
+Browse it
+ +

+ +
+ +
+

+The Future +

+ +
+

+ +Modules
+Visions
+ +

+ +
+ +
+

+Feedback +

+ +
+

+ +Mailing-lists
+Feedback
+ +

+ +
+ +
+

+Development +

+ +
+

+ +Download
+Known bugs
+ +

+ +
+ +
+

+Examples +

+ +
+

+ +This site + +

+ +
+ + + + + + + + +
diff --git a/doc/examples/WWW/m4lib/COPYING b/doc/examples/WWW/m4lib/COPYING new file mode 100644 index 00000000..0b2d09ee --- /dev/null +++ b/doc/examples/WWW/m4lib/COPYING @@ -0,0 +1,8 @@ +The files in this directory provide example uses of GNU M4. +The following copyright notice applies to each of these +description files. + +Copyright (C) 2006, 2010, 2013 Free Software Foundation, Inc. +This file is free software; the Free Software Foundation +gives unlimited permission to copy and/or distribute it, +with or without modifications, as long as this notice is preserved. diff --git a/doc/examples/WWW/m4lib/bugs.m4 b/doc/examples/WWW/m4lib/bugs.m4 new file mode 100644 index 00000000..5d8e5f52 --- /dev/null +++ b/doc/examples/WWW/m4lib/bugs.m4 @@ -0,0 +1,53 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([Known bugs in GNU m4 \__m4_version__]) + +\divert(1) +\h2([Known bugs in GNU m4]) + +\define([fixed], [\p([Fixed in version 1.4$1])]) + +\define([notme], [\p([A volunteer is badly needed for this, as I have no way of testing +this myself.])]) + +\ul([ + +\item([undivert], [undivert(0) might read from standard output], + +[\p([If calling \tt(undivert(0)) when diverting to a non-zero diversion +will cause m4 to read from standard output in an attempt to bring back +diversion 0, which is not possible.]) + +\fixed(n) + +]) + +\item([sigaltstack], [failure if sigaltstack or sigstack returns ENOSYS], + +[\p([If stack overflow detection is configured but the system doesn't +support sigaltstack(2) or sigstack(2), m4 fails when the system call +returns ENOSYS. It should silently revert to default behaviour.]) + +\notme +]) + +]) + +\p([See also the \link(todo.htm, TODO) file.]) + +\print_items + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) + + +\item([], [], + +[\p([]) + +]) +\undivert diff --git a/doc/examples/WWW/m4lib/changelog.m4 b/doc/examples/WWW/m4lib/changelog.m4 new file mode 100644 index 00000000..cdcab269 --- /dev/null +++ b/doc/examples/WWW/m4lib/changelog.m4 @@ -0,0 +1,18 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([ChangeLog]) + +\divert(1) + +
\dnl
+\changesyntax([A<>])\dnl
+\changequote(,)\dnl
+\include(m4/ChangeLog)
+\changequote([,])\dnl
+\changesyntax([O<>])\dnl
+
+ +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/download.m4 b/doc/examples/WWW/m4lib/download.m4 new file mode 100644 index 00000000..d9ee4095 --- /dev/null +++ b/doc/examples/WWW/m4lib/download.m4 @@ -0,0 +1,24 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([Download]) + +\divert(1) + +\p([In the download area there are usually several version +present. Please take only the latest.]) + +\p([The files are name \tt(m4-1.4\i(X).tar.gz) where X is a letter.]) + +\p([\link([ftp://ftp.seindal.dk/pub/rene/gnu/], [Download latest +development version]).]) + +\p([\link([ftp://ftp.seindal.dk/pub/rene/gnu/m4-1.4.tar.gz],[Download +latest stable version]).]) + +\p([\link([ftp://ftp.seindal.dk/pub/rene/gnu/djgpp/],[Download +DOS/Windows port of latest stable version]).]) + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/features.m4 b/doc/examples/WWW/m4lib/features.m4 new file mode 100644 index 00000000..57b68c9e --- /dev/null +++ b/doc/examples/WWW/m4lib/features.m4 @@ -0,0 +1,58 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([New feaures since version 1.4]) + +\divert(1) + +\p(Please look at the \link(news.htm, NEWS) and the \link(changelog.htm, +ChangeLog) for all the gory details.) + +\dl( +\dt(\b(GNU m4 uses GNU Automake and GNU Autoconf for configuration.)) + +\dd(\p(This has been long overdue, and now hit is done thanks to Erick +Branderhorst.)) + +\dt(\b(GNU m4 uses GNU gettext for internationalisation.)) + +\dd(\p(GNU m4 now speaks several languages. Translations for +german, french, italian, japanese, dutch, polish, romenian and swedish +have been made.)) + +\dt(\b(Support for multiple precision arithmetic in eval.)) + +\dd(\p(If appropriately configured, GNU m4 can now do multiple precision +arithmetic in the built in macro 'eval'. If not configured, GNU m4 +will use the largest integer available for its calculations.)) + +\dt(\b(An input syntax table to change how input is parsed.)) + +\dd(\p(A new build in macro 'changesyntax' allows finer control over how input +characters are parsed into input tokens.  It is now possible to have +several one character quote strings or comment delimiters, to change the +format of macro calls, to use active characters like in TeX, and probably +most useful, to change what input characters are treated as letters when +looking for macro calls.) + +\p(See the \link(man/m4_7.html#SEC41, manual section) for more details.)) + +\dt(\b(Support for loadable modules.)) + +\dd(\p(GNU m4 now has support for dynamic loading of compiled modules at +runtime. A module can define any number of new built in macros, which +will be indistinguishable from the standard set of built in +macros. Modules can also override existing built in macros.) +) + +\dt(\b(Better control of sync-lines generation.)) + +\dd(\p(The new built in macro 'syncoutput' allows better control of the +generation of sync-lines. They can now be turned on or off at +will.)) + +) + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/feedback.m4 b/doc/examples/WWW/m4lib/feedback.m4 new file mode 100644 index 00000000..f61d63e5 --- /dev/null +++ b/doc/examples/WWW/m4lib/feedback.m4 @@ -0,0 +1,20 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([Feedback]) + +\divert(1) + +\p(Bug reports should be sent to \link(mailto:bug-m4@gnu.org, +bug-m4@gnu.org).) + +\p(Generel discussion about GNU m4 should take place on +\link(mailto:m4-forum@seindal.dk, m4-forum).) + +\p(Informal comments about this site and GNU m4 can be sent to +\link(mailto:m4-feedback@seindal.dk, m4-feedback).) + + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/html.m4 b/doc/examples/WWW/m4lib/html.m4 new file mode 100644 index 00000000..94ed69ed --- /dev/null +++ b/doc/examples/WWW/m4lib/html.m4 @@ -0,0 +1,122 @@ +\define([n], [ +]) + +\define([concat], [\ifelse($#, 0, , + $#, 1, [$1], + [$1 \concat(\shift($@))])]) + +\define([toupper], [\translit([$*], [a-z], [A-Z])]) + +\define([container], +[\pushdef([_tag], \toupper([$1]))\dnl +\ifelse($#, 1, [<\_tag>], + $#, 2, [<\_tag>$2], + $#, 3, [<\_tag $2>$3], + [<\_tag $2>\concat(\shift(\shift($@)))])\dnl +\popdef([_tag])\dnl +]) + +\define([large_container], +[\pushdef([_tag], \toupper([$1]))\dnl +\ifelse($#, 1, [<\_tag>\n], + $#, 2, [<\_tag>\n[]$2\n\n], + $#, 3, [<\_tag $2>\n[]$3\n\n], + [<\_tag $2>\n\concat(\shift(\shift($@)))\n\n])\dnl +\popdef([_tag])\dnl +]) + +\define([large_simple_container], +[\pushdef([_tag], \toupper([$1]))\dnl +<\_tag>\n\concat(\shift($@))\n\n\dnl +\popdef([_tag])\dnl +]) + +\define([simple_container], +[\pushdef([_tag], \toupper([$1]))\dnl +<\_tag>\concat(\shift($@))\dnl +\popdef([_tag])\dnl +]) + +\define([simple_tag], +[\pushdef([_tag], \toupper([$1]))\dnl +\ifelse([$2], [], [<\_tag>], [<\_tag $2>])\dnl +\popdef([_tag])\dnl +]) + +\define([doctype], [\simple_tag([!DOCTYPE], $@)]) + +\define([html], [\large_simple_container([$0], $@)]) +\define([head], [\large_simple_container([$0], $@)]) +\define([title], [\simple_container([$0], $@)]) + +\define([meta], [\n]) +\define([http_equiv], [\n]) + +\define([body], [\large_container([$0], $@)]) + +\define([center], [\large_simple_container([$0], $@)]) +\define([right], [\large_simple_container([$0], $@)]) +\define([left], [\large_simple_container([$0], $@)]) +\define([div], [\large_container([$0], $@)]) + +\define([b], [\simple_container([$0], $@)]) +\define([i], [\simple_container([$0], $@)]) +\define([tt], [\simple_container([$0], $@)]) + +\define([table], [\large_container([$0], $@)]) +\define([tr], [\large_container([$0], $@)]) +\define([td], [\large_container([$0], $@)]) +\define([th], [\large_container([$0], $@)]) + +\define([link], [\shift($*)]) +\define([target], [\shift($*)]) + +\define([font], [\n\container([$0], $@)\n]) + +\define([h1], [\n\container([$0], $@)\n]) +\define([h2], [\n\container([$0], $@)\n]) +\define([h3], [\n\container([$0], $@)\n]) +\define([h4], [\n\container([$0], $@)\n]) +\define([h5], [\n\container([$0], $@)\n]) +\define([h6], [\n\container([$0], $@)\n]) + +\define([p], [\large_simple_container([$0], $@)]) + +\define([hr], [\simple_tag([$0], $@)]) + +\define([ul], [\large_container([$0], $@)]) +\define([ol], [\large_container([$0], $@)]) + +\define([li], [\simple_tag([$0], $@)]) + +\define([blockquote], [\large_simple_container([$0], $@)]) + +\define([dl], [\large_simple_container([$0], $@)]) +\define([dt], [\simple_container([$0], $@)]) +\define([dd], [\large_simple_container([$0], $@)]) + +\define([br], [\simple_tag([$0], $@)]) +\define([hline], [\simple_tag([$0], $@)]) + +\define([pre], [\simple_container([$0], $@)]) + + + +\define([set_title], [\define([_TITLE], [$*])]) +\set_title(_TITLE) + +\define([set_author], [\define([_AUTHOR], [$*])]) +\set_author() + +\define([set_generator], [\define([_GENERATOR], [$*])]) +\set_generator([GNU m4 \__m4_version__]) + +\define([set_keywords], [\define([_KEYWORDS], [$*])]) +\set_keywords() + +\define([set_body], [\define([_BODY], [$*])]) +\set_body() + +\define([meta_if_set], + [\ifelse(\defn([_$1]), [], [], \meta([$1], \defn([_$1])))]\dnl +) diff --git a/doc/examples/WWW/m4lib/index.m4 b/doc/examples/WWW/m4lib/index.m4 new file mode 100644 index 00000000..dbccc67b --- /dev/null +++ b/doc/examples/WWW/m4lib/index.m4 @@ -0,0 +1,36 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([Development site]) + +\divert(1) +\h2([Current development version is \__m4_version__.]) + +\p([Development versions contain new features and experiments that might +or might not make it into the next official release. The current +development version contains among other things (browse the +\link([features.htm], [new features]) for more detail):]) + +\ul([ + \li Uses GNU Automake and GNU Autoconf for configuration. + + \li Uses GNU gettext for internationalisation. + + \li Support for multiple precision arithmetic in eval. + + \li An input syntax table to change how input is parsed. + + \li Support for loadable modules. + + \li Better control of sync-lines generation. + + \li Various bug-fixes. +]) + +\p([A new release is expected ready for Spring 2000.]) + +\p([GNU \tt(m4) 1.4 is from october 1994 and can be considered stable.]) + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/layout.m4 b/doc/examples/WWW/m4lib/layout.m4 new file mode 100644 index 00000000..e54002db --- /dev/null +++ b/doc/examples/WWW/m4lib/layout.m4 @@ -0,0 +1,65 @@ +\divert(-1); +The semicolons are just to get GNU Emacs C mode to indent properly. + +\define([C_TEXT], [text="#000000"]); +\define([C_LINK], [link="#0000EF"]); +\define([C_ALINK], [vlink="#51188E"]); +\define([C_VLINK], [alink="#FF0000"]); +\define([C_BG1], [bgcolor="#FFCC99"]); +\define([C_BG2], [bgcolor="#FF9900"]); +\define([C_BG3], [bgcolor="#CC6600"]); + +\define([DO_HEADER], + [\head([\title([GNU m4 - \defn([_TITLE])])], + [\meta_if_set([AUTHOR])], + [\meta_if_set([GENERATOR])], + [\meta_if_set([KEYWORDS])], + )]); + +\define([DO_BODY], + [\body([\C_TEXT \C_BG1 \C_LINK \C_VLINK \C_ALINK], + [\table([cellpadding=5 width="100%"], + [\tr([align=left valign=bottom], + [\td([align=center valign=middle colspan="3" width="100%" \C_BG2], + [\h1([GNU m4])], + [\h2(\defn([_TITLE]))], + )], + )], + [\tr([], + [\td([align=left valign=top width="15%" \C_BG2], + [\include([menu.m4])], + )], + [\td([align=left valign=top width="90%"], + [$*], + )], + )], + )], + )] + ); + +\define([DO_LAYOUT], + [\doctype([html public "-//w3c//dtd html 4.0 transitional//en"]) +\html([\DO_HEADER], [\DO_BODY([$*])])] + ); + +\define([<], [<]); +\define([>], [>]); + +\define([showlink], [\link($1, $1)]); +\define([mailto], [\link(mailto:$1, $1)]); + + + + +\define([print_items], [\undivert(2)]) + +\define([item], [\li \link([[#]$1], [$2.]) +\pushdef([_div], \divnum)\dnl +\divert(2)\dnl +\hr([align=center width="50%"])\dnl +\h2([\target([$1], [$2])])\dnl +$3\dnl +\divert(\_div)\dnl +\popdef([_div])\dnl +]) diff --git a/doc/examples/WWW/m4lib/lists.m4 b/doc/examples/WWW/m4lib/lists.m4 new file mode 100644 index 00000000..cc710eba --- /dev/null +++ b/doc/examples/WWW/m4lib/lists.m4 @@ -0,0 +1,32 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([Mailing lists]) + +\define([me], \link([mailto:rene@seindal.dk], [rene@seindal.dk])) + +\divert(1) + +\h3(There are two mailing lists for GNU m4) + +\dl( + +\dt(\b(\link(mailto:m4-forum@seindal.dk, m4-forum@seindal.dk))) + +\dd(\p(This list is intended for discussions between people interested +and/or participating in the further development of m4.)) + +\dt(\b(m4-announce@seindal.dk)) + +\dd(\p(Announcements regarding GNU m4 will posted here.) +\p(The volume will certainly be very low.)) + +) + +\p(Currently these lists are maintained manually. Send a message to \me +saying whether you want to subscribe or unsubscribe to any of these +lists.) + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/menu.m4 b/doc/examples/WWW/m4lib/menu.m4 new file mode 100644 index 00000000..78c8edfd --- /dev/null +++ b/doc/examples/WWW/m4lib/menu.m4 @@ -0,0 +1,74 @@ +\pushdef([header], [\tr([\td([\C_BG3], [\p([\b([$1])])])])]) + +\pushdef([separator], [\tr([\td([height=5], [])])]) + +\pushdef([_row], [\link([$1], [$2])]) + +\pushdef([_rows], + [\ifelse($#, 0, [], + $#, 1, [], + $#, 2, [\_row([$1], [$2])], + $#, 3, [\_row([$1], [$2])], + [\_row([$1], [$2])\br\n\_rows(\shift(\shift($@)))])]) + +\pushdef([rows], [\tr([\td([\p([\font([size=-1], [\b([\_rows($@)])])])])])]) + +\table([], + [\header([General info])], + [\rows( + [whatis.htm], [What is m4], + [features.htm], [Features], + [uses.htm], [Uses of m4], + )], + [\separator], + + [\header([Documentation])], + [\rows( + [man/m4_toc.html], [Manual], + )], + [\separator], + + [\header([Source files])], + [\rows( + [readme.htm], [README], + [todo.htm], [TODO], + [news.htm], [NEWS], + [changelog.htm], [ChangeLog], + [thanks.htm], [Contributors], + [m4/], [Browse it], + )], + [\separator], + + [\header([The Future])], + [\rows( + [modules.htm], [Modules], + [visions.htm], [Visions], + )], + [\separator], + + [\header([Feedback])], + [\rows( + [lists.htm], [Mailing-lists], + [feedback.htm], [Feedback], + [/forum/list.php3?num=2], [Discussion Forum], + )], + [\separator], + + [\header([Development])], + [\rows( + [download.htm], [Download], + [bugs.htm], [Known bugs], + )], + [\separator], + + [\header([Examples])], + [\rows( + [thissite.htm], [This site], + )], +) + +\popdef([header]) +\popdef([rows]) +\popdef([_rows]) +\popdef([_row]) +\popdef([separator]) diff --git a/doc/examples/WWW/m4lib/modules.m4 b/doc/examples/WWW/m4lib/modules.m4 new file mode 100644 index 00000000..b9c148f1 --- /dev/null +++ b/doc/examples/WWW/m4lib/modules.m4 @@ -0,0 +1,18 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([Modules]) + +\divert(1) + +
\dnl
+\changesyntax([A<>])\dnl
+\changequote(,)\dnl
+\include(m4/modules/README)
+\changequote([,])\dnl
+\changesyntax([O<>])\dnl
+
+ +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/news.m4 b/doc/examples/WWW/m4lib/news.m4 new file mode 100644 index 00000000..e5da0d89 --- /dev/null +++ b/doc/examples/WWW/m4lib/news.m4 @@ -0,0 +1,18 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([NEWS - History of user-visible changes]) + +\divert(1) + +
\dnl
+\changesyntax([A<>])\dnl
+\changequote(,)\dnl
+\include(m4/NEWS)
+\changequote([,])\dnl
+\changesyntax([O<>])\dnl
+
+ +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/readme.m4 b/doc/examples/WWW/m4lib/readme.m4 new file mode 100644 index 00000000..1612c7d1 --- /dev/null +++ b/doc/examples/WWW/m4lib/readme.m4 @@ -0,0 +1,18 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([README]) + +\divert(1) + +
\dnl
+\changesyntax([A<>])\dnl
+\changequote(,)\dnl
+\include(m4/README)
+\changequote([,])\dnl
+\changesyntax([O<>])\dnl
+
+ +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/setup.m4 b/doc/examples/WWW/m4lib/setup.m4 new file mode 100644 index 00000000..310b65f8 --- /dev/null +++ b/doc/examples/WWW/m4lib/setup.m4 @@ -0,0 +1,7 @@ +divert(-1) +changequote([,]) +changecom([]) +changesyntax([@\]) + +\include([html.m4]) +\include([layout.m4]) diff --git a/doc/examples/WWW/m4lib/test.m4 b/doc/examples/WWW/m4lib/test.m4 new file mode 100644 index 00000000..110cf12b --- /dev/null +++ b/doc/examples/WWW/m4lib/test.m4 @@ -0,0 +1,29 @@ +include(`setup.m4') + +\divert(1) + +\define([_ideas], []) + +\define([register_idea], +[\define([H_$1], [$2])\dnl +\define([T_$1], [$3])\dnl +\define([_ideas], [\print_idea([$1])]\defn([_ideas]))]) + +\define([print_idea], [ +\target([$1], [\h2([\indir([H_$1])])]) +\indir([T_$1]) +]) + +\define([print_ideas], [\indir([_ideas])]) + +\define([idea], [\li \p([\link([[#]$1], [$2.])])\register_idea([$1], [$2], [$3])]) + +\idea([guile], [Guile as an extension language], [gfhjdsfsarhgew]) +\idea([pquote], [Persistent quotes],[asdffhfdghgdsfh]) +\idea([deps], [Dependencies generation],[afsdffasdf]) + +\print_ideas + +\undivert(1) + +\defn([_ideas]) diff --git a/doc/examples/WWW/m4lib/thanks.m4 b/doc/examples/WWW/m4lib/thanks.m4 new file mode 100644 index 00000000..61928d07 --- /dev/null +++ b/doc/examples/WWW/m4lib/thanks.m4 @@ -0,0 +1,18 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([People who have contributed to m4]) + +\divert(1) + +
\dnl
+\changesyntax([A<>])\dnl
+\changequote(,)\dnl
+\include(m4/THANKS)
+\changequote([,])\dnl
+\changesyntax([O<>])\dnl
+
+ +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/thissite.m4 b/doc/examples/WWW/m4lib/thissite.m4 new file mode 100644 index 00000000..eecfa9cf --- /dev/null +++ b/doc/examples/WWW/m4lib/thissite.m4 @@ -0,0 +1,42 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([This site]) + +\divert(1) + +\p([This GNU m4 site is maintained by René Seindal, +(\mailto(rene@seindal.dk)).]) + +\p([All files are generated using GNU m4 \__m4_version__. You can view +the \link(m4lib/, source files). They are very simple. They use some +features from GNU m4 1.4l]) + +\p([The basic M4 definitions of quotes, comments, escapes are in +\showlink(m4lib/setup.m4). This is first included by all files to +configure the enviroment correctly for the other files. To avoid have +macros called by accident, an escape character is defined with +changesyntax. \i(This is a new feature in m4 1.4l).]) + +\p([Some fairly general macros to generate various HTML construct are +found in \showlink(m4lib/html.m4). There are macros for simple tags, +containers with and without attributes, links and a few utility macros.]) + +\p([The visual aspects of the pages are in \showlink(m4lib/layout.m4). +The macros herein generate the complete HTML structure for the pages. +There are macros for making the header and the body of the document.]) + +\p([The definition of the left hand menu is in \showlink(m4lib/menu.m4). +I convinced GNU Emacs to do the indentation by switching to c-mode.]) + +\p([The page body is passed to the layout definitions as an argument. As +the text can be large, it is first diverted and the text passed to the +layout macros is simply a call to undivert. That way a very large text +can be passed around with very little cost. This page is made with +\link(m4lib/thissite.m4, these definitions).]) + +\p([There is a single file for each HTML file.]) + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/tmpl.m4 b/doc/examples/WWW/m4lib/tmpl.m4 new file mode 100644 index 00000000..8262d293 --- /dev/null +++ b/doc/examples/WWW/m4lib/tmpl.m4 @@ -0,0 +1,11 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([]) + +\divert(1) +\h2([]) + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/todo.m4 b/doc/examples/WWW/m4lib/todo.m4 new file mode 100644 index 00000000..7a22c151 --- /dev/null +++ b/doc/examples/WWW/m4lib/todo.m4 @@ -0,0 +1,18 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([TODO - Things still to be done]) + +\divert(1) + +
\dnl
+\changesyntax([A<>])\dnl
+\changequote(,)\dnl
+\include(m4/TODO)
+\changequote([,])\dnl
+\changesyntax([O<>])\dnl
+
+ +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/uses.m4 b/doc/examples/WWW/m4lib/uses.m4 new file mode 100644 index 00000000..e29acb7a --- /dev/null +++ b/doc/examples/WWW/m4lib/uses.m4 @@ -0,0 +1,43 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([Current uses of m4]) + +\divert(1) + +\p(The MTA sendmail uses \tt(m4) for generating configuration files.) + +\p(\link(http://www.gnu.org/software/autoconf/autoconf.html, GNU +Autoconf) uses \tt(m4) to generate "configure" scripts, that are used +for configuring \link(http://www.gnu.org/, GNU) software for a +particular platform.) + +\p(Htm4l is a set of macros for generating HTML. Html4 is written by +Terry Jones (terry@cliffs.ucsd.edu). See +\showlink(http://cliffs.ucsd.edu/terry/htm4l/htm4l/main.html) for +details. ) + +\p(Various programs uses m4 to preprocess configuration files, for +example the X11 window manager fvwm.) + +\p(There is an \link(http://www.ssc.com/lg/issue22/using_m4.html, +article in the Linux Gazette) about writing HTML with GNU m4 written by +\link(mailto:bhepple@bit.net.au, Bob Hepple) . More recent versions +are kept at \link(http://www.bit.net.au/~bhepple, Bob's home site). +The macros are used to maintain a large commercial site at +\showlink(http://www.finder.com.au).) + +\p(Other examples of GNU m4 generated HTML pages, written by +\link(mailto:max@alcyone.com, Erik Max Francis) can be found at the sites +\showlink(http://www.alcyone.com/max/), +\showlink(http://www.catcam.com/), +\showlink(http://www.crank.net/) and +\showlink(http://www.pollywannacracka.com/). +) + +\p(\link(thissite.htm, These files are created with GNU m4 \__m4_version__).) + + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/WWW/m4lib/visions.m4 b/doc/examples/WWW/m4lib/visions.m4 new file mode 100644 index 00000000..ba238ca9 --- /dev/null +++ b/doc/examples/WWW/m4lib/visions.m4 @@ -0,0 +1,232 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([The Road Ahead]) + +\define([originator], +[\p([Idea contributed by [$1]]\ifelse($#, 2, [ (\mailto([$2]))])[.])]) + +\define([noone], [\p([There is no-one working on this now. Do you want +to volunteer?])]) + + +\define([done], [\p([Done in version 1.4$1])]) + + +\divert(1) +\h2([Ideas for future versions of GNU m4]) + +\p([Here are some ideas and suggestion for the future of GNU m4, large +and small. The order here is fairly random.]) + +\ul([ + +\item([guile], [Guile as an extension language], + +[\p([\link([http://www.red-bean.com/guile/], [Guile]) can be used as an +extension language so complicated macros can be written in Scheme while +still maintaining the m4 interface. It will require some changes to the +base code, as guile cannot be used from a module.]) + +\noone +]) + + +\item([utf8], [UTF-8 or wide characters], + +[\p([GNU m4 should be able to handle UTF-8 input or wide characters so +it can be more usable for different environments.]) + +\noone +]) + + +\item([pquote], [Syntax: persistent quotes], + +[\p([Persistent quotes is a way of getting text unharmed through m4's +processing. While normal quotes are stripped when a quoted string is +read, the persistent quotes are removed just before being output. This +will ensure that the quoted text is always output verbatim.]) + +\p([The bulk of the changes will be in the parser (in input.c function +next_token). Persistent quotes cannot be nested, they must balance +within a normally quoted string, but normal quotes need not balance +within persistent quotes (neither within persistent quotes within normal +quotes). The quotes should be removed before being shipped out (in +macro.c).]) + +\noone +]) + + + + +\item([comment2], [Syntax: removable comments], + +[\p([With the syntax table a category for discardable comments can be +defined, causing that type of comments to be discarded.]) + +\noone +]) + + + + +\item([comment1], [Option: remove comments], + +[\p([There should be an option (--discard-comments) to get m4 to discard +comments instead of passing them to the output.]) + +\done(n) +]) + + + +\item([deps], [Option: show dependencies], + +[\p([There should be an options to generate makefile dependencies for an +M4 input file.]) + +\p([It is not enough to scan the files for includes, as file names can +be generated and builtins renamed. To make it work, m4 will have to do +a complete run of the input file, discard the output and print the +dependencies instead.]) + +\p([It cannot be made to work in all cases when input file names are +generated on the fly.]) + +\noone +]) + + +\item([safer], [Option: render GNU m4 safer], + +[\p([There should be a --safer option that disables all functions, that +could compromise system security if used by root. It will have to +include various functions, such as file inclusion, sub shells, module +loading, ...]) + +\noone +]) + + + +\item([import], [Option: import environment], + +[\p([An option to defined each environment variable as a macro on +startup would be useful in many cases.]) + +\done(n) +]) + + + +\item([m4expand], [Builtin: quote expanded text], + +[\p([A builtin to quote expanded text would be useful. Now it is not +possible to quote the expansion of a macro; the macro itself has to +provide the quotes. Some builtins return quoted strings, others +don't.]) + +\p([A possible solution is a build in macro that takes one argument. It +expands this argument fully and returns the quoted expansion.]) + +\p([It will require changes to input handling and macro expansion code.]) + +\noone +]) + + + +\item([perl], [Module: embedded perl], + +[\p([Perl could be embedded in m4, giving users a powerful programming +language for writing macros. A single builtin "perleval" could do the +job. First argument could be a perl function and the rest arguments. +The return value of the function as a string would be the expansion.]) + +\p([The perl interpreter should be set up when the module is loaded and +closed down before m4 exits, using the appropriate hooks in the module +interface.]) + +\p([A perl module could potentially give users access to any facility +perl has access to, such as databases.]) + +\p([On systems with perl compiled as a shared library the size penalty +would be minimal.]) + +\p([(It might not be workable as a module, as it will need to link with non-shared libraries. Don't know how it can be fixed. (RS))]) + +\noone +]) + + + +\item([output], [Module: better output control], + +[\p([It has been suggested a couple of times that it should be possible +to divert to named files, in order to create several output files.]) + +\p([I think this a bit a misunderstanding. Diversion are inteded to be +brought back later, ie, they are temporary and recoverable. Output +text, on the other hand, once output it is lost (for m4). Therefore +better output control should be made in a different way.]) + +\p([My suggestion is a set of builtins defined by a module:]) + +\pre([setoutput(file) +appendoutput(file) +pipeoutput(command)]) + +\p([With these output can be directed better, diversion can be sent to +different files, and groups of files can be built by a single m4 run. +Calling \tt(setoutput) without arguments should resume output to +standard output.]) + +\p([(Admittedly, diversion 0 (standard output) has always been +different, as it cannot be undiverted.)]) + +\noone +]) + + + +\item([require], [Module: require/provide functionality], + +[\p([Two new builtins \tt(require) and \tt(provide) could provide a +handy interface to include. It has proven difficult to write these +robustly as normal macros. As an example, the files \tt(test.m4) and +\tt(../test.m4) could be the same file or different files depending on +the search path.]) + +\noone +]) + + +]) + + + +\p([See also the \link(todo.htm, TODO) file.]) + +\print_items + + + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) + +\divert(3)saljdfnaskdjfndsa\divert(-1) + + + + +\item([], [], + +[\p([]) + +\noone +]) + +\undivert diff --git a/doc/examples/WWW/m4lib/whatis.m4 b/doc/examples/WWW/m4lib/whatis.m4 new file mode 100644 index 00000000..2fa1c426 --- /dev/null +++ b/doc/examples/WWW/m4lib/whatis.m4 @@ -0,0 +1,48 @@ +include(`setup.m4') + +\set_author([René Seindal]) +\set_title([What is GNU m4]) + +\divert(1) + +\p([GNU \tt(m4) is an implementation of the traditional Unix macro +processor. GNU m4 is mostly compatible with the System V, Release 3 +version, and SVR4, although it has some extensions (for example, +handling more than 9 positional parameters to macros). GNU \tt(m4) +also has built-in functions for including files, running shell +commands, doing arithmetic, etc.]) + +\p([GNU \tt(m4) is a macro processor, in the sense that it copies its +input to the output, expanding macros as it goes. Macros are either +builtin or user-defined, and can take any number of arguments. Besides +just doing macro expansion, m4 has builtin functions for including named +files, running UNIX commands, doing integer arithmetic, manipulating +text in various ways, recursion, etc... m4 can be used either as a +front-end to a compiler, or as a macro processor in its own right.]) + +\p([The m4 macro processor is widely available on all UNIXes. Usually, +only a small percentage of users are aware of its existence. However, +those who do often become commited users. The growing popularity of GNU +Autoconf, which prerequires GNU m4 for generating the `configure' +scripts, is an incentive for many to install it, while these people will +not themselves program in m4.]) + +\p([Some people found m4 to be fairly addictive. They first use m4 for +simple problems, then take bigger and bigger challenges, learning how to +write complex m4 sets of macros along the way. Once really addicted, +users pursue writing of sophisticated m4 applications even to solve +simple problems, devoting more time debugging their m4 scripts than +doing real work. Beware that m4 may be dangerous for the health of +compulsive programmers.]) + +\p([Autoconf needs GNU m4 for generating `configure' scripts, but not for +running them.]) + +\p([GNU m4 is a Unix program. It is designed to work in a Unix-like +environment. GNU m4 1.4 has, however, been ported to DJGPP, the GNU C +compiler for DOS/Windows. These files are present in the +\link(download.htm, download area).]) + +\divert(0)\dnl +\DO_LAYOUT([\undivert(1)]) +\divert(-1) diff --git a/doc/examples/capitalize.m4 b/doc/examples/capitalize.m4 new file mode 100644 index 00000000..d4e4a502 --- /dev/null +++ b/doc/examples/capitalize.m4 @@ -0,0 +1,12 @@ +divert(`-1') +# upcase(text) +# downcase(text) +# capitalize(text) +# change case of text, simple version +define(`upcase', `translit(`$*', `a-z', `A-Z')') +define(`downcase', `translit(`$*', `A-Z', `a-z')') +define(`_capitalize', + `regexp(`$1', `^\(\w\)\(\w*\)', + `upcase(`\1')`'downcase(`\2')')') +define(`capitalize', `patsubst(`$1', `\w+', `_$0(`\&')')') +divert`'dnl diff --git a/doc/examples/capitalize2.m4 b/doc/examples/capitalize2.m4 new file mode 100644 index 00000000..154dc505 --- /dev/null +++ b/doc/examples/capitalize2.m4 @@ -0,0 +1,19 @@ +divert(`-1') +# upcase(text) +# downcase(text) +# capitalize(text) +# change case of text, improved version +define(`upcase', `translit(`$*', `a-z', `A-Z')') +define(`downcase', `translit(`$*', `A-Z', `a-z')') +define(`_arg1', `$1') +define(`_to_alt', `changequote(`<<[', `]>>')') +define(`_from_alt', `changequote(<<[`]>>, <<[']>>)') +define(`_upcase_alt', `translit(<<[$*]>>, <<[a-z]>>, <<[A-Z]>>)') +define(`_downcase_alt', `translit(<<[$*]>>, <<[A-Z]>>, <<[a-z]>>)') +define(`_capitalize_alt', + `regexp(<<[$1]>>, <<[^\(\w\)\(\w*\)]>>, + <<[_upcase_alt(<<[<<[\1]>>]>>)_downcase_alt(<<[<<[\2]>>]>>)]>>)') +define(`capitalize', + `_arg1(_to_alt()patsubst(<<[<<[$*]>>]>>, <<[\w+]>>, + _from_alt()`]>>_$0_alt(<<[\&]>>)<<['_to_alt())_from_alt())') +divert`'dnl diff --git a/doc/examples/comments.m4 b/doc/examples/comments.m4 new file mode 100644 index 00000000..c1e3be0a --- /dev/null +++ b/doc/examples/comments.m4 @@ -0,0 +1,7 @@ +# An ordinary comment +define(`foo', # A comment in a macro +`Macro `foo' expansion') +foo +define(`comment', `*** Macro `comment' expansion ***') +changecom(`@', `@') +foo diff --git a/doc/examples/curry.m4 b/doc/examples/curry.m4 new file mode 100644 index 00000000..00997c38 --- /dev/null +++ b/doc/examples/curry.m4 @@ -0,0 +1,7 @@ +divert(`-1') +# curry(macro, args) +# Expand to a macro call that takes one argument, then invoke +# macro(args, extra). +define(`curry', `$1(shift($@,)_$0') +define(`_curry', ``$1')') +divert`'dnl diff --git a/doc/examples/ddivert.m4 b/doc/examples/ddivert.m4 new file mode 100644 index 00000000..e6e0017e --- /dev/null +++ b/doc/examples/ddivert.m4 @@ -0,0 +1,4 @@ +divert(1)Text diverted a first time. +divert(0)undivert(1)dnl +divert(1)Text diverted a second time. +divert(0)undivert(1)dnl diff --git a/doc/examples/debug.m4 b/doc/examples/debug.m4 new file mode 100644 index 00000000..16f4c74e --- /dev/null +++ b/doc/examples/debug.m4 @@ -0,0 +1,4 @@ +define(`countdown', `$1 ifelse(eval($1 > 0), 1, `countdown(decr($1))', `Liftoff')') +debugmode(`aeqc') +traceon(`countdown') +countdown(2) diff --git a/doc/examples/esyscmd.m4 b/doc/examples/esyscmd.m4 new file mode 100644 index 00000000..3c856e02 --- /dev/null +++ b/doc/examples/esyscmd.m4 @@ -0,0 +1,6 @@ +# Cannot use real hostname program because test would fail +define(`hostname', esyscmd(`echo www.gnu.org'))dnl +`hostname = >>'hostname`<<' +define(`hostname', +pushdef(`_tmp', `$1')_tmp(translit(esyscmd(`echo www.gnu.org'), `.', `,'))`'popdef(`_tmp'))dnl +`hostname = >>'hostname`<<' diff --git a/doc/examples/exp.m4 b/doc/examples/exp.m4 new file mode 100644 index 00000000..e2bcf943 --- /dev/null +++ b/doc/examples/exp.m4 @@ -0,0 +1,3 @@ +define(`countdown', `$1 +ifelse(eval($1 > 0), 1, `countdown(decr($1))', `Done')')dnl +countdown(7) diff --git a/doc/examples/foreach.m4 b/doc/examples/foreach.m4 new file mode 100644 index 00000000..9be25b08 --- /dev/null +++ b/doc/examples/foreach.m4 @@ -0,0 +1,8 @@ +divert(`-1') +# foreach(x, (item_1, item_2, ..., item_n), stmt) +# parenthesized list, simple version +define(`foreach', `pushdef(`$1')_foreach($@)popdef(`$1')') +define(`_arg1', `$1') +define(`_foreach', `ifelse(`$2', `()', `', + `define(`$1', _arg1$2)$3`'$0(`$1', (shift$2), `$3')')') +divert`'dnl diff --git a/doc/examples/foreach2.m4 b/doc/examples/foreach2.m4 new file mode 100644 index 00000000..74d00fb6 --- /dev/null +++ b/doc/examples/foreach2.m4 @@ -0,0 +1,10 @@ +include(`quote.m4')dnl +divert(`-1') +# foreach(x, (item_1, item_2, ..., item_n), stmt) +# parenthesized list, improved version +define(`foreach', `pushdef(`$1')_$0(`$1', + (dquote(dquote_elt$2)), `$3')popdef(`$1')') +define(`_arg1', `$1') +define(`_foreach', `ifelse(`$2', `(`')', `', + `define(`$1', _arg1$2)$3`'$0(`$1', (dquote(shift$2)), `$3')')') +divert`'dnl diff --git a/doc/examples/foreachq.m4 b/doc/examples/foreachq.m4 new file mode 100644 index 00000000..d34fb5b9 --- /dev/null +++ b/doc/examples/foreachq.m4 @@ -0,0 +1,9 @@ +include(`quote.m4')dnl +divert(`-1') +# foreachq(x, `item_1, item_2, ..., item_n', stmt) +# quoted list, simple version +define(`foreachq', `pushdef(`$1')_foreachq($@)popdef(`$1')') +define(`_arg1', `$1') +define(`_foreachq', `ifelse(quote($2), `', `', + `define(`$1', `_arg1($2)')$3`'$0(`$1', `shift($2)', `$3')')') +divert`'dnl diff --git a/doc/examples/foreachq2.m4 b/doc/examples/foreachq2.m4 new file mode 100644 index 00000000..f57d3edf --- /dev/null +++ b/doc/examples/foreachq2.m4 @@ -0,0 +1,10 @@ +include(`quote.m4')dnl +divert(`-1') +# foreachq(x, `item_1, item_2, ..., item_n', stmt) +# quoted list, improved version +define(`foreachq', `pushdef(`$1')_$0($@)popdef(`$1')') +define(`_arg1q', ``$1'') +define(`_rest', `ifelse(`$#', `1', `', `dquote(shift($@))')') +define(`_foreachq', `ifelse(`$2', `', `', + `define(`$1', _arg1q($2))$3`'$0(`$1', _rest($2), `$3')')') +divert`'dnl diff --git a/doc/examples/foreachq3.m4 b/doc/examples/foreachq3.m4 new file mode 100644 index 00000000..5e656727 --- /dev/null +++ b/doc/examples/foreachq3.m4 @@ -0,0 +1,9 @@ +divert(`-1') +# foreachq(x, `item_1, item_2, ..., item_n', stmt) +# quoted list, alternate improved version +define(`foreachq', `ifelse(`$2', `', `', + `pushdef(`$1')_$0(`$1', `$3', `', $2)popdef(`$1')')') +define(`_foreachq', `ifelse(`$#', `3', `', + `define(`$1', `$4')$2`'$0(`$1', `$2', + shift(shift(shift($@))))')') +divert`'dnl diff --git a/doc/examples/foreachq4.m4 b/doc/examples/foreachq4.m4 new file mode 100644 index 00000000..3da64c92 --- /dev/null +++ b/doc/examples/foreachq4.m4 @@ -0,0 +1,13 @@ +include(`forloop2.m4')dnl +divert(`-1') +# foreachq(x, `item_1, item_2, ..., item_n', stmt) +# quoted list, version based on forloop +define(`foreachq', +`ifelse(`$2', `', `', `_$0(`$1', `$3', $2)')') +define(`_foreachq', +`pushdef(`$1', forloop(`$1', `3', `$#', + `$0_(`1', `2', indir(`$1'))')`popdef( + `$1')')indir(`$1', $@)') +define(`_foreachq_', +``define(`$$1', `$$3')$$2`''') +divert`'dnl diff --git a/doc/examples/forloop.m4 b/doc/examples/forloop.m4 new file mode 100644 index 00000000..fdca2608 --- /dev/null +++ b/doc/examples/forloop.m4 @@ -0,0 +1,6 @@ +divert(`-1') +# forloop(var, from, to, stmt) - simple version +define(`forloop', `pushdef(`$1', `$2')_forloop($@)popdef(`$1')') +define(`_forloop', + `$4`'ifelse($1, `$3', `', `define(`$1', incr($1))$0($@)')') +divert`'dnl diff --git a/doc/examples/forloop2.m4 b/doc/examples/forloop2.m4 new file mode 100644 index 00000000..b7154e86 --- /dev/null +++ b/doc/examples/forloop2.m4 @@ -0,0 +1,12 @@ +divert(`-1') +# forloop(var, from, to, stmt) - improved version: +# works even if VAR is not a strict macro name +# performs sanity check that FROM is larger than TO +# allows complex numerical expressions in TO and FROM +define(`forloop', `ifelse(eval(`($2) <= ($3)'), `1', + `pushdef(`$1')_$0(`$1', eval(`$2'), + eval(`$3'), `$4')popdef(`$1')')') +define(`_forloop', + `define(`$1', `$2')$4`'ifelse(`$2', `$3', `', + `$0(`$1', incr(`$2'), `$3', `$4')')') +divert`'dnl diff --git a/doc/examples/forloop3.m4 b/doc/examples/forloop3.m4 new file mode 100644 index 00000000..98db20f3 --- /dev/null +++ b/doc/examples/forloop3.m4 @@ -0,0 +1,13 @@ +divert(`-1') +# forloop_arg(from, to, macro) - invoke MACRO(value) for +# each value between FROM and TO, without define overhead +define(`forloop_arg', `ifelse(eval(`($1) <= ($2)'), `1', + `_forloop(`$1', eval(`$2'), `$3(', `)')')') +# forloop(var, from, to, stmt) - refactored to share code +define(`forloop', `ifelse(eval(`($2) <= ($3)'), `1', + `pushdef(`$1')_forloop(eval(`$2'), eval(`$3'), + `define(`$1',', `)$4')popdef(`$1')')') +define(`_forloop', + `$3`$1'$4`'ifelse(`$1', `$2', `', + `$0(incr(`$1'), `$2', `$3', `$4')')') +divert`'dnl diff --git a/doc/examples/fstab.m4 b/doc/examples/fstab.m4 new file mode 100644 index 00000000..8d10e176 --- /dev/null +++ b/doc/examples/fstab.m4 @@ -0,0 +1,6 @@ +define(`concat', `translit(``$*'', ` ')') +define(`fsent', `format(`%-25s %-16s nfs %-16s 0 0', `$1:$2', `$3', concat$4)') + +fsent(freja, /home/gevn, /home/gevn, (rw, soft, bg, grpid)) +fsent(freja, /home/freja, /home/freja, (rw, soft, grpid)) +fsent(rimfaxe, /home/rimfaxe, /home/rimfaxe, (rw, soft, bg)) diff --git a/doc/examples/hanoi.m4 b/doc/examples/hanoi.m4 new file mode 100644 index 00000000..32fd8a41 --- /dev/null +++ b/doc/examples/hanoi.m4 @@ -0,0 +1,17 @@ +divert(-1) + +# move(from, to) +define(`move', `Move one disk from `$1' to `$2'. +') + +# _hanoi (cnt, from, to, aux) +define(`_hanoi', `ifelse(eval(`$1'<=1), 1, `move($2, $3)', +`$0(decr($1), $2, $4, $3)move($2, $3)$0(decr($1), $4, $3, $2)')') + +# hanoi (cnt) +define(`hanoi', `_$0(`$1', source, destination, auxilliary)') + +# traceon(`move', `_hanoi', `decr') +divert`'dnl + +hanoi(3) diff --git a/doc/examples/incl-test.m4 b/doc/examples/incl-test.m4 new file mode 100644 index 00000000..323fa05b --- /dev/null +++ b/doc/examples/incl-test.m4 @@ -0,0 +1,3 @@ +dnl noauto +`include test file.' +define() diff --git a/doc/examples/incl.m4 b/doc/examples/incl.m4 new file mode 100644 index 00000000..ab9572eb --- /dev/null +++ b/doc/examples/incl.m4 @@ -0,0 +1,3 @@ +Include file start +foo +Include file end diff --git a/doc/examples/include.m4 b/doc/examples/include.m4 new file mode 100644 index 00000000..8e9d9d2f --- /dev/null +++ b/doc/examples/include.m4 @@ -0,0 +1,7 @@ +Beginning. +include(`NOFILE') +Intermediate +include(`incl-test.m4') +After +include(`NOFILE') +very late diff --git a/doc/examples/indir.m4 b/doc/examples/indir.m4 new file mode 100644 index 00000000..51d2b64f --- /dev/null +++ b/doc/examples/indir.m4 @@ -0,0 +1,10 @@ +define(`%%$$##', `>>>$0<<< cnt $#') + +# indir(`%%$$##', nonsense, nonsense) +indir(`%%$$##', nonsense, nonsense) + +# indir(`indir', `%%$$##', nonsense) +indir(`indir', `%%$$##', nonsense) + +# indir(`indir', `indir', `indir', `indir', `%%$$##') +indir(`indir', `indir', `indir', `indir', `%%$$##') diff --git a/doc/examples/join.m4 b/doc/examples/join.m4 new file mode 100644 index 00000000..8687ac70 --- /dev/null +++ b/doc/examples/join.m4 @@ -0,0 +1,15 @@ +divert(`-1') +# join(sep, args) - join each non-empty ARG into a single +# string, with each element separated by SEP +define(`join', +`ifelse(`$#', `2', ``$2'', + `ifelse(`$2', `', `', ``$2'_')$0(`$1', shift(shift($@)))')') +define(`_join', +`ifelse(`$#$2', `2', `', + `ifelse(`$2', `', `', ``$1$2'')$0(`$1', shift(shift($@)))')') +# joinall(sep, args) - join each ARG, including empty ones, +# into a single string, with each element separated by SEP +define(`joinall', ``$2'_$0(`$1', shift($@))') +define(`_joinall', +`ifelse(`$#', `2', `', ``$1$3'$0(`$1', shift(shift($@)))')') +divert`'dnl diff --git a/doc/examples/loop.m4 b/doc/examples/loop.m4 new file mode 100644 index 00000000..b2fc64c4 --- /dev/null +++ b/doc/examples/loop.m4 @@ -0,0 +1,18 @@ +dnl Stress test for recursion algorithms. Usage: +dnl m4 -Ipath/to/examples [-Doptions] loop.m4 +dnl Options include: +dnl -Dalt[=] - test with foreachq instead of foreachq2, default 3 +dnl -Dlimit= - set upper limit of sequence to , default 1000 +dnl -Dverbose - print the sequence to the screen, rather than discarding +dnl -Ddebug[=] - execute after forloop but before foreach +dnl -Dsleep= - sleep for seconds before exit, to allow time +dnl to examine peak process memory usage +include(`forloop2.m4')dnl +include(`quote.m4')dnl +ifelse(alt, `alt', `define(`alt', `2')', alt, `', `define(`alt', `3')')dnl +include(`foreachq'alt`.m4')dnl +ifdef(`limit', `', `define(`limit', `1000')')dnl +ifdef(`verbose', `', `divert(`-1')')dnl +ifdef(`debug', `', `define(`debug')')dnl +foreachq(`i', dquote(1forloop(`i', `2', limit, `,i'))debug, ` i') +ifdef(`sleep',`syscmd(`echo done>/dev/tty;sleep 'sleep)')dnl diff --git a/doc/examples/misc.m4 b/doc/examples/misc.m4 new file mode 100644 index 00000000..979b51aa --- /dev/null +++ b/doc/examples/misc.m4 @@ -0,0 +1,8 @@ +divert(-1) +define(`USER', `root') +define(`TMP', maketemp(`/tmp/hejXXXXXX')) +syscmd(`grep "^'USER`:" /etc/passwd | awk -F: "{print \$3}"' > TMP) +define(`UID', include(TMP)) +syscmd(`rm -f' TMP) +divert +UID diff --git a/doc/examples/modtest.m4 b/doc/examples/modtest.m4 new file mode 100644 index 00000000..c61ed6f6 --- /dev/null +++ b/doc/examples/modtest.m4 @@ -0,0 +1,7 @@ +dnl Copyright (C) 2006, 2010, 2013 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it +dnl with or without modifications, as long as this notice is preserved. +load(`modtest') +test +Dumpdef: dumpdef(`test'). diff --git a/doc/examples/multiquotes.m4 b/doc/examples/multiquotes.m4 new file mode 100644 index 00000000..b56cfbd8 --- /dev/null +++ b/doc/examples/multiquotes.m4 @@ -0,0 +1,17 @@ +traceon +changequote([,])dnl +changequote([``], [''])dnl +````traceon'''' +define(``foo'', ````FOO'''')dnl +dumpdef(``foo'')dnl +changequote(``!'', ``!'')dnl +!foo! +foo +dumpdef(!foo!)dnl +define(!bar!, !BAR!) +bar +changequote(!>*>*>*>*>!, !<*<*<*<**>*>*>*>foo bar<*<*<*<*< +foo bar +>*>*>*>*>*>*><*<*<*<*<*<*< +dumpdef(>*>*>*>*>foo<*<*<*<*<, >*>*>*>*>bar<*<*<*<*<)dnl diff --git a/doc/examples/patsubst.m4 b/doc/examples/patsubst.m4 new file mode 100644 index 00000000..9b4c7591 --- /dev/null +++ b/doc/examples/patsubst.m4 @@ -0,0 +1,8 @@ +# traceon(`patsubst') +patsubst(`GNUs not Unix.', `^', `OBS: ') +patsubst(`GNUs not Unix.', `\<', `OBS: ') +patsubst(`GNUs not Unix.', `\<\w', `\0=') +patsubst(`GNUs not Unix.', `\w*', `(\0)') +patsubst(`GNUs not Unix.', `\w+', `(\0)') +patsubst(`GNUs not Unix.', `\w+') +patsubst(`GNUs not '` Unix.', `[ ]+', ` ') diff --git a/doc/examples/pushpop.m4 b/doc/examples/pushpop.m4 new file mode 100644 index 00000000..d0f2ebb8 --- /dev/null +++ b/doc/examples/pushpop.m4 @@ -0,0 +1,25 @@ +divert(-1) +pushdef(`hej', `def 1.') +dumpdef(`hej') +pushdef(`hej', `def 2.') +dumpdef(`hej') +pushdef(`hej', `def 3.') +dumpdef(`hej') +pushdef(`hej', `def 4.') +dumpdef(`hej') + +popdef(`hej') +dumpdef(`hej') +popdef(`hej') +dumpdef(`hej') +popdef(`hej') +dumpdef(`hej') +popdef(`hej') +dumpdef(`hej') +popdef(`hej') +dumpdef(`hej') +popdef(`hej') + +dumpdef(`mac2') +popdef(`mac2') +dumpdef(`mac2') diff --git a/doc/examples/quote.m4 b/doc/examples/quote.m4 new file mode 100644 index 00000000..fae52c3e --- /dev/null +++ b/doc/examples/quote.m4 @@ -0,0 +1,9 @@ +divert(`-1') +# quote(args) - convert args to single-quoted string +define(`quote', `ifelse(`$#', `0', `', ``$*'')') +# dquote(args) - convert args to quoted list of quoted strings +define(`dquote', ``$@'') +# dquote_elt(args) - convert args to list of double-quoted strings +define(`dquote_elt', `ifelse(`$#', `0', `', `$#', `1', ```$1''', + ```$1'',$0(shift($@))')') +divert`'dnl diff --git a/doc/examples/regexp.m4 b/doc/examples/regexp.m4 new file mode 100644 index 00000000..a4ca573e --- /dev/null +++ b/doc/examples/regexp.m4 @@ -0,0 +1,12 @@ +traceon(`regexp')dnl +regexp(`hej med dig', `.*', `>>\0<<') +regexp(`hej med dig', `\w*', `>>\0<<') +regexp(`hej med dig', `.+', `>>\0<<') +regexp(`hej med dig', `m\w+', `>>\0<<') +regexp(`hej med dig', `m\(.*\)', `>>\0<< >>\1<<') + +regexp(`hej med dig', `.*') +regexp(`hej med dig', `\w*') +regexp(`hej med dig', `.+') +regexp(`hej med dig', `m\w+') +regexp(`hej med dig', `m\(.*\)') diff --git a/doc/examples/reverse.m4 b/doc/examples/reverse.m4 new file mode 100644 index 00000000..7e2374e2 --- /dev/null +++ b/doc/examples/reverse.m4 @@ -0,0 +1,4 @@ +define(`reverse', `ifelse(eval($# > 1), 1, `reverse(shift($@)), `$1'', ``$1'')') +``'' => reverse. +``hej'' => reverse(hej). +``hej, med, dig'' => reverse(hej, med, dig). diff --git a/doc/examples/shadow.m4 b/doc/examples/shadow.m4 new file mode 100644 index 00000000..f13b7dfa --- /dev/null +++ b/doc/examples/shadow.m4 @@ -0,0 +1,57 @@ +dnl Copyright (C) 2006, 2010, 2013 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it +dnl with or without modifications, as long as this notice is preserved. +# no modules loaded yet +test +shadow + +# define our own macros for `test' and `shadow' +define(`test', `local::`test'') +define(`shadow', `local::`shadow'') +test +shadow + +# module Shadow defines `shadow' and `test' macros +load(`shadow') +dumpdef(`test') +dumpdef(`shadow') +test +shadow + +# save the definition of `test' from the Shadow module +define(`Shadow::test', defn(`test')) + +# module Test also defines a `test' macro +load(`modtest') +dumpdef(`test') +dumpdef(`shadow') +test +shadow + +# Reloading Shadow shouldn't affect anything +load(`shadow') +dumpdef(`test') +dumpdef(`shadow') +test +shadow + +# Unloading Test will unshadow the test definition in Shadow +unload(`modtest') +dumpdef(`test') +dumpdef(`shadow') +test +shadow + +# Unloading Shadow once has no effect (we loaded it twice) +unload(`shadow') +dumpdef(`test') +dumpdef(`shadow') +test +shadow + +# Unloading Shadow again will revert to copying `test' and the local +# `shadow' macro. +unload(`shadow') +test +shadow diff --git a/doc/examples/stack.m4 b/doc/examples/stack.m4 new file mode 100644 index 00000000..c1b98333 --- /dev/null +++ b/doc/examples/stack.m4 @@ -0,0 +1,16 @@ +divert(`-1') +# stack_foreach(macro, action) +# Invoke ACTION with a single argument of each definition +# from the definition stack of MACRO, starting with the oldest. +define(`stack_foreach', +`_stack_reverse(`$1', `tmp-$1')'dnl +`_stack_reverse(`tmp-$1', `$1', `$2(defn(`$1'))')') +# stack_foreach_lifo(macro, action) +# Invoke ACTION with a single argument of each definition +# from the definition stack of MACRO, starting with the newest. +define(`stack_foreach_lifo', +`_stack_reverse(`$1', `tmp-$1', `$2(defn(`$1'))')'dnl +`_stack_reverse(`tmp-$1', `$1')') +define(`_stack_reverse', +`ifdef(`$1', `pushdef(`$2', defn(`$1'))$3`'popdef(`$1')$0($@)')') +divert`'dnl diff --git a/doc/examples/stack_sep.m4 b/doc/examples/stack_sep.m4 new file mode 100644 index 00000000..767d15e2 --- /dev/null +++ b/doc/examples/stack_sep.m4 @@ -0,0 +1,17 @@ +divert(`-1') +# stack_foreach_sep(macro, pre, post, sep) +# Invoke PRE`'defn`'POST with a single argument of each definition +# from the definition stack of MACRO, starting with the oldest, and +# separated by SEP between definitions. +define(`stack_foreach_sep', +`_stack_reverse_sep(`$1', `tmp-$1')'dnl +`_stack_reverse_sep(`tmp-$1', `$1', `$2`'defn(`$1')$3', `$4`'')') +# stack_foreach_sep_lifo(macro, pre, post, sep) +# Like stack_foreach_sep, but starting with the newest definition. +define(`stack_foreach_sep_lifo', +`_stack_reverse_sep(`$1', `tmp-$1', `$2`'defn(`$1')$3', `$4`'')'dnl +`_stack_reverse_sep(`tmp-$1', `$1')') +define(`_stack_reverse_sep', +`ifdef(`$1', `pushdef(`$2', defn(`$1'))$3`'popdef(`$1')$0( + `$1', `$2', `$4$3')')') +divert`'dnl diff --git a/doc/examples/stdlib.m4 b/doc/examples/stdlib.m4 new file mode 100644 index 00000000..df0a91dd --- /dev/null +++ b/doc/examples/stdlib.m4 @@ -0,0 +1,44 @@ +dnl Copyright (C) 2006, 2010, 2013 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it +dnl with or without modifications, as long as this notice is preserved. +load(`stdlib') + +`getenv - 'getenv(PATH) + +setenv TEST=??? setenv(`TEST', `???') +getenv TEST - getenv(`TEST') + +setenv TEST=Second test setenv(`TEST', `Second test') +getenv TEST - getenv(`TEST') + +unsetenv TEST unsetenv(`TEST') +getenv TEST - getenv(`TEST') + + + +`getlogin - 'getlogin +`getcwd = 'getcwd +`getpid - 'getpid +`getppid - 'getppid + +syscmd(`ps ajx|grep m4') + +`getuid - 'getuid + +user root - getpwnam(`root') +user sync - getpwnam(`sync') +user rene - getpwnam(`rene') + +uid 5 - getpwuid(5) +me - getpwuid(getuid) + +`hostname = 'hostname + +`rand' - rand,rand,rand,rand +`srand' srand +`rand' - rand,rand,rand,rand +`srand' srand +`rand' - rand,rand,rand,rand + +`uname - ' uname diff --git a/doc/examples/sysv-args.m4 b/doc/examples/sysv-args.m4 new file mode 100644 index 00000000..7c82beb0 --- /dev/null +++ b/doc/examples/sysv-args.m4 @@ -0,0 +1,14 @@ +divert(-1) +define(`nargs', `$#') +define(`concat', `ifelse(1, $#, `$1', `$1` 'concat(shift($@))')') +traceon(`concat', `nargs') +divert + +nargs +nargs() +nargs(1,2,3,4,5,6) + +concat() +concat(`hej', `med', `dig') +concat(`hej', `med', `dig', `en gang igen') +concat(an, awful, lot, of, argument, at, least, more, that, ten, silly, arguments) diff --git a/doc/examples/time.m4 b/doc/examples/time.m4 new file mode 100644 index 00000000..77341308 --- /dev/null +++ b/doc/examples/time.m4 @@ -0,0 +1,20 @@ +dnl Copyright (C) 2006, 2010, 2013 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it +dnl with or without modifications, as long as this notice is preserved. +load(`time') + +`currenttime' = currenttime +`ctime' = ctime != ctime(eval(currenttime+60*60*24)) +gmtime = gmtime(currenttime) +localtime = localtime(currenttime) +define(`q', `$1,$2,$3,$4,$5,$6,$9')dnl + +currenttime +eval(currenttime+60*60*24) +localtime(eval(currenttime+60*60*24)) +q(localtime(eval(currenttime+60*60*24))) +mktime = mktime(q(localtime(eval(currenttime+60*60*24)))) + +%A %B %d, %Y = strftime(`%A %B %d, %Y', currenttime) +%X on %x = strftime(`%X on %x', currenttime) diff --git a/doc/examples/time2.m4 b/doc/examples/time2.m4 new file mode 100644 index 00000000..b0d17b35 --- /dev/null +++ b/doc/examples/time2.m4 @@ -0,0 +1,18 @@ +dnl Copyright (C) 2006, 2010, 2013 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it +dnl with or without modifications, as long as this notice is preserved. +`currenttime' = currenttime +`ctime' = ctime != ctime(eval(currenttime+60*60*24)) +gmtime = gmtime(currenttime) +localtime = localtime(currenttime) +define(`q', `$1,$2,$3,$4,$5,$6,$9')dnl + +currenttime +eval(currenttime+60*60*24) +localtime(eval(currenttime+60*60*24)) +q(localtime(eval(currenttime+60*60*24))) +mktime = mktime(q(localtime(eval(currenttime+60*60*24)))) + +%A %B %d, %Y = strftime(`%A %B %d, %Y', currenttime) +%X on %x = strftime(`%X on %x', currenttime) diff --git a/doc/examples/trace.m4 b/doc/examples/trace.m4 new file mode 100644 index 00000000..92ce9816 --- /dev/null +++ b/doc/examples/trace.m4 @@ -0,0 +1,30 @@ +divert(-1) + +# move(from, to) +define(`move', `Move one disk from `$1' to `$2'. +') + +# _hanoi (cnt, from, to, aux) +define(`_hanoi', `ifelse(eval(`$1'<=1), 1, `move($2, $3)', +`$0(decr($1), $2, $4, $3)move($2, $3)$0(decr($1), $4, $3, $2)')') + +# hanoi (cnt) +define(`hanoi', `_$0(`$1', source, destination, auxilliary)') +divert`'dnl + +# Debugmode t +debugmode(`t') +hanoi(2) + +# Debugmode taeq +debugmode(`taeq') +hanoi(2) + +# Debugmode OFF +debugmode +hanoi(2) + +# Debugmode ae +debugmode(`ae') +traceon(`move', `_hanoi') +hanoi(2) diff --git a/doc/examples/translit.m4 b/doc/examples/translit.m4 new file mode 100644 index 00000000..078d1726 --- /dev/null +++ b/doc/examples/translit.m4 @@ -0,0 +1,8 @@ +# traceon(`translit')dnl +translit(`GNUs not Unix', `a-z') +translit(`GNUs not Unix', `a-z', `A-Z') +translit(`GNUs not Unix', `A-Z', `a-z') +translit(`GNUs not Unix', `A-Z') +translit(`a-z', `a-') +translit(`A-Z', `A-Z-', `-A-Z') +translit(`GNUs not Unix', `Z-A', `a-z') diff --git a/doc/examples/undivert.incl b/doc/examples/undivert.incl new file mode 100644 index 00000000..408e0e20 --- /dev/null +++ b/doc/examples/undivert.incl @@ -0,0 +1 @@ +This is to be undiverted soon. diff --git a/doc/examples/undivert.m4 b/doc/examples/undivert.m4 new file mode 100644 index 00000000..61dfb391 --- /dev/null +++ b/doc/examples/undivert.m4 @@ -0,0 +1,5 @@ +define(`undiverted', `UNDIVERTED') +# undiverted file. +undivert(`undivert.incl') +# included file. +include(`undivert.incl') diff --git a/doc/examples/wrap.m4 b/doc/examples/wrap.m4 new file mode 100644 index 00000000..bbe7ae0b --- /dev/null +++ b/doc/examples/wrap.m4 @@ -0,0 +1,10 @@ +divert(-1) +m4wrap(`Wrapper no. 1 +') + +m4wrap(`Wrapper no. 2 +m4wrap(`Wrapper no. 3 +m4wrap(`Wrapper no. 4 +')')') +divert +No. 33: The End. diff --git a/doc/examples/wrapfifo.m4 b/doc/examples/wrapfifo.m4 new file mode 100644 index 00000000..95ff87a0 --- /dev/null +++ b/doc/examples/wrapfifo.m4 @@ -0,0 +1,10 @@ +dnl Redefine m4wrap to have FIFO semantics. +define(`_m4wrap_level', `0')dnl +define(`m4wrap', +`ifdef(`m4wrap'_m4wrap_level, + `define(`m4wrap'_m4wrap_level, + defn(`m4wrap'_m4wrap_level)`$1')', + `builtin(`m4wrap', `define(`_m4wrap_level', + incr(_m4wrap_level))dnl +m4wrap'_m4wrap_level)dnl +define(`m4wrap'_m4wrap_level, `$1')')')dnl diff --git a/doc/examples/wraplifo.m4 b/doc/examples/wraplifo.m4 new file mode 100644 index 00000000..bdbf3fb6 --- /dev/null +++ b/doc/examples/wraplifo.m4 @@ -0,0 +1,10 @@ +dnl Redefine m4wrap to have LIFO semantics. +define(`_m4wrap_level', `0')dnl +define(`_m4wrap', defn(`m4wrap'))dnl +define(`m4wrap', +`ifdef(`m4wrap'_m4wrap_level, + `define(`m4wrap'_m4wrap_level, + `$1'defn(`m4wrap'_m4wrap_level))', + `_m4wrap(`define(`_m4wrap_level', incr(_m4wrap_level))dnl +m4wrap'_m4wrap_level)dnl +define(`m4wrap'_m4wrap_level, `$1')')')dnl diff --git a/doc/examples/wraplifo2.m4 b/doc/examples/wraplifo2.m4 new file mode 100644 index 00000000..5b450a76 --- /dev/null +++ b/doc/examples/wraplifo2.m4 @@ -0,0 +1,9 @@ +dnl Redefine m4wrap to have LIFO semantics, improved example. +include(`join.m4')dnl +define(`_m4wrap', defn(`m4wrap'))dnl +define(`_arg1', `$1')dnl +define(`m4wrap', +`ifdef(`_$0_text', + `define(`_$0_text', joinall(` ', $@)defn(`_$0_text'))', + `_$0(`_arg1(defn(`_$0_text')undefine(`_$0_text'))')dnl +define(`_$0_text', joinall(` ', $@))')')dnl diff --git a/doc/m4.texi b/doc/m4.texi index 77c3a5fe..8d40caee 100644 --- a/doc/m4.texi +++ b/doc/m4.texi @@ -3408,7 +3408,7 @@ by @var{separator}. While @code{joinall} always outputs a @end deffn Here are some examples of its usage, based on the implementation -@file{m4-@value{VERSION}/@/examples/@/join.m4} distributed in this +@file{m4-@value{VERSION}/@/doc/examples/@/join.m4} distributed in this package: @comment examples @@ -3442,7 +3442,7 @@ m4 programming idioms. @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} undivert(`join.m4')dnl @result{}divert(`-1') @result{}# join(sep, args) - join each non-empty ARG into a single @@ -3515,12 +3515,12 @@ quoting are added around each element. @end deffn An actual implementation of these three macros is distributed as -@file{m4-@value{VERSION}/@/examples/@/quote.m4} in this package. First, -let's examine their usage: +@file{m4-@value{VERSION}/@/doc/examples/@/quote.m4} in this package. +First, let's examine their usage: @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`quote.m4') @result{} -quote-dquote-dquote_elt- @@ -3553,7 +3553,7 @@ resulting string. @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} undivert(`quote.m4')dnl @result{}divert(`-1') @result{}# quote(args) - convert args to single-quoted string @@ -3618,7 +3618,7 @@ It can, for example, be used for simple counting: @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`forloop.m4') @result{} forloop(`i', `1', `8', `i ') @@ -3629,7 +3629,7 @@ For-loops can be nested, like: @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`forloop.m4') @result{} forloop(`i', `1', `4', `forloop(`j', `1', `8', ` (i, j)') @@ -3653,11 +3653,11 @@ not finished, it increments the iterator (using the predefined macro @code{incr}, @pxref{Incr}), and recurses. Here is an actual implementation of @code{forloop}, distributed as -@file{m4-@value{VERSION}/@/examples/@/forloop.m4} in this package: +@file{m4-@value{VERSION}/@/doc/examples/@/forloop.m4} in this package: @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} undivert(`forloop.m4')dnl @result{}divert(`-1') @result{}# forloop(var, from, to, stmt) - simple version @@ -3699,12 +3699,12 @@ invocation is restored. As an example, this displays each word in a list inside of a sentence, using an implementation of @code{foreach} distributed as -@file{m4-@value{VERSION}/@/examples/@/foreach.m4}, and @code{foreachq} -in @file{m4-@value{VERSION}/@/examples/@/foreachq.m4}. +@file{m4-@value{VERSION}/@/doc/examples/@/foreach.m4}, and @code{foreachq} +in @file{m4-@value{VERSION}/@/doc/examples/@/foreachq.m4}. @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`foreach.m4') @result{} foreach(`x', (foo, bar, foobar), `Word was: x @@ -3727,7 +3727,7 @@ to a helper macro. This example generates a shell case statement: @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`foreach.m4') @result{} define(`_case', ` $1) @@ -3757,7 +3757,7 @@ through the original list. Here is a simple implementation of @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} undivert(`foreach.m4')dnl @result{}divert(`-1') @result{}# foreach(x, (item_1, item_2, ..., item_n), stmt) @@ -3784,7 +3784,7 @@ rescan: @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} define(`a', `1')define(`b', `2')define(`c', `3') @result{} include(`foreach.m4') @@ -3809,7 +3809,7 @@ Obviously, @code{foreachq} did a better job; here is its implementation: @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} undivert(`foreachq.m4')dnl @result{}include(`quote.m4')dnl @result{}divert(`-1') @@ -3836,7 +3836,7 @@ Invoking m4}). Additionally, this implementation does not expand @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`foreach.m4')include(`foreachq.m4') @result{} foreach(`name', `(`a', `b')', ` defn(`name')') @@ -3873,11 +3873,11 @@ few special macros, such as @code{defn}, which cannot be used as the @end deffn A sample implementation of these macros is distributed in the file -@file{m4-@value{VERSION}/@/examples/@/stack.m4}. +@file{m4-@value{VERSION}/@/doc/examples/@/stack.m4}. @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`stack.m4') @result{} pushdef(`a', `1')pushdef(`a', `2')pushdef(`a', `3') @@ -3913,7 +3913,7 @@ undefined during the algorithm. @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} undivert(`stack.m4')dnl @result{}divert(`-1') @result{}# stack_foreach(macro, action) @@ -4018,12 +4018,12 @@ obvious. The macro @code{stack_foreach} mentioned earlier is an example of a context that provides exactly one argument to a macro name. But coupled with currying, we can invoke @code{reverse} with two arguments for each definition of a macro stack. This example uses the file -@file{m4-@value{VERSION}/@/examples/@/curry.m4} included in the +@file{m4-@value{VERSION}/@/doc/examples/@/curry.m4} included in the distribution. @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`curry.m4')include(`stack.m4') @result{} define(`reverse', `ifelse(`$#', `0', , `$#', `1', ``$1'', @@ -4048,7 +4048,7 @@ directly rather than going through @code{curry}. @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} undivert(`curry.m4')dnl @result{}divert(`-1') @result{}# curry(macro, args) @@ -4067,7 +4067,7 @@ versions: @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`curry.m4') @result{} curry(`define', `mylen')(defn(`len')) @@ -4098,7 +4098,7 @@ M4 versions, or @pxref{Improved copy, , Answers}). @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`curry.m4')include(`stack.m4') @result{} define(`rename', `copy($@@)undefine(`$1')')dnl @@ -4681,14 +4681,14 @@ to macro tracing. @comment examples @comment options: -dip @example -$ @kbd{m4 -dip -I examples} +$ @kbd{m4 -dip -I doc/examples} @error{}m4debug: input read from 'stdin' define(`foo', `m4wrap(`wrapped text ')dnl') @result{} include(`incl.m4')dnl -@error{}m4debug: path search for 'incl.m4' found 'examples/incl.m4' -@error{}m4debug: input read from 'examples/incl.m4' +@error{}m4debug: path search for 'incl.m4' found 'doc/examples/incl.m4' +@error{}m4debug: input read from 'doc/examples/incl.m4' @result{}Include file start @result{}Include file end @error{}m4debug: input reverted to stdin, line 3 @@ -5922,12 +5922,12 @@ However, earlier versions had reverse ordering (LIFO---last in, first out), as this behavior is more like the semantics of the C function @code{atexit}. It is possible to emulate POSIX behavior even with older versions of GNU M4 by including the file -@file{m4-@value{VERSION}/@/examples/@/wrapfifo.m4} from the +@file{m4-@value{VERSION}/@/doc/examples/@/wrapfifo.m4} from the distribution: @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} undivert(`wrapfifo.m4')dnl @result{}dnl Redefine m4wrap to have FIFO semantics. @result{}define(`_m4wrap_level', `0')dnl @@ -5950,14 +5950,14 @@ m4wrap(`a`'m4wrap(`c It is likewise possible to emulate LIFO behavior without resorting to the GNU M4 extension of @code{builtin}, by including the file -@file{m4-@value{VERSION}/@/examples/@/wraplifo.m4} from the +@file{m4-@value{VERSION}/@/doc/examples/@/wraplifo.m4} from the distribution. (Unfortunately, both examples shown here share some subtle bugs. See if you can find and correct them; or @pxref{Improved m4wrap, , Answers}). @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} undivert(`wraplifo.m4')dnl @result{}dnl Redefine m4wrap to have LIFO semantics. @result{}define(`_m4wrap_level', `0')dnl @@ -6086,14 +6086,14 @@ sinclude() This section uses the @option{--include} command-line option (or @option{-I}, @pxref{Preprocessor features, , Invoking m4}) to grab -files from the @file{m4-@value{VERSION}/@/examples} +files from the @file{m4-@value{VERSION}/@/doc/examples} directory shipped as part of the GNU @code{m4} package. The -file @file{m4-@value{VERSION}/@/examples/@/incl.m4} in the distribution +file @file{m4-@value{VERSION}/@/doc/examples/@/incl.m4} in the distribution contains the lines: @comment ignore @example -$ @kbd{cat examples/incl.m4} +$ @kbd{cat doc/examples/incl.m4} @result{}Include file start @result{}foo @result{}Include file end @@ -6105,7 +6105,7 @@ into the input stream. The contents of the file will be read by @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} define(`foo', `FOO') @result{} include(`incl.m4') @@ -6122,7 +6122,7 @@ of @file{incl.m4}: @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} define(`bar', include(`incl.m4')) @result{} This is `bar': >>bar<< @@ -7371,11 +7371,11 @@ word to upper case and the remaining characters to lower case. @end deffn First, an example of their usage, using implementations distributed in -@file{m4-@value{VERSION}/@/examples/@/capitalize.m4}. +@file{m4-@value{VERSION}/@/doc/examples/@/capitalize.m4}. @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`capitalize.m4') @result{} upcase(`GNUs not Unix') @@ -7395,7 +7395,7 @@ them; or @pxref{Improved capitalize, , Answers}). @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} undivert(`capitalize.m4')dnl @result{}divert(`-1') @result{}# upcase(text) @@ -7502,7 +7502,7 @@ example shows how @code{format} can be used to produce tabular output. @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`forloop.m4') @result{} forloop(`i', `1', `10', `format(`%6d squared is %10d @@ -8605,14 +8605,14 @@ This example reuses the file @file{incl.m4} mentioned earlier @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} define(`foo', ``$0' called at __file__:__line__') @result{} foo @result{}foo called at stdin:2 include(`incl.m4') @result{}Include file start -@result{}foo called at examples/incl.m4:2 +@result{}foo called at doc/examples/incl.m4:2 @result{}Include file end @result{} @end example @@ -8811,9 +8811,9 @@ mentioned earlier (@pxref{Include}): @comment examples @comment options: -s @example -$ @kbd{m4 --synclines -I examples} +$ @kbd{m4 --synclines -I doc/examples} include(`incl.m4') -@result{}#line 1 "examples/incl.m4" +@result{}#line 1 "doc/examples/incl.m4" @result{}Include file start @result{}foo @result{}Include file end @@ -9503,14 +9503,14 @@ The @code{forloop} macro (@pxref{Forloop}) as presented earlier can go into an infinite loop if given an iterator that is not parsed as a macro name. It does not do any sanity checking on its numeric bounds, and only permits decimal numbers for bounds. Here is an improved version, -shipped as @file{m4-@value{VERSION}/@/examples/@/forloop2.m4}; this +shipped as @file{m4-@value{VERSION}/@/doc/examples/@/forloop2.m4}; this version also optimizes overhead by calling four macros instead of six per iteration (excluding those in @var{text}), by not dereferencing the @var{iterator} in the helper @code{@w{_forloop}}. @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} undivert(`forloop2.m4')dnl @result{}divert(`-1') @result{}# forloop(var, from, to, stmt) - improved version: @@ -9551,7 +9551,7 @@ to an infinite recursion loop in this example. @comment status: 1 @comment examples @example -$ @kbd{m4 -d -L 9 -I examples} +$ @kbd{m4 -d -L 9 -I doc/examples} define(`arg1', `$1')include(`forloop2.m4')include(`quote.m4') @result{} define(`double', `define(`$1'`2', @@ -9586,7 +9586,7 @@ to pass the current iterator value as a single argument. Coupled with with helper macros if the argument is needed in more than one place in the expansion, the output can be generated with three, rather than four, macros of overhead per iteration. Notice how the file -@file{m4-@value{VERSION}/@/examples/@/forloop3.m4} rearranges the +@file{m4-@value{VERSION}/@/doc/examples/@/forloop3.m4} rearranges the arguments of the helper @code{_forloop} to take two arguments that are placed around the current value. By splitting a balanced set of parantheses across multiple arguments, the helper macro can now be @@ -9594,7 +9594,7 @@ shared by @code{forloop} and the new @code{forloop_arg}. @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`forloop3.m4') @result{} undivert(`forloop3.m4')dnl @@ -9645,7 +9645,7 @@ quadratic behavior of @code{foreachq}: @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`foreachq.m4') @result{} traceon(`shift')debugmode(`aq') @@ -9683,11 +9683,11 @@ recursion use fewer arguments, rather than adding additional quoted uses of @code{shift}. By doing so, @code{m4} uses less memory, invokes fewer macros, is less likely to run into machine limits, and most importantly, performs faster. The fixed version of @code{foreachq} can -be found in @file{m4-@value{VERSION}/@/examples/@/foreachq2.m4}: +be found in @file{m4-@value{VERSION}/@/doc/examples/@/foreachq2.m4}: @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`foreachq2.m4') @result{} undivert(`foreachq2.m4')dnl @@ -9735,11 +9735,11 @@ place, and by using the fixed-length @samp{$#} instead of an arbitrary length list as the key to end recursion. The result is an overhead of six macro invocations per loop (excluding any macros in @var{text}), instead of eight. This alternative approach is available as -@file{m4-@value{VERSION}/@/examples/@/foreach3.m4}: +@file{m4-@value{VERSION}/@/doc/examples/@/foreach3.m4}: @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`foreachq3.m4') @result{} undivert(`foreachq3.m4')dnl @@ -9831,7 +9831,7 @@ not yet supported. @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`foreachq4.m4') @result{} undivert(`foreachq4.m4')dnl @@ -9859,15 +9859,15 @@ foreachq(`x', ``1', `2', `3', `4'', `x @end example For yet another approach, the improved version of @code{foreach}, -available in @file{m4-@value{VERSION}/@/examples/@/foreach2.m4}, simply -overquotes the arguments to @code{@w{_foreach}} to begin with, using -@code{dquote_elt}. Then @code{@w{_foreach}} can just use +available in @file{m4-@value{VERSION}/@/doc/examples/@/foreach2.m4}, +simply overquotes the arguments to @code{@w{_foreach}} to begin with, +using @code{dquote_elt}. Then @code{@w{_foreach}} can just use @code{@w{_arg1}} to remove the extra layer of quoting that was added up front: @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`foreach2.m4') @result{} undivert(`foreach2.m4')dnl @@ -9921,7 +9921,7 @@ one, although a leading space still remains. @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`quote.m4')include(`foreachq2.m4') @result{} pushdef(`sep', `define(`sep', ``, '')') @@ -9954,7 +9954,7 @@ detrimental effects. @comment examples @example -$ @kbd{m4 -d -I examples} +$ @kbd{m4 -d -I doc/examples} include(`foreach2.m4') @result{} include(`foreachq2.m4') @@ -10074,11 +10074,11 @@ the other approach would give the same output, it does so at the expense of increasing the argument size on each iteration of @code{_stack_reverse_sep}, which results in quadratic instead of linear execution time. The improved stack walking macros are available in -@file{m4-@value{VERSION}/@/examples/@/stack_sep.m4}: +@file{m4-@value{VERSION}/@/doc/examples/@/stack_sep.m4}: @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`stack_sep.m4') @result{} define(`copy', `ifdef(`$2', `errprint(`$2 already defined @@ -10130,7 +10130,7 @@ builtin preserves them for their intended use. @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`wraplifo.m4') @result{} m4wrap(`define(`foo', ``$0:'-$1-$*-$#-')foo(`a', `b') @@ -10157,13 +10157,13 @@ Finally, it is worth emulating the GNU M4 extension of saving all arguments to @code{m4wrap}, separated by a space, rather than saving just the first argument. This is done with the @code{join} macro documented previously (@pxref{Shift}). The improved LIFO example is -shipped as @file{m4-@value{VERSION}/@/examples/@/wraplifo2.m4}, and can -easily be converted to a FIFO solution by swapping the adjacent +shipped as @file{m4-@value{VERSION}/@/doc/examples/@/wraplifo2.m4}, and +can easily be converted to a FIFO solution by swapping the adjacent invocations of @code{joinall} and @code{defn}. @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`wraplifo2.m4') @result{} undivert(`wraplifo2.m4')dnl @@ -10235,7 +10235,7 @@ double-quoted string: @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`capitalize.m4')dnl define(`active', `act1, ive')dnl define(`Active', `Act2, Ive')dnl @@ -10296,11 +10296,11 @@ string. In turn, that means the replacement text has unbalanced quotes, necessitating another round of @code{changequote}. In the fixed version below, (also shipped as -@file{m4-@value{VERSION}/@/examples/@/capitalize.m4}), @code{capitalize} -uses the alternate quotes of @samp{<<[} and @samp{]>>} (the longer -strings are chosen so as to be less likely to appear in the text being -converted). The helpers @code{_to_alt} and @code{_from_alt} merely -reduce the number of characters required to perform a +@file{m4-@value{VERSION}/@/doc/examples/@/capitalize.m4}), +@code{capitalize} uses the alternate quotes of @samp{<<[} and @samp{]>>} +(the longer strings are chosen so as to be less likely to appear in the +text being converted). The helpers @code{_to_alt} and @code{_from_alt} +merely reduce the number of characters required to perform a @code{changequote}, since the definition changes twice. The outermost pair means that @code{patsubst} and @code{_capitalize_alt} are invoked with alternate quoting; the innermost pair is used so that the third @@ -10312,7 +10312,7 @@ scheme in effect. @comment examples @example -$ @kbd{m4 -I examples} +$ @kbd{m4 -I doc/examples} include(`capitalize2.m4')dnl define(`active', `act1, ive')dnl define(`Active', `Act2, Ive')dnl @@ -10398,7 +10398,7 @@ restrictions, covered later (@pxref{Copying This Manual}). This appendix covers the license for copying this manual. Note that some of the longer examples in this manual are also distributed in the -directory @file{m4-@value{VERSION}/@/examples/}, where a more +directory @file{m4-@value{VERSION}/@/doc/examples/}, where a more permissive license is in effect when copying just the examples. @menu diff --git a/examples/COPYING b/examples/COPYING deleted file mode 100644 index 0b2d09ee..00000000 --- a/examples/COPYING +++ /dev/null @@ -1,8 +0,0 @@ -The files in this directory provide example uses of GNU M4. -The following copyright notice applies to each of these -description files. - -Copyright (C) 2006, 2010, 2013 Free Software Foundation, Inc. -This file is free software; the Free Software Foundation -gives unlimited permission to copy and/or distribute it, -with or without modifications, as long as this notice is preserved. diff --git a/examples/WWW/COPYING b/examples/WWW/COPYING deleted file mode 100644 index 0b2d09ee..00000000 --- a/examples/WWW/COPYING +++ /dev/null @@ -1,8 +0,0 @@ -The files in this directory provide example uses of GNU M4. -The following copyright notice applies to each of these -description files. - -Copyright (C) 2006, 2010, 2013 Free Software Foundation, Inc. -This file is free software; the Free Software Foundation -gives unlimited permission to copy and/or distribute it, -with or without modifications, as long as this notice is preserved. diff --git a/examples/WWW/Makefile b/examples/WWW/Makefile deleted file mode 100644 index c296ccf4..00000000 --- a/examples/WWW/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -M4 = ./m4/src/m4 -M4OPTS = -Im4lib - -VPATH = .:m4lib - -HTM = _footer.htm _header.htm bugs.htm changelog.htm download.htm \ - features.htm feedback.htm index.htm lists.htm modules.htm \ - news.htm readme.htm thanks.htm thissite.htm todo.htm uses.htm \ - visions.htm whatis.htm - -M4LIB = m4lib/bugs.m4 m4lib/changelog.m4 m4lib/download.m4 \ - m4lib/features.m4 m4lib/feedback.m4 m4lib/html.m4 \ - m4lib/index.m4 m4lib/layout.m4 m4lib/lists.m4 m4lib/menu.m4 \ - m4lib/modules.m4 m4lib/news.m4 m4lib/readme.m4 \ - m4lib/setup.m4 m4lib/test.m4 m4lib/thanks.m4 \ - m4lib/thissite.m4 m4lib/tmpl.m4 m4lib/todo.m4 m4lib/uses.m4 \ - m4lib/visions.m4 m4lib/whatis.m4 - -all: ./m4 $(HTM) - -./m4: - ln -s ../.. m4 - -%.htm: %.m4 - @$(M4) $(M4OPTS) $< >new.htm && \ - if cmp new.htm $@ >/dev/null 2>&1; then \ - rm new.htm; \ - echo "$@ has not changed"; \ - else \ - echo "$@ updated"; \ - mv new.htm $@; \ - fi - -.FORCE: -$(HTM): .FORCE $(M4LIB) - -changelog.htm: m4/ChangeLog -readme.htm: m4/README -todo.htm: m4/TODO -news.htm: m4/NEWS -modules.htm: m4/modules/README - -.PHONY: man -man: - cd man; $(MAKE) diff --git a/examples/WWW/_footer.htm b/examples/WWW/_footer.htm deleted file mode 100644 index 6bed8f2c..00000000 --- a/examples/WWW/_footer.htm +++ /dev/null @@ -1,10 +0,0 @@ -
- - - - - diff --git a/examples/WWW/_header.htm b/examples/WWW/_header.htm deleted file mode 100644 index 1aea7999..00000000 --- a/examples/WWW/_header.htm +++ /dev/null @@ -1,231 +0,0 @@ - - - -GNU m4 - Development site - - - - - - - - - - - -
- -

GNU m4

- -

Discussion Forum

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

-General info -

- -
-

- -What is m4
-Features
-Uses of m4
- -

- -
- -
-

-Documentation -

- -
-

- -Manual - -

- -
- -
-

-Source files -

- -
-

- -README
-TODO
-NEWS
-ChangeLog
-Contributors
-Browse it
- -

- -
- -
-

-The Future -

- -
-

- -Modules
-Visions
- -

- -
- -
-

-Feedback -

- -
-

- -Mailing-lists
-Feedback
- -

- -
- -
-

-Development -

- -
-

- -Download
-Known bugs
- -

- -
- -
-

-Examples -

- -
-

- -This site - -

- -
- - - - - - - - -
diff --git a/examples/WWW/m4lib/COPYING b/examples/WWW/m4lib/COPYING deleted file mode 100644 index 0b2d09ee..00000000 --- a/examples/WWW/m4lib/COPYING +++ /dev/null @@ -1,8 +0,0 @@ -The files in this directory provide example uses of GNU M4. -The following copyright notice applies to each of these -description files. - -Copyright (C) 2006, 2010, 2013 Free Software Foundation, Inc. -This file is free software; the Free Software Foundation -gives unlimited permission to copy and/or distribute it, -with or without modifications, as long as this notice is preserved. diff --git a/examples/WWW/m4lib/bugs.m4 b/examples/WWW/m4lib/bugs.m4 deleted file mode 100644 index 5d8e5f52..00000000 --- a/examples/WWW/m4lib/bugs.m4 +++ /dev/null @@ -1,53 +0,0 @@ -include(`setup.m4') - -\set_author([René Seindal]) -\set_title([Known bugs in GNU m4 \__m4_version__]) - -\divert(1) -\h2([Known bugs in GNU m4]) - -\define([fixed], [\p([Fixed in version 1.4$1])]) - -\define([notme], [\p([A volunteer is badly needed for this, as I have no way of testing -this myself.])]) - -\ul([ - -\item([undivert], [undivert(0) might read from standard output], - -[\p([If calling \tt(undivert(0)) when diverting to a non-zero diversion -will cause m4 to read from standard output in an attempt to bring back -diversion 0, which is not possible.]) - -\fixed(n) - -]) - -\item([sigaltstack], [failure if sigaltstack or sigstack returns ENOSYS], - -[\p([If stack overflow detection is configured but the system doesn't -support sigaltstack(2) or sigstack(2), m4 fails when the system call -returns ENOSYS. It should silently revert to default behaviour.]) - -\notme -]) - -]) - -\p([See also the \link(todo.htm, TODO) file.]) - -\print_items - -\divert(0)\dnl -\DO_LAYOUT([\undivert(1)]) -\divert(-1) - - -\item([], [], - -[\p([]) - -]) -\undivert diff --git a/examples/WWW/m4lib/changelog.m4 b/examples/WWW/m4lib/changelog.m4 deleted file mode 100644 index cdcab269..00000000 --- a/examples/WWW/m4lib/changelog.m4 +++ /dev/null @@ -1,18 +0,0 @@ -include(`setup.m4') - -\set_author([René Seindal]) -\set_title([ChangeLog]) - -\divert(1) - -
\dnl
-\changesyntax([A<>])\dnl
-\changequote(,)\dnl
-\include(m4/ChangeLog)
-\changequote([,])\dnl
-\changesyntax([O<>])\dnl
-
- -\divert(0)\dnl -\DO_LAYOUT([\undivert(1)]) -\divert(-1) diff --git a/examples/WWW/m4lib/download.m4 b/examples/WWW/m4lib/download.m4 deleted file mode 100644 index d9ee4095..00000000 --- a/examples/WWW/m4lib/download.m4 +++ /dev/null @@ -1,24 +0,0 @@ -include(`setup.m4') - -\set_author([René Seindal]) -\set_title([Download]) - -\divert(1) - -\p([In the download area there are usually several version -present. Please take only the latest.]) - -\p([The files are name \tt(m4-1.4\i(X).tar.gz) where X is a letter.]) - -\p([\link([ftp://ftp.seindal.dk/pub/rene/gnu/], [Download latest -development version]).]) - -\p([\link([ftp://ftp.seindal.dk/pub/rene/gnu/m4-1.4.tar.gz],[Download -latest stable version]).]) - -\p([\link([ftp://ftp.seindal.dk/pub/rene/gnu/djgpp/],[Download -DOS/Windows port of latest stable version]).]) - -\divert(0)\dnl -\DO_LAYOUT([\undivert(1)]) -\divert(-1) diff --git a/examples/WWW/m4lib/features.m4 b/examples/WWW/m4lib/features.m4 deleted file mode 100644 index 57b68c9e..00000000 --- a/examples/WWW/m4lib/features.m4 +++ /dev/null @@ -1,58 +0,0 @@ -include(`setup.m4') - -\set_author([René Seindal]) -\set_title([New feaures since version 1.4]) - -\divert(1) - -\p(Please look at the \link(news.htm, NEWS) and the \link(changelog.htm, -ChangeLog) for all the gory details.) - -\dl( -\dt(\b(GNU m4 uses GNU Automake and GNU Autoconf for configuration.)) - -\dd(\p(This has been long overdue, and now hit is done thanks to Erick -Branderhorst.)) - -\dt(\b(GNU m4 uses GNU gettext for internationalisation.)) - -\dd(\p(GNU m4 now speaks several languages. Translations for -german, french, italian, japanese, dutch, polish, romenian and swedish -have been made.)) - -\dt(\b(Support for multiple precision arithmetic in eval.)) - -\dd(\p(If appropriately configured, GNU m4 can now do multiple precision -arithmetic in the built in macro 'eval'. If not configured, GNU m4 -will use the largest integer available for its calculations.)) - -\dt(\b(An input syntax table to change how input is parsed.)) - -\dd(\p(A new build in macro 'changesyntax' allows finer control over how input -characters are parsed into input tokens.  It is now possible to have -several one character quote strings or comment delimiters, to change the -format of macro calls, to use active characters like in TeX, and probably -most useful, to change what input characters are treated as letters when -looking for macro calls.) - -\p(See the \link(man/m4_7.html#SEC41, manual section) for more details.)) - -\dt(\b(Support for loadable modules.)) - -\dd(\p(GNU m4 now has support for dynamic loading of compiled modules at -runtime. A module can define any number of new built in macros, which -will be indistinguishable from the standard set of built in -macros. Modules can also override existing built in macros.) -) - -\dt(\b(Better control of sync-lines generation.)) - -\dd(\p(The new built in macro 'syncoutput' allows better control of the -generation of sync-lines. They can now be turned on or off at -will.)) - -) - -\divert(0)\dnl -\DO_LAYOUT([\undivert(1)]) -\divert(-1) diff --git a/examples/WWW/m4lib/feedback.m4 b/examples/WWW/m4lib/feedback.m4 deleted file mode 100644 index f61d63e5..00000000 --- a/examples/WWW/m4lib/feedback.m4 +++ /dev/null @@ -1,20 +0,0 @@ -include(`setup.m4') - -\set_author([René Seindal]) -\set_title([Feedback]) - -\divert(1) - -\p(Bug reports should be sent to \link(mailto:bug-m4@gnu.org, -bug-m4@gnu.org).) - -\p(Generel discussion about GNU m4 should take place on -\link(mailto:m4-forum@seindal.dk, m4-forum).) - -\p(Informal comments about this site and GNU m4 can be sent to -\link(mailto:m4-feedback@seindal.dk, m4-feedback).) - - -\divert(0)\dnl -\DO_LAYOUT([\undivert(1)]) -\divert(-1) diff --git a/examples/WWW/m4lib/html.m4 b/examples/WWW/m4lib/html.m4 deleted file mode 100644 index 94ed69ed..00000000 --- a/examples/WWW/m4lib/html.m4 +++ /dev/null @@ -1,122 +0,0 @@ -\define([n], [ -]) - -\define([concat], [\ifelse($#, 0, , - $#, 1, [$1], - [$1 \concat(\shift($@))])]) - -\define([toupper], [\translit([$*], [a-z], [A-Z])]) - -\define([container], -[\pushdef([_tag], \toupper([$1]))\dnl -\ifelse($#, 1, [<\_tag>], - $#, 2, [<\_tag>$2], - $#, 3, [<\_tag $2>$3], - [<\_tag $2>\concat(\shift(\shift($@)))])\dnl -\popdef([_tag])\dnl -]) - -\define([large_container], -[\pushdef([_tag], \toupper([$1]))\dnl -\ifelse($#, 1, [<\_tag>\n], - $#, 2, [<\_tag>\n[]$2\n\n], - $#, 3, [<\_tag $2>\n[]$3\n\n], - [<\_tag $2>\n\concat(\shift(\shift($@)))\n\n])\dnl -\popdef([_tag])\dnl -]) - -\define([large_simple_container], -[\pushdef([_tag], \toupper([$1]))\dnl -<\_tag>\n\concat(\shift($@))\n\n\dnl -\popdef([_tag])\dnl -]) - -\define([simple_container], -[\pushdef([_tag], \toupper([$1]))\dnl -<\_tag>\concat(\shift($@))\dnl -\popdef([_tag])\dnl -]) - -\define([simple_tag], -[\pushdef([_tag], \toupper([$1]))\dnl -\ifelse([$2], [], [<\_tag>], [<\_tag $2>])\dnl -\popdef([_tag])\dnl -]) - -\define([doctype], [\simple_tag([!DOCTYPE], $@)]) - -\define([html], [\large_simple_container([$0], $@)]) -\define([head], [\large_simple_container([$0], $@)]) -\define([title], [\simple_container([$0], $@)]) - -\define([meta], [\n]) -\define([http_equiv], [\n]) - -\define([body], [\large_container([$0], $@)]) - -\define([center], [\large_simple_container([$0], $@)]) -\define([right], [\large_simple_container([$0], $@)]) -\define([left], [\large_simple_container([$0], $@)]) -\define([div], [\large_container([$0], $@)]) - -\define([b], [\simple_container([$0], $@)]) -\define([i], [\simple_container([$0], $@)]) -\define([tt], [\simple_container([$0], $@)]) - -\define([table], [\large_container([$0], $@)]) -\define([tr], [\large_container([$0], $@)]) -\define([td], [\large_container([$0], $@)]) -\define([th], [\large_container([$0], $@)]) - -\define([link], [\shift($*)]) -\define([target], [\shift($*)]) - -\define([font], [\n\container([$0], $@)\n]) - -\define([h1], [\n\container([$0], $@)\n]) -\define([h2], [\n\container([$0], $@)\n]) -\define([h3], [\n\container([$0], $@)\n]) -\define([h4], [\n\container([$0], $@)\n]) -\define([h5], [\n\container([$0], $@)\n]) -\define([h6], [\n\container([$0], $@)\n]) - -\define([p], [\large_simple_container([$0], $@)]) - -\define([hr], [\simple_tag([$0], $@)]) - -\define([ul], [\large_container([$0], $@)]) -\define([ol], [\large_container([$0], $@)]) - -\define([li], [\simple_tag([$0], $@)]) - -\define([blockquote], [\large_simple_container([$0], $@)]) - -\define([dl], [\large_simple_container([$0], $@)]) -\define([dt], [\simple_container([$0], $@)]) -\define([dd], [\large_simple_container([$0], $@)]) - -\define([br], [\simple_tag([$0], $@)]) -\define([hline], [\simple_tag([$0], $@)]) - -\define([pre], [\simple_container([$0], $@)]) - - - -\define([set_title], [\define([_TITLE], [$*])]) -\set_title(_TITLE) - -\define([set_author], [\define([_AUTHOR], [$*])]) -\set_author() - -\define([set_generator], [\define([_GENERATOR], [$*])]) -\set_generator([GNU m4 \__m4_version__]) - -\define([set_keywords], [\define([_KEYWORDS], [$*])]) -\set_keywords() - -\define([set_body], [\define([_BODY], [$*])]) -\set_body() - -\define([meta_if_set], - [\ifelse(\defn([_$1]), [], [], \meta([$1], \defn([_$1])))]\dnl -) diff --git a/examples/WWW/m4lib/index.m4 b/examples/WWW/m4lib/index.m4 deleted file mode 100644 index dbccc67b..00000000 --- a/examples/WWW/m4lib/index.m4 +++ /dev/null @@ -1,36 +0,0 @@ -include(`setup.m4') - -\set_author([René Seindal]) -\set_title([Development site]) - -\divert(1) -\h2([Current development version is \__m4_version__.]) - -\p([Development versions contain new features and experiments that might -or might not make it into the next official release. The current -development version contains among other things (browse the -\link([features.htm], [new features]) for more detail):]) - -\ul([ - \li Uses GNU Automake and GNU Autoconf for configuration. - - \li Uses GNU gettext for internationalisation. - - \li Support for multiple precision arithmetic in eval. - - \li An input syntax table to change how input is parsed. - - \li Support for loadable modules. - - \li Better control of sync-lines generation. - - \li Various bug-fixes. -]) - -\p([A new release is expected ready for Spring 2000.]) - -\p([GNU \tt(m4) 1.4 is from october 1994 and can be considered stable.]) - -\divert(0)\dnl -\DO_LAYOUT([\undivert(1)]) -\divert(-1) diff --git a/examples/WWW/m4lib/layout.m4 b/examples/WWW/m4lib/layout.m4 deleted file mode 100644 index e54002db..00000000 --- a/examples/WWW/m4lib/layout.m4 +++ /dev/null @@ -1,65 +0,0 @@ -\divert(-1); -The semicolons are just to get GNU Emacs C mode to indent properly. - -\define([C_TEXT], [text="#000000"]); -\define([C_LINK], [link="#0000EF"]); -\define([C_ALINK], [vlink="#51188E"]); -\define([C_VLINK], [alink="#FF0000"]); -\define([C_BG1], [bgcolor="#FFCC99"]); -\define([C_BG2], [bgcolor="#FF9900"]); -\define([C_BG3], [bgcolor="#CC6600"]); - -\define([DO_HEADER], - [\head([\title([GNU m4 - \defn([_TITLE])])], - [\meta_if_set([AUTHOR])], - [\meta_if_set([GENERATOR])], - [\meta_if_set([KEYWORDS])], - )]); - -\define([DO_BODY], - [\body([\C_TEXT \C_BG1 \C_LINK \C_VLINK \C_ALINK], - [\table([cellpadding=5 width="100%"], - [\tr([align=left valign=bottom], - [\td([align=center valign=middle colspan="3" width="100%" \C_BG2], - [\h1([GNU m4])], - [\h2(\defn([_TITLE]))], - )], - )], - [\tr([], - [\td([align=left valign=top width="15%" \C_BG2], - [\include([menu.m4])], - )], - [\td([align=left valign=top width="90%"], - [$*], - )], - )], - )], - )] - ); - -\define([DO_LAYOUT], - [\doctype([html public "-//w3c//dtd html 4.0 transitional//en"]) -\html([\DO_HEADER], [\DO_BODY([$*])])] - ); - -\define([<], [<]); -\define([>], [>]); - -\define([showlink], [\link($1, $1)]); -\define([mailto], [\link(mailto:$1, $1)]); - - - - -\define([print_items], [\undivert(2)]) - -\define([item], [\li \link([[#]$1], [$2.]) -\pushdef([_div], \divnum)\dnl -\divert(2)\dnl -\hr([align=center width="50%"])\dnl -\h2([\target([$1], [$2])])\dnl -$3\dnl -\divert(\_div)\dnl -\popdef([_div])\dnl -]) diff --git a/examples/WWW/m4lib/lists.m4 b/examples/WWW/m4lib/lists.m4 deleted file mode 100644 index cc710eba..00000000 --- a/examples/WWW/m4lib/lists.m4 +++ /dev/null @@ -1,32 +0,0 @@ -include(`setup.m4') - -\set_author([René Seindal]) -\set_title([Mailing lists]) - -\define([me], \link([mailto:rene@seindal.dk], [rene@seindal.dk])) - -\divert(1) - -\h3(There are two mailing lists for GNU m4) - -\dl( - -\dt(\b(\link(mailto:m4-forum@seindal.dk, m4-forum@seindal.dk))) - -\dd(\p(This list is intended for discussions between people interested -and/or participating in the further development of m4.)) - -\dt(\b(m4-announce@seindal.dk)) - -\dd(\p(Announcements regarding GNU m4 will posted here.) -\p(The volume will certainly be very low.)) - -) - -\p(Currently these lists are maintained manually. Send a message to \me -saying whether you want to subscribe or unsubscribe to any of these -lists.) - -\divert(0)\dnl -\DO_LAYOUT([\undivert(1)]) -\divert(-1) diff --git a/examples/WWW/m4lib/menu.m4 b/examples/WWW/m4lib/menu.m4 deleted file mode 100644 index 78c8edfd..00000000 --- a/examples/WWW/m4lib/menu.m4 +++ /dev/null @@ -1,74 +0,0 @@ -\pushdef([header], [\tr([\td([\C_BG3], [\p([\b([$1])])])])]) - -\pushdef([separator], [\tr([\td([height=5], [])])]) - -\pushdef([_row], [\link([$1], [$2])]) - -\pushdef([_rows], - [\ifelse($#, 0, [], - $#, 1, [], - $#, 2, [\_row([$1], [$2])], - $#, 3, [\_row([$1], [$2])], - [\_row([$1], [$2])\br\n\_rows(\shift(\shift($@)))])]) - -\pushdef([rows], [\tr([\td([\p([\font([size=-1], [\b([\_rows($@)])])])])])]) - -\table([], - [\header([General info])], - [\rows( - [whatis.htm], [What is m4], - [features.htm], [Features], - [uses.htm], [Uses of m4], - )], - [\separator], - - [\header([Documentation])], - [\rows( - [man/m4_toc.html], [Manual], - )], - [\separator], - - [\header([Source files])], - [\rows( - [readme.htm], [README], - [todo.htm], [TODO], - [news.htm], [NEWS], - [changelog.htm], [ChangeLog], - [thanks.htm], [Contributors], - [m4/], [Browse it], - )], - [\separator], - - [\header([The Future])], - [\rows( - [modules.htm], [Modules], - [visions.htm], [Visions], - )], - [\separator], - - [\header([Feedback])], - [\rows( - [lists.htm], [Mailing-lists], - [feedback.htm], [Feedback], - [/forum/list.php3?num=2], [Discussion Forum], - )], - [\separator], - - [\header([Development])], - [\rows( - [download.htm], [Download], - [bugs.htm], [Known bugs], - )], - [\separator], - - [\header([Examples])], - [\rows( - [thissite.htm], [This site], - )], -) - -\popdef([header]) -\popdef([rows]) -\popdef([_rows]) -\popdef([_row]) -\popdef([separator]) diff --git a/examples/WWW/m4lib/modules.m4 b/examples/WWW/m4lib/modules.m4 deleted file mode 100644 index b9c148f1..00000000 --- a/examples/WWW/m4lib/modules.m4 +++ /dev/null @@ -1,18 +0,0 @@ -include(`setup.m4') - -\set_author([René Seindal]) -\set_title([Modules]) - -\divert(1) - -
\dnl
-\changesyntax([A<>])\dnl
-\changequote(,)\dnl
-\include(m4/modules/README)
-\changequote([,])\dnl
-\changesyntax([O<>])\dnl
-
- -\divert(0)\dnl -\DO_LAYOUT([\undivert(1)]) -\divert(-1) diff --git a/examples/WWW/m4lib/news.m4 b/examples/WWW/m4lib/news.m4 deleted file mode 100644 index e5da0d89..00000000 --- a/examples/WWW/m4lib/news.m4 +++ /dev/null @@ -1,18 +0,0 @@ -include(`setup.m4') - -\set_author([René Seindal]) -\set_title([NEWS - History of user-visible changes]) - -\divert(1) - -
\dnl
-\changesyntax([A<>])\dnl
-\changequote(,)\dnl
-\include(m4/NEWS)
-\changequote([,])\dnl
-\changesyntax([O<>])\dnl
-
- -\divert(0)\dnl -\DO_LAYOUT([\undivert(1)]) -\divert(-1) diff --git a/examples/WWW/m4lib/readme.m4 b/examples/WWW/m4lib/readme.m4 deleted file mode 100644 index 1612c7d1..00000000 --- a/examples/WWW/m4lib/readme.m4 +++ /dev/null @@ -1,18 +0,0 @@ -include(`setup.m4') - -\set_author([René Seindal]) -\set_title([README]) - -\divert(1) - -
\dnl
-\changesyntax([A<>])\dnl
-\changequote(,)\dnl
-\include(m4/README)
-\changequote([,])\dnl
-\changesyntax([O<>])\dnl
-
- -\divert(0)\dnl -\DO_LAYOUT([\undivert(1)]) -\divert(-1) diff --git a/examples/WWW/m4lib/setup.m4 b/examples/WWW/m4lib/setup.m4 deleted file mode 100644 index 310b65f8..00000000 --- a/examples/WWW/m4lib/setup.m4 +++ /dev/null @@ -1,7 +0,0 @@ -divert(-1) -changequote([,]) -changecom([]) -changesyntax([@\]) - -\include([html.m4]) -\include([layout.m4]) diff --git a/examples/WWW/m4lib/test.m4 b/examples/WWW/m4lib/test.m4 deleted file mode 100644 index 110cf12b..00000000 --- a/examples/WWW/m4lib/test.m4 +++ /dev/null @@ -1,29 +0,0 @@ -include(`setup.m4') - -\divert(1) - -\define([_ideas], []) - -\define([register_idea], -[\define([H_$1], [$2])\dnl -\define([T_$1], [$3])\dnl -\define([_ideas], [\print_idea([$1])]\defn([_ideas]))]) - -\define([print_idea], [ -\target([$1], [\h2([\indir([H_$1])])]) -\indir([T_$1]) -]) - -\define([print_ideas], [\indir([_ideas])]) - -\define([idea], [\li \p([\link([[#]$1], [$2.])])\register_idea([$1], [$2], [$3])]) - -\idea([guile], [Guile as an extension language], [gfhjdsfsarhgew]) -\idea([pquote], [Persistent quotes],[asdffhfdghgdsfh]) -\idea([deps], [Dependencies generation],[afsdffasdf]) - -\print_ideas - -\undivert(1) - -\defn([_ideas]) diff --git a/examples/WWW/m4lib/thanks.m4 b/examples/WWW/m4lib/thanks.m4 deleted file mode 100644 index 61928d07..00000000 --- a/examples/WWW/m4lib/thanks.m4 +++ /dev/null @@ -1,18 +0,0 @@ -include(`setup.m4') - -\set_author([René Seindal]) -\set_title([People who have contributed to m4]) - -\divert(1) - -
\dnl
-\changesyntax([A<>])\dnl
-\changequote(,)\dnl
-\include(m4/THANKS)
-\changequote([,])\dnl
-\changesyntax([O<>])\dnl
-
- -\divert(0)\dnl -\DO_LAYOUT([\undivert(1)]) -\divert(-1) diff --git a/examples/WWW/m4lib/thissite.m4 b/examples/WWW/m4lib/thissite.m4 deleted file mode 100644 index eecfa9cf..00000000 --- a/examples/WWW/m4lib/thissite.m4 +++ /dev/null @@ -1,42 +0,0 @@ -include(`setup.m4') - -\set_author([René Seindal]) -\set_title([This site]) - -\divert(1) - -\p([This GNU m4 site is maintained by René Seindal, -(\mailto(rene@seindal.dk)).]) - -\p([All files are generated using GNU m4 \__m4_version__. You can view -the \link(m4lib/, source files). They are very simple. They use some -features from GNU m4 1.4l]) - -\p([The basic M4 definitions of quotes, comments, escapes are in -\showlink(m4lib/setup.m4). This is first included by all files to -configure the enviroment correctly for the other files. To avoid have -macros called by accident, an escape character is defined with -changesyntax. \i(This is a new feature in m4 1.4l).]) - -\p([Some fairly general macros to generate various HTML construct are -found in \showlink(m4lib/html.m4). There are macros for simple tags, -containers with and without attributes, links and a few utility macros.]) - -\p([The visual aspects of the pages are in \showlink(m4lib/layout.m4). -The macros herein generate the complete HTML structure for the pages. -There are macros for making the header and the body of the document.]) - -\p([The definition of the left hand menu is in \showlink(m4lib/menu.m4). -I convinced GNU Emacs to do the indentation by switching to c-mode.]) - -\p([The page body is passed to the layout definitions as an argument. As -the text can be large, it is first diverted and the text passed to the -layout macros is simply a call to undivert. That way a very large text -can be passed around with very little cost. This page is made with -\link(m4lib/thissite.m4, these definitions).]) - -\p([There is a single file for each HTML file.]) - -\divert(0)\dnl -\DO_LAYOUT([\undivert(1)]) -\divert(-1) diff --git a/examples/WWW/m4lib/tmpl.m4 b/examples/WWW/m4lib/tmpl.m4 deleted file mode 100644 index 8262d293..00000000 --- a/examples/WWW/m4lib/tmpl.m4 +++ /dev/null @@ -1,11 +0,0 @@ -include(`setup.m4') - -\set_author([René Seindal]) -\set_title([]) - -\divert(1) -\h2([]) - -\divert(0)\dnl -\DO_LAYOUT([\undivert(1)]) -\divert(-1) diff --git a/examples/WWW/m4lib/todo.m4 b/examples/WWW/m4lib/todo.m4 deleted file mode 100644 index 7a22c151..00000000 --- a/examples/WWW/m4lib/todo.m4 +++ /dev/null @@ -1,18 +0,0 @@ -include(`setup.m4') - -\set_author([René Seindal]) -\set_title([TODO - Things still to be done]) - -\divert(1) - -
\dnl
-\changesyntax([A<>])\dnl
-\changequote(,)\dnl
-\include(m4/TODO)
-\changequote([,])\dnl
-\changesyntax([O<>])\dnl
-
- -\divert(0)\dnl -\DO_LAYOUT([\undivert(1)]) -\divert(-1) diff --git a/examples/WWW/m4lib/uses.m4 b/examples/WWW/m4lib/uses.m4 deleted file mode 100644 index e29acb7a..00000000 --- a/examples/WWW/m4lib/uses.m4 +++ /dev/null @@ -1,43 +0,0 @@ -include(`setup.m4') - -\set_author([René Seindal]) -\set_title([Current uses of m4]) - -\divert(1) - -\p(The MTA sendmail uses \tt(m4) for generating configuration files.) - -\p(\link(http://www.gnu.org/software/autoconf/autoconf.html, GNU -Autoconf) uses \tt(m4) to generate "configure" scripts, that are used -for configuring \link(http://www.gnu.org/, GNU) software for a -particular platform.) - -\p(Htm4l is a set of macros for generating HTML. Html4 is written by -Terry Jones (terry@cliffs.ucsd.edu). See -\showlink(http://cliffs.ucsd.edu/terry/htm4l/htm4l/main.html) for -details. ) - -\p(Various programs uses m4 to preprocess configuration files, for -example the X11 window manager fvwm.) - -\p(There is an \link(http://www.ssc.com/lg/issue22/using_m4.html, -article in the Linux Gazette) about writing HTML with GNU m4 written by -\link(mailto:bhepple@bit.net.au, Bob Hepple) . More recent versions -are kept at \link(http://www.bit.net.au/~bhepple, Bob's home site). -The macros are used to maintain a large commercial site at -\showlink(http://www.finder.com.au).) - -\p(Other examples of GNU m4 generated HTML pages, written by -\link(mailto:max@alcyone.com, Erik Max Francis) can be found at the sites -\showlink(http://www.alcyone.com/max/), -\showlink(http://www.catcam.com/), -\showlink(http://www.crank.net/) and -\showlink(http://www.pollywannacracka.com/). -) - -\p(\link(thissite.htm, These files are created with GNU m4 \__m4_version__).) - - -\divert(0)\dnl -\DO_LAYOUT([\undivert(1)]) -\divert(-1) diff --git a/examples/WWW/m4lib/visions.m4 b/examples/WWW/m4lib/visions.m4 deleted file mode 100644 index ba238ca9..00000000 --- a/examples/WWW/m4lib/visions.m4 +++ /dev/null @@ -1,232 +0,0 @@ -include(`setup.m4') - -\set_author([René Seindal]) -\set_title([The Road Ahead]) - -\define([originator], -[\p([Idea contributed by [$1]]\ifelse($#, 2, [ (\mailto([$2]))])[.])]) - -\define([noone], [\p([There is no-one working on this now. Do you want -to volunteer?])]) - - -\define([done], [\p([Done in version 1.4$1])]) - - -\divert(1) -\h2([Ideas for future versions of GNU m4]) - -\p([Here are some ideas and suggestion for the future of GNU m4, large -and small. The order here is fairly random.]) - -\ul([ - -\item([guile], [Guile as an extension language], - -[\p([\link([http://www.red-bean.com/guile/], [Guile]) can be used as an -extension language so complicated macros can be written in Scheme while -still maintaining the m4 interface. It will require some changes to the -base code, as guile cannot be used from a module.]) - -\noone -]) - - -\item([utf8], [UTF-8 or wide characters], - -[\p([GNU m4 should be able to handle UTF-8 input or wide characters so -it can be more usable for different environments.]) - -\noone -]) - - -\item([pquote], [Syntax: persistent quotes], - -[\p([Persistent quotes is a way of getting text unharmed through m4's -processing. While normal quotes are stripped when a quoted string is -read, the persistent quotes are removed just before being output. This -will ensure that the quoted text is always output verbatim.]) - -\p([The bulk of the changes will be in the parser (in input.c function -next_token). Persistent quotes cannot be nested, they must balance -within a normally quoted string, but normal quotes need not balance -within persistent quotes (neither within persistent quotes within normal -quotes). The quotes should be removed before being shipped out (in -macro.c).]) - -\noone -]) - - - - -\item([comment2], [Syntax: removable comments], - -[\p([With the syntax table a category for discardable comments can be -defined, causing that type of comments to be discarded.]) - -\noone -]) - - - - -\item([comment1], [Option: remove comments], - -[\p([There should be an option (--discard-comments) to get m4 to discard -comments instead of passing them to the output.]) - -\done(n) -]) - - - -\item([deps], [Option: show dependencies], - -[\p([There should be an options to generate makefile dependencies for an -M4 input file.]) - -\p([It is not enough to scan the files for includes, as file names can -be generated and builtins renamed. To make it work, m4 will have to do -a complete run of the input file, discard the output and print the -dependencies instead.]) - -\p([It cannot be made to work in all cases when input file names are -generated on the fly.]) - -\noone -]) - - -\item([safer], [Option: render GNU m4 safer], - -[\p([There should be a --safer option that disables all functions, that -could compromise system security if used by root. It will have to -include various functions, such as file inclusion, sub shells, module -loading, ...]) - -\noone -]) - - - -\item([import], [Option: import environment], - -[\p([An option to defined each environment variable as a macro on -startup would be useful in many cases.]) - -\done(n) -]) - - - -\item([m4expand], [Builtin: quote expanded text], - -[\p([A builtin to quote expanded text would be useful. Now it is not -possible to quote the expansion of a macro; the macro itself has to -provide the quotes. Some builtins return quoted strings, others -don't.]) - -\p([A possible solution is a build in macro that takes one argument. It -expands this argument fully and returns the quoted expansion.]) - -\p([It will require changes to input handling and macro expansion code.]) - -\noone -]) - - - -\item([perl], [Module: embedded perl], - -[\p([Perl could be embedded in m4, giving users a powerful programming -language for writing macros. A single builtin "perleval" could do the -job. First argument could be a perl function and the rest arguments. -The return value of the function as a string would be the expansion.]) - -\p([The perl interpreter should be set up when the module is loaded and -closed down before m4 exits, using the appropriate hooks in the module -interface.]) - -\p([A perl module could potentially give users access to any facility -perl has access to, such as databases.]) - -\p([On systems with perl compiled as a shared library the size penalty -would be minimal.]) - -\p([(It might not be workable as a module, as it will need to link with non-shared libraries. Don't know how it can be fixed. (RS))]) - -\noone -]) - - - -\item([output], [Module: better output control], - -[\p([It has been suggested a couple of times that it should be possible -to divert to named files, in order to create several output files.]) - -\p([I think this a bit a misunderstanding. Diversion are inteded to be -brought back later, ie, they are temporary and recoverable. Output -text, on the other hand, once output it is lost (for m4). Therefore -better output control should be made in a different way.]) - -\p([My suggestion is a set of builtins defined by a module:]) - -\pre([setoutput(file) -appendoutput(file) -pipeoutput(command)]) - -\p([With these output can be directed better, diversion can be sent to -different files, and groups of files can be built by a single m4 run. -Calling \tt(setoutput) without arguments should resume output to -standard output.]) - -\p([(Admittedly, diversion 0 (standard output) has always been -different, as it cannot be undiverted.)]) - -\noone -]) - - - -\item([require], [Module: require/provide functionality], - -[\p([Two new builtins \tt(require) and \tt(provide) could provide a -handy interface to include. It has proven difficult to write these -robustly as normal macros. As an example, the files \tt(test.m4) and -\tt(../test.m4) could be the same file or different files depending on -the search path.]) - -\noone -]) - - -]) - - - -\p([See also the \link(todo.htm, TODO) file.]) - -\print_items - - - -\divert(0)\dnl -\DO_LAYOUT([\undivert(1)]) -\divert(-1) - -\divert(3)saljdfnaskdjfndsa\divert(-1) - - - - -\item([], [], - -[\p([]) - -\noone -]) - -\undivert diff --git a/examples/WWW/m4lib/whatis.m4 b/examples/WWW/m4lib/whatis.m4 deleted file mode 100644 index 2fa1c426..00000000 --- a/examples/WWW/m4lib/whatis.m4 +++ /dev/null @@ -1,48 +0,0 @@ -include(`setup.m4') - -\set_author([René Seindal]) -\set_title([What is GNU m4]) - -\divert(1) - -\p([GNU \tt(m4) is an implementation of the traditional Unix macro -processor. GNU m4 is mostly compatible with the System V, Release 3 -version, and SVR4, although it has some extensions (for example, -handling more than 9 positional parameters to macros). GNU \tt(m4) -also has built-in functions for including files, running shell -commands, doing arithmetic, etc.]) - -\p([GNU \tt(m4) is a macro processor, in the sense that it copies its -input to the output, expanding macros as it goes. Macros are either -builtin or user-defined, and can take any number of arguments. Besides -just doing macro expansion, m4 has builtin functions for including named -files, running UNIX commands, doing integer arithmetic, manipulating -text in various ways, recursion, etc... m4 can be used either as a -front-end to a compiler, or as a macro processor in its own right.]) - -\p([The m4 macro processor is widely available on all UNIXes. Usually, -only a small percentage of users are aware of its existence. However, -those who do often become commited users. The growing popularity of GNU -Autoconf, which prerequires GNU m4 for generating the `configure' -scripts, is an incentive for many to install it, while these people will -not themselves program in m4.]) - -\p([Some people found m4 to be fairly addictive. They first use m4 for -simple problems, then take bigger and bigger challenges, learning how to -write complex m4 sets of macros along the way. Once really addicted, -users pursue writing of sophisticated m4 applications even to solve -simple problems, devoting more time debugging their m4 scripts than -doing real work. Beware that m4 may be dangerous for the health of -compulsive programmers.]) - -\p([Autoconf needs GNU m4 for generating `configure' scripts, but not for -running them.]) - -\p([GNU m4 is a Unix program. It is designed to work in a Unix-like -environment. GNU m4 1.4 has, however, been ported to DJGPP, the GNU C -compiler for DOS/Windows. These files are present in the -\link(download.htm, download area).]) - -\divert(0)\dnl -\DO_LAYOUT([\undivert(1)]) -\divert(-1) diff --git a/examples/capitalize.m4 b/examples/capitalize.m4 deleted file mode 100644 index d4e4a502..00000000 --- a/examples/capitalize.m4 +++ /dev/null @@ -1,12 +0,0 @@ -divert(`-1') -# upcase(text) -# downcase(text) -# capitalize(text) -# change case of text, simple version -define(`upcase', `translit(`$*', `a-z', `A-Z')') -define(`downcase', `translit(`$*', `A-Z', `a-z')') -define(`_capitalize', - `regexp(`$1', `^\(\w\)\(\w*\)', - `upcase(`\1')`'downcase(`\2')')') -define(`capitalize', `patsubst(`$1', `\w+', `_$0(`\&')')') -divert`'dnl diff --git a/examples/capitalize2.m4 b/examples/capitalize2.m4 deleted file mode 100644 index 154dc505..00000000 --- a/examples/capitalize2.m4 +++ /dev/null @@ -1,19 +0,0 @@ -divert(`-1') -# upcase(text) -# downcase(text) -# capitalize(text) -# change case of text, improved version -define(`upcase', `translit(`$*', `a-z', `A-Z')') -define(`downcase', `translit(`$*', `A-Z', `a-z')') -define(`_arg1', `$1') -define(`_to_alt', `changequote(`<<[', `]>>')') -define(`_from_alt', `changequote(<<[`]>>, <<[']>>)') -define(`_upcase_alt', `translit(<<[$*]>>, <<[a-z]>>, <<[A-Z]>>)') -define(`_downcase_alt', `translit(<<[$*]>>, <<[A-Z]>>, <<[a-z]>>)') -define(`_capitalize_alt', - `regexp(<<[$1]>>, <<[^\(\w\)\(\w*\)]>>, - <<[_upcase_alt(<<[<<[\1]>>]>>)_downcase_alt(<<[<<[\2]>>]>>)]>>)') -define(`capitalize', - `_arg1(_to_alt()patsubst(<<[<<[$*]>>]>>, <<[\w+]>>, - _from_alt()`]>>_$0_alt(<<[\&]>>)<<['_to_alt())_from_alt())') -divert`'dnl diff --git a/examples/comments.m4 b/examples/comments.m4 deleted file mode 100644 index c1e3be0a..00000000 --- a/examples/comments.m4 +++ /dev/null @@ -1,7 +0,0 @@ -# An ordinary comment -define(`foo', # A comment in a macro -`Macro `foo' expansion') -foo -define(`comment', `*** Macro `comment' expansion ***') -changecom(`@', `@') -foo diff --git a/examples/curry.m4 b/examples/curry.m4 deleted file mode 100644 index 00997c38..00000000 --- a/examples/curry.m4 +++ /dev/null @@ -1,7 +0,0 @@ -divert(`-1') -# curry(macro, args) -# Expand to a macro call that takes one argument, then invoke -# macro(args, extra). -define(`curry', `$1(shift($@,)_$0') -define(`_curry', ``$1')') -divert`'dnl diff --git a/examples/ddivert.m4 b/examples/ddivert.m4 deleted file mode 100644 index e6e0017e..00000000 --- a/examples/ddivert.m4 +++ /dev/null @@ -1,4 +0,0 @@ -divert(1)Text diverted a first time. -divert(0)undivert(1)dnl -divert(1)Text diverted a second time. -divert(0)undivert(1)dnl diff --git a/examples/debug.m4 b/examples/debug.m4 deleted file mode 100644 index 16f4c74e..00000000 --- a/examples/debug.m4 +++ /dev/null @@ -1,4 +0,0 @@ -define(`countdown', `$1 ifelse(eval($1 > 0), 1, `countdown(decr($1))', `Liftoff')') -debugmode(`aeqc') -traceon(`countdown') -countdown(2) diff --git a/examples/esyscmd.m4 b/examples/esyscmd.m4 deleted file mode 100644 index 3c856e02..00000000 --- a/examples/esyscmd.m4 +++ /dev/null @@ -1,6 +0,0 @@ -# Cannot use real hostname program because test would fail -define(`hostname', esyscmd(`echo www.gnu.org'))dnl -`hostname = >>'hostname`<<' -define(`hostname', -pushdef(`_tmp', `$1')_tmp(translit(esyscmd(`echo www.gnu.org'), `.', `,'))`'popdef(`_tmp'))dnl -`hostname = >>'hostname`<<' diff --git a/examples/exp.m4 b/examples/exp.m4 deleted file mode 100644 index e2bcf943..00000000 --- a/examples/exp.m4 +++ /dev/null @@ -1,3 +0,0 @@ -define(`countdown', `$1 -ifelse(eval($1 > 0), 1, `countdown(decr($1))', `Done')')dnl -countdown(7) diff --git a/examples/foreach.m4 b/examples/foreach.m4 deleted file mode 100644 index 9be25b08..00000000 --- a/examples/foreach.m4 +++ /dev/null @@ -1,8 +0,0 @@ -divert(`-1') -# foreach(x, (item_1, item_2, ..., item_n), stmt) -# parenthesized list, simple version -define(`foreach', `pushdef(`$1')_foreach($@)popdef(`$1')') -define(`_arg1', `$1') -define(`_foreach', `ifelse(`$2', `()', `', - `define(`$1', _arg1$2)$3`'$0(`$1', (shift$2), `$3')')') -divert`'dnl diff --git a/examples/foreach2.m4 b/examples/foreach2.m4 deleted file mode 100644 index 74d00fb6..00000000 --- a/examples/foreach2.m4 +++ /dev/null @@ -1,10 +0,0 @@ -include(`quote.m4')dnl -divert(`-1') -# foreach(x, (item_1, item_2, ..., item_n), stmt) -# parenthesized list, improved version -define(`foreach', `pushdef(`$1')_$0(`$1', - (dquote(dquote_elt$2)), `$3')popdef(`$1')') -define(`_arg1', `$1') -define(`_foreach', `ifelse(`$2', `(`')', `', - `define(`$1', _arg1$2)$3`'$0(`$1', (dquote(shift$2)), `$3')')') -divert`'dnl diff --git a/examples/foreachq.m4 b/examples/foreachq.m4 deleted file mode 100644 index d34fb5b9..00000000 --- a/examples/foreachq.m4 +++ /dev/null @@ -1,9 +0,0 @@ -include(`quote.m4')dnl -divert(`-1') -# foreachq(x, `item_1, item_2, ..., item_n', stmt) -# quoted list, simple version -define(`foreachq', `pushdef(`$1')_foreachq($@)popdef(`$1')') -define(`_arg1', `$1') -define(`_foreachq', `ifelse(quote($2), `', `', - `define(`$1', `_arg1($2)')$3`'$0(`$1', `shift($2)', `$3')')') -divert`'dnl diff --git a/examples/foreachq2.m4 b/examples/foreachq2.m4 deleted file mode 100644 index f57d3edf..00000000 --- a/examples/foreachq2.m4 +++ /dev/null @@ -1,10 +0,0 @@ -include(`quote.m4')dnl -divert(`-1') -# foreachq(x, `item_1, item_2, ..., item_n', stmt) -# quoted list, improved version -define(`foreachq', `pushdef(`$1')_$0($@)popdef(`$1')') -define(`_arg1q', ``$1'') -define(`_rest', `ifelse(`$#', `1', `', `dquote(shift($@))')') -define(`_foreachq', `ifelse(`$2', `', `', - `define(`$1', _arg1q($2))$3`'$0(`$1', _rest($2), `$3')')') -divert`'dnl diff --git a/examples/foreachq3.m4 b/examples/foreachq3.m4 deleted file mode 100644 index 5e656727..00000000 --- a/examples/foreachq3.m4 +++ /dev/null @@ -1,9 +0,0 @@ -divert(`-1') -# foreachq(x, `item_1, item_2, ..., item_n', stmt) -# quoted list, alternate improved version -define(`foreachq', `ifelse(`$2', `', `', - `pushdef(`$1')_$0(`$1', `$3', `', $2)popdef(`$1')')') -define(`_foreachq', `ifelse(`$#', `3', `', - `define(`$1', `$4')$2`'$0(`$1', `$2', - shift(shift(shift($@))))')') -divert`'dnl diff --git a/examples/foreachq4.m4 b/examples/foreachq4.m4 deleted file mode 100644 index 3da64c92..00000000 --- a/examples/foreachq4.m4 +++ /dev/null @@ -1,13 +0,0 @@ -include(`forloop2.m4')dnl -divert(`-1') -# foreachq(x, `item_1, item_2, ..., item_n', stmt) -# quoted list, version based on forloop -define(`foreachq', -`ifelse(`$2', `', `', `_$0(`$1', `$3', $2)')') -define(`_foreachq', -`pushdef(`$1', forloop(`$1', `3', `$#', - `$0_(`1', `2', indir(`$1'))')`popdef( - `$1')')indir(`$1', $@)') -define(`_foreachq_', -``define(`$$1', `$$3')$$2`''') -divert`'dnl diff --git a/examples/forloop.m4 b/examples/forloop.m4 deleted file mode 100644 index fdca2608..00000000 --- a/examples/forloop.m4 +++ /dev/null @@ -1,6 +0,0 @@ -divert(`-1') -# forloop(var, from, to, stmt) - simple version -define(`forloop', `pushdef(`$1', `$2')_forloop($@)popdef(`$1')') -define(`_forloop', - `$4`'ifelse($1, `$3', `', `define(`$1', incr($1))$0($@)')') -divert`'dnl diff --git a/examples/forloop2.m4 b/examples/forloop2.m4 deleted file mode 100644 index b7154e86..00000000 --- a/examples/forloop2.m4 +++ /dev/null @@ -1,12 +0,0 @@ -divert(`-1') -# forloop(var, from, to, stmt) - improved version: -# works even if VAR is not a strict macro name -# performs sanity check that FROM is larger than TO -# allows complex numerical expressions in TO and FROM -define(`forloop', `ifelse(eval(`($2) <= ($3)'), `1', - `pushdef(`$1')_$0(`$1', eval(`$2'), - eval(`$3'), `$4')popdef(`$1')')') -define(`_forloop', - `define(`$1', `$2')$4`'ifelse(`$2', `$3', `', - `$0(`$1', incr(`$2'), `$3', `$4')')') -divert`'dnl diff --git a/examples/forloop3.m4 b/examples/forloop3.m4 deleted file mode 100644 index 98db20f3..00000000 --- a/examples/forloop3.m4 +++ /dev/null @@ -1,13 +0,0 @@ -divert(`-1') -# forloop_arg(from, to, macro) - invoke MACRO(value) for -# each value between FROM and TO, without define overhead -define(`forloop_arg', `ifelse(eval(`($1) <= ($2)'), `1', - `_forloop(`$1', eval(`$2'), `$3(', `)')')') -# forloop(var, from, to, stmt) - refactored to share code -define(`forloop', `ifelse(eval(`($2) <= ($3)'), `1', - `pushdef(`$1')_forloop(eval(`$2'), eval(`$3'), - `define(`$1',', `)$4')popdef(`$1')')') -define(`_forloop', - `$3`$1'$4`'ifelse(`$1', `$2', `', - `$0(incr(`$1'), `$2', `$3', `$4')')') -divert`'dnl diff --git a/examples/fstab.m4 b/examples/fstab.m4 deleted file mode 100644 index 8d10e176..00000000 --- a/examples/fstab.m4 +++ /dev/null @@ -1,6 +0,0 @@ -define(`concat', `translit(``$*'', ` ')') -define(`fsent', `format(`%-25s %-16s nfs %-16s 0 0', `$1:$2', `$3', concat$4)') - -fsent(freja, /home/gevn, /home/gevn, (rw, soft, bg, grpid)) -fsent(freja, /home/freja, /home/freja, (rw, soft, grpid)) -fsent(rimfaxe, /home/rimfaxe, /home/rimfaxe, (rw, soft, bg)) diff --git a/examples/hanoi.m4 b/examples/hanoi.m4 deleted file mode 100644 index 32fd8a41..00000000 --- a/examples/hanoi.m4 +++ /dev/null @@ -1,17 +0,0 @@ -divert(-1) - -# move(from, to) -define(`move', `Move one disk from `$1' to `$2'. -') - -# _hanoi (cnt, from, to, aux) -define(`_hanoi', `ifelse(eval(`$1'<=1), 1, `move($2, $3)', -`$0(decr($1), $2, $4, $3)move($2, $3)$0(decr($1), $4, $3, $2)')') - -# hanoi (cnt) -define(`hanoi', `_$0(`$1', source, destination, auxilliary)') - -# traceon(`move', `_hanoi', `decr') -divert`'dnl - -hanoi(3) diff --git a/examples/incl-test.m4 b/examples/incl-test.m4 deleted file mode 100644 index 323fa05b..00000000 --- a/examples/incl-test.m4 +++ /dev/null @@ -1,3 +0,0 @@ -dnl noauto -`include test file.' -define() diff --git a/examples/incl.m4 b/examples/incl.m4 deleted file mode 100644 index ab9572eb..00000000 --- a/examples/incl.m4 +++ /dev/null @@ -1,3 +0,0 @@ -Include file start -foo -Include file end diff --git a/examples/include.m4 b/examples/include.m4 deleted file mode 100644 index 8e9d9d2f..00000000 --- a/examples/include.m4 +++ /dev/null @@ -1,7 +0,0 @@ -Beginning. -include(`NOFILE') -Intermediate -include(`incl-test.m4') -After -include(`NOFILE') -very late diff --git a/examples/indir.m4 b/examples/indir.m4 deleted file mode 100644 index 51d2b64f..00000000 --- a/examples/indir.m4 +++ /dev/null @@ -1,10 +0,0 @@ -define(`%%$$##', `>>>$0<<< cnt $#') - -# indir(`%%$$##', nonsense, nonsense) -indir(`%%$$##', nonsense, nonsense) - -# indir(`indir', `%%$$##', nonsense) -indir(`indir', `%%$$##', nonsense) - -# indir(`indir', `indir', `indir', `indir', `%%$$##') -indir(`indir', `indir', `indir', `indir', `%%$$##') diff --git a/examples/join.m4 b/examples/join.m4 deleted file mode 100644 index 8687ac70..00000000 --- a/examples/join.m4 +++ /dev/null @@ -1,15 +0,0 @@ -divert(`-1') -# join(sep, args) - join each non-empty ARG into a single -# string, with each element separated by SEP -define(`join', -`ifelse(`$#', `2', ``$2'', - `ifelse(`$2', `', `', ``$2'_')$0(`$1', shift(shift($@)))')') -define(`_join', -`ifelse(`$#$2', `2', `', - `ifelse(`$2', `', `', ``$1$2'')$0(`$1', shift(shift($@)))')') -# joinall(sep, args) - join each ARG, including empty ones, -# into a single string, with each element separated by SEP -define(`joinall', ``$2'_$0(`$1', shift($@))') -define(`_joinall', -`ifelse(`$#', `2', `', ``$1$3'$0(`$1', shift(shift($@)))')') -divert`'dnl diff --git a/examples/loop.m4 b/examples/loop.m4 deleted file mode 100644 index b2fc64c4..00000000 --- a/examples/loop.m4 +++ /dev/null @@ -1,18 +0,0 @@ -dnl Stress test for recursion algorithms. Usage: -dnl m4 -Ipath/to/examples [-Doptions] loop.m4 -dnl Options include: -dnl -Dalt[=] - test with foreachq instead of foreachq2, default 3 -dnl -Dlimit= - set upper limit of sequence to , default 1000 -dnl -Dverbose - print the sequence to the screen, rather than discarding -dnl -Ddebug[=] - execute after forloop but before foreach -dnl -Dsleep= - sleep for seconds before exit, to allow time -dnl to examine peak process memory usage -include(`forloop2.m4')dnl -include(`quote.m4')dnl -ifelse(alt, `alt', `define(`alt', `2')', alt, `', `define(`alt', `3')')dnl -include(`foreachq'alt`.m4')dnl -ifdef(`limit', `', `define(`limit', `1000')')dnl -ifdef(`verbose', `', `divert(`-1')')dnl -ifdef(`debug', `', `define(`debug')')dnl -foreachq(`i', dquote(1forloop(`i', `2', limit, `,i'))debug, ` i') -ifdef(`sleep',`syscmd(`echo done>/dev/tty;sleep 'sleep)')dnl diff --git a/examples/misc.m4 b/examples/misc.m4 deleted file mode 100644 index 979b51aa..00000000 --- a/examples/misc.m4 +++ /dev/null @@ -1,8 +0,0 @@ -divert(-1) -define(`USER', `root') -define(`TMP', maketemp(`/tmp/hejXXXXXX')) -syscmd(`grep "^'USER`:" /etc/passwd | awk -F: "{print \$3}"' > TMP) -define(`UID', include(TMP)) -syscmd(`rm -f' TMP) -divert -UID diff --git a/examples/modtest.m4 b/examples/modtest.m4 deleted file mode 100644 index c61ed6f6..00000000 --- a/examples/modtest.m4 +++ /dev/null @@ -1,7 +0,0 @@ -dnl Copyright (C) 2006, 2010, 2013 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it -dnl with or without modifications, as long as this notice is preserved. -load(`modtest') -test -Dumpdef: dumpdef(`test'). diff --git a/examples/multiquotes.m4 b/examples/multiquotes.m4 deleted file mode 100644 index b56cfbd8..00000000 --- a/examples/multiquotes.m4 +++ /dev/null @@ -1,17 +0,0 @@ -traceon -changequote([,])dnl -changequote([``], [''])dnl -````traceon'''' -define(``foo'', ````FOO'''')dnl -dumpdef(``foo'')dnl -changequote(``!'', ``!'')dnl -!foo! -foo -dumpdef(!foo!)dnl -define(!bar!, !BAR!) -bar -changequote(!>*>*>*>*>!, !<*<*<*<**>*>*>*>foo bar<*<*<*<*< -foo bar ->*>*>*>*>*>*><*<*<*<*<*<*< -dumpdef(>*>*>*>*>foo<*<*<*<*<, >*>*>*>*>bar<*<*<*<*<)dnl diff --git a/examples/patsubst.m4 b/examples/patsubst.m4 deleted file mode 100644 index 9b4c7591..00000000 --- a/examples/patsubst.m4 +++ /dev/null @@ -1,8 +0,0 @@ -# traceon(`patsubst') -patsubst(`GNUs not Unix.', `^', `OBS: ') -patsubst(`GNUs not Unix.', `\<', `OBS: ') -patsubst(`GNUs not Unix.', `\<\w', `\0=') -patsubst(`GNUs not Unix.', `\w*', `(\0)') -patsubst(`GNUs not Unix.', `\w+', `(\0)') -patsubst(`GNUs not Unix.', `\w+') -patsubst(`GNUs not '` Unix.', `[ ]+', ` ') diff --git a/examples/pushpop.m4 b/examples/pushpop.m4 deleted file mode 100644 index d0f2ebb8..00000000 --- a/examples/pushpop.m4 +++ /dev/null @@ -1,25 +0,0 @@ -divert(-1) -pushdef(`hej', `def 1.') -dumpdef(`hej') -pushdef(`hej', `def 2.') -dumpdef(`hej') -pushdef(`hej', `def 3.') -dumpdef(`hej') -pushdef(`hej', `def 4.') -dumpdef(`hej') - -popdef(`hej') -dumpdef(`hej') -popdef(`hej') -dumpdef(`hej') -popdef(`hej') -dumpdef(`hej') -popdef(`hej') -dumpdef(`hej') -popdef(`hej') -dumpdef(`hej') -popdef(`hej') - -dumpdef(`mac2') -popdef(`mac2') -dumpdef(`mac2') diff --git a/examples/quote.m4 b/examples/quote.m4 deleted file mode 100644 index fae52c3e..00000000 --- a/examples/quote.m4 +++ /dev/null @@ -1,9 +0,0 @@ -divert(`-1') -# quote(args) - convert args to single-quoted string -define(`quote', `ifelse(`$#', `0', `', ``$*'')') -# dquote(args) - convert args to quoted list of quoted strings -define(`dquote', ``$@'') -# dquote_elt(args) - convert args to list of double-quoted strings -define(`dquote_elt', `ifelse(`$#', `0', `', `$#', `1', ```$1''', - ```$1'',$0(shift($@))')') -divert`'dnl diff --git a/examples/regexp.m4 b/examples/regexp.m4 deleted file mode 100644 index a4ca573e..00000000 --- a/examples/regexp.m4 +++ /dev/null @@ -1,12 +0,0 @@ -traceon(`regexp')dnl -regexp(`hej med dig', `.*', `>>\0<<') -regexp(`hej med dig', `\w*', `>>\0<<') -regexp(`hej med dig', `.+', `>>\0<<') -regexp(`hej med dig', `m\w+', `>>\0<<') -regexp(`hej med dig', `m\(.*\)', `>>\0<< >>\1<<') - -regexp(`hej med dig', `.*') -regexp(`hej med dig', `\w*') -regexp(`hej med dig', `.+') -regexp(`hej med dig', `m\w+') -regexp(`hej med dig', `m\(.*\)') diff --git a/examples/reverse.m4 b/examples/reverse.m4 deleted file mode 100644 index 7e2374e2..00000000 --- a/examples/reverse.m4 +++ /dev/null @@ -1,4 +0,0 @@ -define(`reverse', `ifelse(eval($# > 1), 1, `reverse(shift($@)), `$1'', ``$1'')') -``'' => reverse. -``hej'' => reverse(hej). -``hej, med, dig'' => reverse(hej, med, dig). diff --git a/examples/shadow.m4 b/examples/shadow.m4 deleted file mode 100644 index f13b7dfa..00000000 --- a/examples/shadow.m4 +++ /dev/null @@ -1,57 +0,0 @@ -dnl Copyright (C) 2006, 2010, 2013 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it -dnl with or without modifications, as long as this notice is preserved. -# no modules loaded yet -test -shadow - -# define our own macros for `test' and `shadow' -define(`test', `local::`test'') -define(`shadow', `local::`shadow'') -test -shadow - -# module Shadow defines `shadow' and `test' macros -load(`shadow') -dumpdef(`test') -dumpdef(`shadow') -test -shadow - -# save the definition of `test' from the Shadow module -define(`Shadow::test', defn(`test')) - -# module Test also defines a `test' macro -load(`modtest') -dumpdef(`test') -dumpdef(`shadow') -test -shadow - -# Reloading Shadow shouldn't affect anything -load(`shadow') -dumpdef(`test') -dumpdef(`shadow') -test -shadow - -# Unloading Test will unshadow the test definition in Shadow -unload(`modtest') -dumpdef(`test') -dumpdef(`shadow') -test -shadow - -# Unloading Shadow once has no effect (we loaded it twice) -unload(`shadow') -dumpdef(`test') -dumpdef(`shadow') -test -shadow - -# Unloading Shadow again will revert to copying `test' and the local -# `shadow' macro. -unload(`shadow') -test -shadow diff --git a/examples/stack.m4 b/examples/stack.m4 deleted file mode 100644 index c1b98333..00000000 --- a/examples/stack.m4 +++ /dev/null @@ -1,16 +0,0 @@ -divert(`-1') -# stack_foreach(macro, action) -# Invoke ACTION with a single argument of each definition -# from the definition stack of MACRO, starting with the oldest. -define(`stack_foreach', -`_stack_reverse(`$1', `tmp-$1')'dnl -`_stack_reverse(`tmp-$1', `$1', `$2(defn(`$1'))')') -# stack_foreach_lifo(macro, action) -# Invoke ACTION with a single argument of each definition -# from the definition stack of MACRO, starting with the newest. -define(`stack_foreach_lifo', -`_stack_reverse(`$1', `tmp-$1', `$2(defn(`$1'))')'dnl -`_stack_reverse(`tmp-$1', `$1')') -define(`_stack_reverse', -`ifdef(`$1', `pushdef(`$2', defn(`$1'))$3`'popdef(`$1')$0($@)')') -divert`'dnl diff --git a/examples/stack_sep.m4 b/examples/stack_sep.m4 deleted file mode 100644 index 767d15e2..00000000 --- a/examples/stack_sep.m4 +++ /dev/null @@ -1,17 +0,0 @@ -divert(`-1') -# stack_foreach_sep(macro, pre, post, sep) -# Invoke PRE`'defn`'POST with a single argument of each definition -# from the definition stack of MACRO, starting with the oldest, and -# separated by SEP between definitions. -define(`stack_foreach_sep', -`_stack_reverse_sep(`$1', `tmp-$1')'dnl -`_stack_reverse_sep(`tmp-$1', `$1', `$2`'defn(`$1')$3', `$4`'')') -# stack_foreach_sep_lifo(macro, pre, post, sep) -# Like stack_foreach_sep, but starting with the newest definition. -define(`stack_foreach_sep_lifo', -`_stack_reverse_sep(`$1', `tmp-$1', `$2`'defn(`$1')$3', `$4`'')'dnl -`_stack_reverse_sep(`tmp-$1', `$1')') -define(`_stack_reverse_sep', -`ifdef(`$1', `pushdef(`$2', defn(`$1'))$3`'popdef(`$1')$0( - `$1', `$2', `$4$3')')') -divert`'dnl diff --git a/examples/stdlib.m4 b/examples/stdlib.m4 deleted file mode 100644 index df0a91dd..00000000 --- a/examples/stdlib.m4 +++ /dev/null @@ -1,44 +0,0 @@ -dnl Copyright (C) 2006, 2010, 2013 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it -dnl with or without modifications, as long as this notice is preserved. -load(`stdlib') - -`getenv - 'getenv(PATH) - -setenv TEST=??? setenv(`TEST', `???') -getenv TEST - getenv(`TEST') - -setenv TEST=Second test setenv(`TEST', `Second test') -getenv TEST - getenv(`TEST') - -unsetenv TEST unsetenv(`TEST') -getenv TEST - getenv(`TEST') - - - -`getlogin - 'getlogin -`getcwd = 'getcwd -`getpid - 'getpid -`getppid - 'getppid - -syscmd(`ps ajx|grep m4') - -`getuid - 'getuid - -user root - getpwnam(`root') -user sync - getpwnam(`sync') -user rene - getpwnam(`rene') - -uid 5 - getpwuid(5) -me - getpwuid(getuid) - -`hostname = 'hostname - -`rand' - rand,rand,rand,rand -`srand' srand -`rand' - rand,rand,rand,rand -`srand' srand -`rand' - rand,rand,rand,rand - -`uname - ' uname diff --git a/examples/sysv-args.m4 b/examples/sysv-args.m4 deleted file mode 100644 index 7c82beb0..00000000 --- a/examples/sysv-args.m4 +++ /dev/null @@ -1,14 +0,0 @@ -divert(-1) -define(`nargs', `$#') -define(`concat', `ifelse(1, $#, `$1', `$1` 'concat(shift($@))')') -traceon(`concat', `nargs') -divert - -nargs -nargs() -nargs(1,2,3,4,5,6) - -concat() -concat(`hej', `med', `dig') -concat(`hej', `med', `dig', `en gang igen') -concat(an, awful, lot, of, argument, at, least, more, that, ten, silly, arguments) diff --git a/examples/time.m4 b/examples/time.m4 deleted file mode 100644 index 77341308..00000000 --- a/examples/time.m4 +++ /dev/null @@ -1,20 +0,0 @@ -dnl Copyright (C) 2006, 2010, 2013 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it -dnl with or without modifications, as long as this notice is preserved. -load(`time') - -`currenttime' = currenttime -`ctime' = ctime != ctime(eval(currenttime+60*60*24)) -gmtime = gmtime(currenttime) -localtime = localtime(currenttime) -define(`q', `$1,$2,$3,$4,$5,$6,$9')dnl - -currenttime -eval(currenttime+60*60*24) -localtime(eval(currenttime+60*60*24)) -q(localtime(eval(currenttime+60*60*24))) -mktime = mktime(q(localtime(eval(currenttime+60*60*24)))) - -%A %B %d, %Y = strftime(`%A %B %d, %Y', currenttime) -%X on %x = strftime(`%X on %x', currenttime) diff --git a/examples/time2.m4 b/examples/time2.m4 deleted file mode 100644 index b0d17b35..00000000 --- a/examples/time2.m4 +++ /dev/null @@ -1,18 +0,0 @@ -dnl Copyright (C) 2006, 2010, 2013 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it -dnl with or without modifications, as long as this notice is preserved. -`currenttime' = currenttime -`ctime' = ctime != ctime(eval(currenttime+60*60*24)) -gmtime = gmtime(currenttime) -localtime = localtime(currenttime) -define(`q', `$1,$2,$3,$4,$5,$6,$9')dnl - -currenttime -eval(currenttime+60*60*24) -localtime(eval(currenttime+60*60*24)) -q(localtime(eval(currenttime+60*60*24))) -mktime = mktime(q(localtime(eval(currenttime+60*60*24)))) - -%A %B %d, %Y = strftime(`%A %B %d, %Y', currenttime) -%X on %x = strftime(`%X on %x', currenttime) diff --git a/examples/trace.m4 b/examples/trace.m4 deleted file mode 100644 index 92ce9816..00000000 --- a/examples/trace.m4 +++ /dev/null @@ -1,30 +0,0 @@ -divert(-1) - -# move(from, to) -define(`move', `Move one disk from `$1' to `$2'. -') - -# _hanoi (cnt, from, to, aux) -define(`_hanoi', `ifelse(eval(`$1'<=1), 1, `move($2, $3)', -`$0(decr($1), $2, $4, $3)move($2, $3)$0(decr($1), $4, $3, $2)')') - -# hanoi (cnt) -define(`hanoi', `_$0(`$1', source, destination, auxilliary)') -divert`'dnl - -# Debugmode t -debugmode(`t') -hanoi(2) - -# Debugmode taeq -debugmode(`taeq') -hanoi(2) - -# Debugmode OFF -debugmode -hanoi(2) - -# Debugmode ae -debugmode(`ae') -traceon(`move', `_hanoi') -hanoi(2) diff --git a/examples/translit.m4 b/examples/translit.m4 deleted file mode 100644 index 078d1726..00000000 --- a/examples/translit.m4 +++ /dev/null @@ -1,8 +0,0 @@ -# traceon(`translit')dnl -translit(`GNUs not Unix', `a-z') -translit(`GNUs not Unix', `a-z', `A-Z') -translit(`GNUs not Unix', `A-Z', `a-z') -translit(`GNUs not Unix', `A-Z') -translit(`a-z', `a-') -translit(`A-Z', `A-Z-', `-A-Z') -translit(`GNUs not Unix', `Z-A', `a-z') diff --git a/examples/undivert.incl b/examples/undivert.incl deleted file mode 100644 index 408e0e20..00000000 --- a/examples/undivert.incl +++ /dev/null @@ -1 +0,0 @@ -This is to be undiverted soon. diff --git a/examples/undivert.m4 b/examples/undivert.m4 deleted file mode 100644 index 61dfb391..00000000 --- a/examples/undivert.m4 +++ /dev/null @@ -1,5 +0,0 @@ -define(`undiverted', `UNDIVERTED') -# undiverted file. -undivert(`undivert.incl') -# included file. -include(`undivert.incl') diff --git a/examples/wrap.m4 b/examples/wrap.m4 deleted file mode 100644 index bbe7ae0b..00000000 --- a/examples/wrap.m4 +++ /dev/null @@ -1,10 +0,0 @@ -divert(-1) -m4wrap(`Wrapper no. 1 -') - -m4wrap(`Wrapper no. 2 -m4wrap(`Wrapper no. 3 -m4wrap(`Wrapper no. 4 -')')') -divert -No. 33: The End. diff --git a/examples/wrapfifo.m4 b/examples/wrapfifo.m4 deleted file mode 100644 index 95ff87a0..00000000 --- a/examples/wrapfifo.m4 +++ /dev/null @@ -1,10 +0,0 @@ -dnl Redefine m4wrap to have FIFO semantics. -define(`_m4wrap_level', `0')dnl -define(`m4wrap', -`ifdef(`m4wrap'_m4wrap_level, - `define(`m4wrap'_m4wrap_level, - defn(`m4wrap'_m4wrap_level)`$1')', - `builtin(`m4wrap', `define(`_m4wrap_level', - incr(_m4wrap_level))dnl -m4wrap'_m4wrap_level)dnl -define(`m4wrap'_m4wrap_level, `$1')')')dnl diff --git a/examples/wraplifo.m4 b/examples/wraplifo.m4 deleted file mode 100644 index bdbf3fb6..00000000 --- a/examples/wraplifo.m4 +++ /dev/null @@ -1,10 +0,0 @@ -dnl Redefine m4wrap to have LIFO semantics. -define(`_m4wrap_level', `0')dnl -define(`_m4wrap', defn(`m4wrap'))dnl -define(`m4wrap', -`ifdef(`m4wrap'_m4wrap_level, - `define(`m4wrap'_m4wrap_level, - `$1'defn(`m4wrap'_m4wrap_level))', - `_m4wrap(`define(`_m4wrap_level', incr(_m4wrap_level))dnl -m4wrap'_m4wrap_level)dnl -define(`m4wrap'_m4wrap_level, `$1')')')dnl diff --git a/examples/wraplifo2.m4 b/examples/wraplifo2.m4 deleted file mode 100644 index 5b450a76..00000000 --- a/examples/wraplifo2.m4 +++ /dev/null @@ -1,9 +0,0 @@ -dnl Redefine m4wrap to have LIFO semantics, improved example. -include(`join.m4')dnl -define(`_m4wrap', defn(`m4wrap'))dnl -define(`_arg1', `$1')dnl -define(`m4wrap', -`ifdef(`_$0_text', - `define(`_$0_text', joinall(` ', $@)defn(`_$0_text'))', - `_$0(`_arg1(defn(`_$0_text')undefine(`_$0_text'))')dnl -define(`_$0_text', joinall(` ', $@))')')dnl diff --git a/modules/README b/modules/README index d8fc4126..3048e24e 100644 --- a/modules/README +++ b/modules/README @@ -71,11 +71,11 @@ strategies are illustrated by shadow.c and shadow.m4. To try the demos, compile with `make' and run them with the commands as: - tests/m4 examples/time.m4 + tests/m4 doc/examples/time.m4 or in the case of time2.m4 - tests/m4 -I tests time -I examples time2.m4 + tests/m4 -I tests time -I doc/examples time2.m4 ======================================================================== diff --git a/tests/builtins.at b/tests/builtins.at index d53ffc4e..d22b94fe 100644 --- a/tests/builtins.at +++ b/tests/builtins.at @@ -242,7 +242,7 @@ AT_DATA([in.m4], [[include(`forloop3.m4')dnl forloop(`i', `1', `10000', `define(`m'i, i)')m10000 forloop(`i', `1', `10000', `undefine(`m'i)')m10000 ]]) -AT_CHECK_M4([-I "$abs_top_srcdir/examples" in.m4], [0], [[10000 +AT_CHECK_M4([-I "$abs_top_srcdir/doc/examples" in.m4], [0], [[10000 m10000 ]]) @@ -378,7 +378,7 @@ forloop(`i', `9001', `10000', divert(`-1')undivert ]]) -AT_CHECK_M4([-I "$abs_top_srcdir/examples" in.m4]) +AT_CHECK_M4([-I "$abs_top_srcdir/doc/examples" in.m4]) AT_CLEANUP diff --git a/tests/generate.awk b/tests/generate.awk index 424663d0..567501a7 100755 --- a/tests/generate.awk +++ b/tests/generate.awk @@ -183,15 +183,15 @@ function new_test(input, status, output, error, options, xfail, examples) { if (examples == 1) { printf ("AT_DATA([expout1],\n[[%s]])\n", output); - printf ("$SED -e \"s|examples|$abs_top_srcdir/examples|g\" \\\n"); + printf ("$SED -e \"s|doc/examples|$abs_top_srcdir/doc/examples|g\" \\\n"); printf (" < expout1 > expout\n\n"); if (error) { printf ("AT_DATA([experr1],\n[[%s]])\n", error); - printf ("$SED \"s|examples|$abs_top_srcdir/examples|g\" \\\n"); + printf ("$SED \"s|doc/examples|$abs_top_srcdir/doc/examples|g\" \\\n"); printf (" < experr1 > experr\n\n"); } - options = options " -I\"$abs_top_srcdir/examples\""; + options = options " -I\"$abs_top_srcdir/doc/examples\""; } printf ("AT_DATA([[input.m4]],\n[[%s]])\n\n", input); diff --git a/tests/others.at b/tests/others.at index dd5c99a3..6253934b 100644 --- a/tests/others.at +++ b/tests/others.at @@ -457,28 +457,28 @@ include(`loop.m4')dnl ]]) dnl boxed recursion -AT_CHECK_M4([-I "$top_srcdir/examples" -Dlimit=10 -Dverbose loop.m4], [0], +AT_CHECK_M4([-I "$top_srcdir/doc/examples" -Dlimit=10 -Dverbose loop.m4], [0], [[ 1 2 3 4 5 6 7 8 9 10 ]]) -AT_CHECK_M4([-I "$top_srcdir/examples" -Dlimit=2500 loop.m4], [0]) -AT_CHECK_M4([-I "$top_srcdir/examples" -Dlimit=10000 in.m4], [0], [[48894 +AT_CHECK_M4([-I "$top_srcdir/doc/examples" -Dlimit=2500 loop.m4], [0]) +AT_CHECK_M4([-I "$top_srcdir/doc/examples" -Dlimit=10000 in.m4], [0], [[48894 ]]) dnl unboxed recursion -AT_CHECK_M4([-I "$top_srcdir/examples" -Dlimit=10 -Dverbose -Dalt loop.m4], [0], +AT_CHECK_M4([-I "$top_srcdir/doc/examples" -Dlimit=10 -Dverbose -Dalt loop.m4], [0], [[ 1 2 3 4 5 6 7 8 9 10 ]]) -AT_CHECK_M4([-I "$top_srcdir/examples" -Dlimit=2500 -Dalt loop.m4], [0]) -AT_CHECK_M4([-I "$top_srcdir/examples" -Dlimit=10000 -Dalt in.m4], [0], +AT_CHECK_M4([-I "$top_srcdir/doc/examples" -Dlimit=2500 -Dalt loop.m4], [0]) +AT_CHECK_M4([-I "$top_srcdir/doc/examples" -Dlimit=10000 -Dalt in.m4], [0], [[48894 ]]) dnl foreach via forloop recursion -AT_CHECK_M4([-I "$top_srcdir/examples" -Dlimit=10 -Dverbose -Dalt=4 loop.m4], +AT_CHECK_M4([-I "$top_srcdir/doc/examples" -Dlimit=10 -Dverbose -Dalt=4 loop.m4], [0], [[ 1 2 3 4 5 6 7 8 9 10 ]]) -AT_CHECK_M4([-I "$top_srcdir/examples" -Dlimit=2500 -Dalt=4 loop.m4], [0]) -AT_CHECK_M4([-I "$top_srcdir/examples" -Dlimit=10000 -Dalt=4 in.m4], [0], +AT_CHECK_M4([-I "$top_srcdir/doc/examples" -Dlimit=2500 -Dalt=4 loop.m4], [0]) +AT_CHECK_M4([-I "$top_srcdir/doc/examples" -Dlimit=10000 -Dalt=4 in.m4], [0], [[48894 ]]) @@ -488,7 +488,7 @@ forloop(`i', `1', `10000', `pushdef(`s', i)')dnl define(`colon', `:')define(`dash', `-')dnl len(stack_foreach_sep(`s', `dash', `', `colon')) ]]) -AT_CHECK_M4([-I "$top_srcdir/examples" in.m4], [0], [[58893 +AT_CHECK_M4([-I "$top_srcdir/doc/examples" in.m4], [0], [[58893 ]]) AT_CLEANUP -- cgit v1.2.1