Просмотр исходного кода

Merge pull request #18 from cxa/unify-cx

Unify cx record
Namdak Tonpa 7 лет назад
Родитель
Сommit
ee5fd84d0f
3 измененных файлов с 10 добавлено и 4 удалено
  1. 7 0
      include/cx.hrl
  2. 1 1
      src/nitro.erl
  3. 2 3
      src/render/wf_event.erl

+ 7 - 0
include/cx.hrl

@@ -0,0 +1,7 @@
+-ifndef(NITRO_CX).
+-define(NITRO_CX, true).
+
+-record(cx, { handlers=[], actions=[], req=[], module=[], lang=[], path=[],
+              session=[], formatter=bert, params=[], node=[], client_pid=[], state=[], from=[], vsn = [] }).
+
+-endif.

+ 1 - 1
src/nitro.erl

@@ -1,11 +1,11 @@
 -module(nitro).
+-include_lib("nitro/include/cx.hrl").
 -include_lib("nitro/include/nitro.hrl").
 -compile(export_all).
 -behaviour(application).
 -export([start/2, stop/1, init/1]).
 
 -record(ev,      { module, msg, trigger, name }).
--record(cx,      { handlers, actions, req, module, lang, path, session, formatter=false, params, form, state=[] }).
 
 start(_StartType, _StartArgs) -> supervisor:start_link({local, ?MODULE}, ?MODULE, []).
 stop(_State) -> ok.

+ 2 - 3
src/render/wf_event.erl

@@ -1,12 +1,11 @@
 -module(wf_event).
 -author('Maxim Sokhatsky').
 -author('Andrey Martemyanov').
--include_lib ("nitro/include/nitro.hrl").
+-include_lib("nitro/include/cx.hrl").
+-include_lib("nitro/include/nitro.hrl").
 -compile(export_all).
 
 -record(ev,      { module, msg, trigger, name }).
--record(cx,      { handlers=[], actions=[], req=[], module=[], lang=[], path=[],
-                   session=[], formatter=bert, params=[], node=[], client_pid=[], state=[], from=[], vsn = [] }).
 
 -define(B(E), nitro:to_binary(E)).
 -define(L(E), nitro:to_list(E)).