|
|
595b9e |
dnl modern.m4: a modern and simple framework for using the m4 macro language
|
|
|
595b9e |
dnl
|
|
|
595b9e |
dnl This file is covered by COPYING.SOFORT.
|
|
|
595b9e |
dnl
|
|
|
595b9e |
dnl 1) make all standard m4 builtins m4_ prefixed.
|
|
|
595b9e |
dnl 2) set the left-bracket and right-bracket symbols the begin-quote and end-quote strings.
|
|
|
595b9e |
dnl 3) make a single underscore symbol the equivalent of the standard dnl builtin.
|
|
|
80567e |
dnl 4) provide the m4_toupper(), m4_tolower(), and m4_pathvar() macros.
|
|
|
80567e |
dnl 5) provide the m4_srclist() and m4_srcitem() macros.
|
|
|
80567e |
dnl 6) provide the m4_fillerdots(), m4_fillerdash(), and m4_fillerline() macros.
|
|
|
80567e |
dnl 7) provide the m4_whitespace() and m4_spacealign() macros.
|
|
|
80567e |
dnl 8) provide the m4_alignlen(), m4_leftalign(), and m4_rightalign() macros.
|
|
|
80567e |
dnl 9) provide the m4_tab(), m4_tabtab(), and m4_tabtabtab() macros.
|
|
|
595b9e |
dnl
|
|
|
595b9e |
divert(-1)
|
|
|
595b9e |
|
|
|
595b9e |
define(m4_changecom,defn(`changecom'))
|
|
|
595b9e |
define(m4_changequote,defn(`changequote'))
|
|
|
595b9e |
define(m4_decr,defn(`decr'))
|
|
|
595b9e |
define(m4_define,defn(`define'))
|
|
|
595b9e |
define(m4_defn,defn(`defn'))
|
|
|
595b9e |
define(m4_divert,defn(`divert'))
|
|
|
595b9e |
define(m4_divnum,defn(`divnum'))
|
|
|
595b9e |
define(m4_dnl,defn(`dnl'))
|
|
|
595b9e |
define(m4_dumpdef,defn(`dumpdef'))
|
|
|
595b9e |
define(m4_errprint,defn(`errprint'))
|
|
|
595b9e |
define(m4_eval,defn(`eval'))
|
|
|
595b9e |
define(m4_ifdef,defn(`ifdef'))
|
|
|
595b9e |
define(m4_ifelse,defn(`ifelse'))
|
|
|
595b9e |
define(m4_include,defn(`include'))
|
|
|
595b9e |
define(m4_incr,defn(`incr'))
|
|
|
595b9e |
define(m4_index,defn(`index'))
|
|
|
595b9e |
define(m4_len,defn(`len'))
|
|
|
595b9e |
define(m4_m4exit,defn(`m4exit'))
|
|
|
595b9e |
define(m4_m4wrap,defn(`m4wrap'))
|
|
|
595b9e |
define(m4_maketemp,defn(`maketemp'))
|
|
|
595b9e |
define(m4_mkstemp,defn(`mkstemp'))
|
|
|
595b9e |
define(m4_popdef,defn(`popdef'))
|
|
|
595b9e |
define(m4_pushdef,defn(`pushdef'))
|
|
|
595b9e |
define(m4_shift,defn(`shift'))
|
|
|
595b9e |
define(m4_sinclude,defn(`sinclude'))
|
|
|
595b9e |
define(m4_substr,defn(`substr'))
|
|
|
595b9e |
define(m4_syscmd,defn(`syscmd'))
|
|
|
595b9e |
define(m4_sysval,defn(`sysval'))
|
|
|
595b9e |
define(m4_traceoff,defn(`traceoff'))
|
|
|
595b9e |
define(m4_traceon,defn(`traceon'))
|
|
|
595b9e |
define(m4_translit,defn(`translit'))
|
|
|
595b9e |
define(m4_undefine,defn(`undefine'))
|
|
|
595b9e |
define(m4_undivert,defn(`undivert'))
|
|
|
595b9e |
|
|
|
595b9e |
m4_changequote([,])
|
|
|
595b9e |
|
|
|
595b9e |
m4_undefine([changecom])
|
|
|
595b9e |
m4_undefine([changequote])
|
|
|
595b9e |
m4_undefine([decr])
|
|
|
595b9e |
m4_undefine([define])
|
|
|
595b9e |
m4_undefine([defn])
|
|
|
595b9e |
m4_undefine([divert])
|
|
|
595b9e |
m4_undefine([divnum])
|
|
|
595b9e |
m4_undefine([dnl])
|
|
|
595b9e |
m4_undefine([dumpdef])
|
|
|
595b9e |
m4_undefine([errprint])
|
|
|
595b9e |
m4_undefine([eval])
|
|
|
595b9e |
m4_undefine([ifdef])
|
|
|
595b9e |
m4_undefine([ifelse])
|
|
|
595b9e |
m4_undefine([include])
|
|
|
595b9e |
m4_undefine([incr])
|
|
|
595b9e |
m4_undefine([index])
|
|
|
595b9e |
m4_undefine([len])
|
|
|
595b9e |
m4_undefine([m4exit])
|
|
|
595b9e |
m4_undefine([m4wrap])
|
|
|
595b9e |
m4_undefine([maketemp])
|
|
|
595b9e |
m4_undefine([mkstemp])
|
|
|
595b9e |
m4_undefine([popdef])
|
|
|
595b9e |
m4_undefine([pushdef])
|
|
|
595b9e |
m4_undefine([shift])
|
|
|
595b9e |
m4_undefine([sinclude])
|
|
|
595b9e |
m4_undefine([substr])
|
|
|
595b9e |
m4_undefine([syscmd])
|
|
|
595b9e |
m4_undefine([sysval])
|
|
|
595b9e |
m4_undefine([traceoff])
|
|
|
595b9e |
m4_undefine([traceon])
|
|
|
595b9e |
m4_undefine([translit])
|
|
|
595b9e |
m4_undefine([undefine])
|
|
|
595b9e |
m4_undefine([undivert])
|
|
|
595b9e |
|
|
|
44db6b |
m4_define([_],m4_defn([m4_dnl]))
|
|
|
44db6b |
|
|
|
80567e |
m4_define([m4_toupper],[m4_translit([[$1]],[[abcdefghijklmnopqrstuvwxyz]],[[ABCDEFGHIJKLMNOPQRSTUVWXYZ]])])
|
|
|
80567e |
m4_define([m4_tolower],[m4_translit([[$1]],[[ABCDEFGHIJKLMNOPQRSTUVWXYZ]],[[abcdefghijklmnopqrstuvwxyz]])])
|
|
|
3e5bd4 |
m4_define([m4_pathvar],[m4_translit(m4_toupper([[$1]]),[/-],[__])])
|
|
|
80567e |
|
|
|
80567e |
m4_define([m4_srclist],[[$1] = \])
|
|
|
80567e |
m4_define([m4_srcitem],[m4_tab[$1] \])
|
|
|
80567e |
|
|
|
80567e |
m4_define([m4_fillerdots],[................................])
|
|
|
80567e |
m4_define([m4_fillerdash],[--------------------------------])
|
|
|
80567e |
m4_define([m4_fillerline],[m4_fillerdots[]m4_fillerdots[]m4_fillerdots[]])
|
|
|
80567e |
|
|
|
80567e |
m4_define([m4_whitespace],[m4_translit(m4_fillerdots,[[.]],[[ ]])])
|
|
|
80567e |
m4_define([m4_spacealign],[m4_translit(m4_fillerline,[[.]],[[ ]])])
|
|
|
80567e |
|
|
|
80567e |
m4_define([m4_alignlen],[m4_eval([$1]-m4_len([$2]))])
|
|
|
80567e |
m4_define([m4_leftalign],[m4_substr(m4_spacealign,0,m4_alignlen([$1],[$2]))[$2]])
|
|
|
80567e |
m4_define([m4_rightalign],[[$2]m4_substr(m4_spacealign,0,m4_alignlen([$1],[$2]))])
|
|
|
80567e |
|
|
|
80567e |
|
|
|
80567e |
m4_define([m4_tab],_
|
|
|
80567e |
[$1]))
|
|
|
80567e |
|
|
|
80567e |
m4_define([m4_tabtab],_
|
|
|
80567e |
[$1])
|
|
|
80567e |
|
|
|
80567e |
m4_define([m4_tabtabtab],_
|
|
|
80567e |
[$1])
|
|
|
44db6b |
|
|
|
595b9e |
m4_divert(0)_
|