1 m4_divert(-1) ### -*-m4-*-
3 ### Definitions for generating zone files.
7 ###--------------------------------------------------------------------------
10 ## FOREACH(what, list)
12 ## The LIST is a comma-separated list of things, like an m4 argument list.
13 ## For each item in the list, expand WHAT as if it's the body of a macro with
14 ## the list item as its arguments. In other words, the list item itself can
15 ## be a list of comma-separated items, which are available as $1, $2, ...,
17 m4_define([_FOREACH], [m4_dnl
18 m4_ifelse([$#], [1], [_foreach_func($1)],
19 [_foreach_func($1)[]_FOREACH(m4_shift($@))])])
20 m4_define([FOREACH], [m4_dnl
21 m4_pushdef([_foreach_func], [$1])m4_dnl
23 m4_popdef([_foreach_func])])
27 ## Delegate NAME to the NAMESERVERS.
28 m4_define([SUBZONE], [m4_dnl
30 m4_ifelse($1,@,$][1,$][1.$1) IN A $][2
33 $1 IN NS m4_ifelse($1,@,$][1,$][1.$1)
36 ###--------------------------------------------------------------------------
39 m4_define([CONTACT], [hostmaster.BASE])
40 m4_define([BLACKHOLE], [[A, 212.13.198.78], [AAAA, 2001:ba8:0:1d9::ffff]])
41 m4_include([config.m4])
43 ###----- That's all, folks --------------------------------------------------