Blame sofort/core/modern.m4

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