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.
%%--------------------------------------------------------------------
%% @doc MQTT Broker Header.
%% MQTT Broker Header
%%--------------------------------------------------------------------
%% Banner
@ -22,7 +22,7 @@
-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").
@ -56,9 +56,9 @@
%% MQTT Subscription
%%--------------------------------------------------------------------
-record(mqtt_subscription, {
subid :: binary() | atom(),
topic :: binary(),
qos = 0 :: 0 | 1 | 2
subid :: binary() | atom(),
topic :: binary(),
qos = 0 :: 0 | 1 | 2
}).
-type mqtt_subscription() :: #mqtt_subscription{}.

View File

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

View File

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

View File

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