0.16.0 - fix format/comments, add PROC_NAME/2 macro
This commit is contained in:
parent
9dda709aa1
commit
1b79ebf232
|
@ -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").
|
||||||
|
|
||||||
|
@ -56,9 +56,9 @@
|
||||||
%% MQTT Subscription
|
%% MQTT Subscription
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
-record(mqtt_subscription, {
|
-record(mqtt_subscription, {
|
||||||
subid :: binary() | atom(),
|
subid :: binary() | atom(),
|
||||||
topic :: binary(),
|
topic :: binary(),
|
||||||
qos = 0 :: 0 | 1 | 2
|
qos = 0 :: 0 | 1 | 2
|
||||||
}).
|
}).
|
||||||
|
|
||||||
-type mqtt_subscription() :: #mqtt_subscription{}.
|
-type mqtt_subscription() :: #mqtt_subscription{}.
|
||||||
|
|
|
@ -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]).
|
|
||||||
|
|
||||||
|
|
|
@ -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)).
|
||||||
|
|
||||||
|
|
|
@ -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...
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue