0.16.0 - fix format/comments, add PROC_NAME/2 macro

This commit is contained in:
Feng 2016-02-11 14:33:06 +08:00
parent 9dda709aa1
commit 1b79ebf232
4 changed files with 15 additions and 18 deletions

View File

@ -14,7 +14,7 @@
%% limitations under the License. %% limitations under the License.
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
%% @doc MQTT Broker Header. %% MQTT Broker Header
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
%% Banner %% Banner
@ -22,7 +22,7 @@
-define(COPYRIGHT, "Copyright (C) 2012-2016, Feng Lee <feng@emqtt.io>"). -define(COPYRIGHT, "Copyright (C) 2012-2016, Feng Lee <feng@emqtt.io>").
-define(LICENSE_MESSAGE, "Licensed under MIT"). -define(LICENSE_MESSAGE, "Licensed under the Apache License, Version 2.0").
-define(PROTOCOL_VERSION, "MQTT/3.1.1"). -define(PROTOCOL_VERSION, "MQTT/3.1.1").

View File

@ -14,15 +14,11 @@
%% limitations under the License. %% limitations under the License.
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
-define(PRINT(Format, Args), -define(PRINT_MSG(Msg), io:format(Msg)).
io:format(Format, Args)).
-define(PRINT_MSG(Msg), -define(PRINT(Format, Args), io:format(Format, Args)).
io:format(Msg)).
-define(PRINT_CMD(Cmd, Descr), -define(PRINT_CMD(Cmd, Descr), io:format("~-40s#~s~n", [Cmd, Descr])).
io:format("~-40s#~s~n", [Cmd, Descr])).
-define(USAGE(CmdList), -define(USAGE(CmdList), [?PRINT_CMD(Cmd, Descr) || {Cmd, Descr} <- CmdList]).
[?PRINT_CMD(Cmd, Descr) || {Cmd, Descr} <- CmdList]).

View File

@ -14,7 +14,7 @@
%% limitations under the License. %% limitations under the License.
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
%% @doc Internal Header File %% Internal Header File
-define(GPROC_POOL(JoinOrLeave, Pool, I), -define(GPROC_POOL(JoinOrLeave, Pool, I),
(begin (begin
@ -24,6 +24,8 @@
end end
end)). end)).
-define(PROC_NAME(M, I), (list_to_atom(lists:concat([M, "_", I])))).
-define(record_to_proplist(Def, Rec), -define(record_to_proplist(Def, Rec),
lists:zip(record_info(fields, Def), lists:zip(record_info(fields, Def),
tl(tuple_to_list(Rec)))). tl(tuple_to_list(Rec)))).
@ -52,7 +54,7 @@
-define(IF(Cond, TrueFun,FalseFun), -define(IF(Cond, TrueFun,FalseFun),
(case (Cond) of (case (Cond) of
true ->(TrueCase); true -> (TrueFun);
false->(FalseCase) false-> (FalseFun)
end)). end)).

View File

@ -14,7 +14,7 @@
%% limitations under the License. %% limitations under the License.
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
%% @doc MQTT Protocol Header. %% MQTT Protocol Header
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
%% MQTT Protocol Version and Levels %% MQTT Protocol Version and Levels
@ -62,7 +62,6 @@
end) end)
end). end).
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
%% Max ClientId Length. Why 1024? NiDongDe... %% Max ClientId Length. Why 1024? NiDongDe...
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------