m4_divert(-1) ### -*-m4-*- ### ### Definitions for generating zone files. m4_changequote([, ]) ###-------------------------------------------------------------------------- ### Utilities. ## FOREACH(what, list) ## ## The LIST is a comma-separated list of things, like an m4 argument list. ## For each item in the list, expand WHAT as if it's the body of a macro with ## the list item as its arguments. In other words, the list item itself can ## be a list of comma-separated items, which are available as $1, $2, ..., ## within WHAT. m4_define([_FOREACH], [m4_dnl m4_ifelse([$#], [1], [_foreach_func($1)], [_foreach_func($1)[]_FOREACH(m4_shift($@))])]) m4_define([FOREACH], [m4_dnl m4_pushdef([_foreach_func], [$1])m4_dnl _FOREACH($2)[]m4_dnl m4_popdef([_foreach_func])]) ## SUBZONE(name) ## ## Delegate NAME to the NAMESERVERS. m4_define([SUBZONE], [m4_dnl FOREACH([m4_dnl m4_ifelse($1,@,$][1,$][1.$1) IN A $][2 ], [NAMESERVERS]) FOREACH([m4_dnl $1 IN NS m4_ifelse($1,@,$][1,$][1.$1) ], [NAMESERVERS])]) ###-------------------------------------------------------------------------- ### Configuration. m4_define([CONTACT], [hostmaster.BASE]) m4_define([BLACKHOLE], [212.13.198.78]) m4_include([config.m4]) ###----- That's all, folks -------------------------------------------------- m4_divert(0)m4_dnl