Blame sofort/core/modern.m4

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