From c6483e4e04af1500e4d328a6b4482c8507823d27 Mon Sep 17 00:00:00 2001 From: nsensfel Date: Tue, 2 Oct 2018 16:23:27 +0200 Subject: Adds portraits as a data listing. --- portrait/global.m4.conf | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 portrait/global.m4.conf (limited to 'portrait/global.m4.conf') diff --git a/portrait/global.m4.conf b/portrait/global.m4.conf new file mode 100644 index 0000000..a99f0db --- /dev/null +++ b/portrait/global.m4.conf @@ -0,0 +1,35 @@ +m4_define(`__PORTRAIT_CHOOSE_STYLE', + `m4_define(`__PORTRAIT',m4_defn(`$1'))m4_undefine(`$1')')m4_dnl +m4_dnl +m4_dnl +m4_dnl +m4_define(`__PORTRAIT_ERLANG_STYLE',`from_id (`$1') -> + #portrait + { + id = <<"$1">>, + name = <<"$2">>, + body_id = <<"$3">>, + icon_id = <<"$4">> + }; +')m4_dnl +m4_define(`__PORTRAIT_USE_ERLANG_STYLE', + `__PORTRAIT_CHOOSE_STYLE(`__PORTRAIT_ERLANG_STYLE')')m4_dnl +m4_dnl +m4_dnl +m4_dnl +m4_define(`__PORTRAIT_JSON_STYLE',` { + "msg": "add_portrait", + "id": "$1", + "nam": "$2", + "bid": "$3", + "iid": "$4" + }, +')m4_dnl +m4_define(`__PORTRAIT_USE_JSON_STYLE', + `__PORTRAIT_CHOOSE_STYLE(`__PORTRAIT_JSON_STYLE')')m4_dnl +m4_dnl +m4_dnl +m4_dnl +m4_ifelse(__CODE_STYLE(), + erlang, `__PORTRAIT_USE_ERLANG_STYLE()', + __CODE_STYLE(), json, `__PORTRAIT_USE_JSON_STYLE()')m4_dnl -- cgit v1.2.3-70-g09d2