diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2018-06-14 14:00:47 +0300 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2018-06-14 14:00:47 +0300 |
commit | fd8e07af4789be362a61755ea47f216baeb64989 (patch) | |
tree | 0ac0a7a779fd27e79e940519441161dc0c4dfd5f /include | |
parent | Log modules startup (diff) |
Get rid of ejabberd.hrl header
The header consisted of too many unrelated stuff and macros misuse.
Some stuff is moved into scram.hrl and type_compat.hrl.
All macros have been replaced with the corresponding function calls.
TODO: probably type_compat.hrl is not even needed anymore since
we support only Erlang >= OTP 17.5
Diffstat (limited to 'include')
-rw-r--r-- | include/logger.hrl | 3 | ||||
-rw-r--r-- | include/mod_muc_room.hrl | 4 | ||||
-rw-r--r-- | include/pubsub.hrl | 2 | ||||
-rw-r--r-- | include/scram.hrl | 28 | ||||
-rw-r--r-- | include/type_compat.hrl (renamed from include/ejabberd.hrl) | 37 |
5 files changed, 33 insertions, 41 deletions
diff --git a/include/logger.hrl b/include/logger.hrl index 936befab..a407b2e2 100644 --- a/include/logger.hrl +++ b/include/logger.hrl @@ -42,3 +42,6 @@ false -> ok; _ -> 'Elixir.Logger':bare_log(error, io_lib:format(Format, Args), [?MODULE]) end). + +%% Uncomment if you want to debug p1_fsm/gen_fsm +%%-define(DBGFSM, true). diff --git a/include/mod_muc_room.hrl b/include/mod_muc_room.hrl index 5966a6e0..b4804114 100644 --- a/include/mod_muc_room.hrl +++ b/include/mod_muc_room.hrl @@ -18,7 +18,7 @@ %%% %%%---------------------------------------------------------------------- --include("ejabberd.hrl"). +-include("type_compat.hrl"). -define(MAX_USERS_DEFAULT, 200). @@ -67,7 +67,7 @@ captcha_whitelist = (?SETS):empty() :: ?TGB_SET, mam = false :: boolean(), pubsub = <<"">> :: binary(), - lang = ?MYLANG :: binary() + lang = ejabberd_config:get_mylang() :: binary() }). -type config() :: #config{}. diff --git a/include/pubsub.hrl b/include/pubsub.hrl index 8926413b..28950f5f 100644 --- a/include/pubsub.hrl +++ b/include/pubsub.hrl @@ -18,8 +18,6 @@ %%% %%%---------------------------------------------------------------------- --include("ejabberd.hrl"). - %% ------------------------------- %% Pubsub constants -define(ERR_EXTENDED(E, C), mod_pubsub:extended_error(E, C)). diff --git a/include/scram.hrl b/include/scram.hrl new file mode 100644 index 00000000..156a6401 --- /dev/null +++ b/include/scram.hrl @@ -0,0 +1,28 @@ +%%%---------------------------------------------------------------------- +%%% +%%% ejabberd, Copyright (C) 2002-2018 ProcessOne +%%% +%%% This program is free software; you can redistribute it and/or +%%% modify it under the terms of the GNU General Public License as +%%% published by the Free Software Foundation; either version 2 of the +%%% License, or (at your option) any later version. +%%% +%%% This program is distributed in the hope that it will be useful, +%%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%%% General Public License for more details. +%%% +%%% You should have received a copy of the GNU General Public License along +%%% with this program; if not, write to the Free Software Foundation, Inc., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +%%% +%%%---------------------------------------------------------------------- + +-record(scram, {storedkey = <<"">> :: binary(), + serverkey = <<"">> :: binary(), + salt = <<"">> :: binary(), + iterationcount = 0 :: integer()}). + +-type scram() :: #scram{}. + +-define(SCRAM_DEFAULT_ITERATION_COUNT, 4096). diff --git a/include/ejabberd.hrl b/include/type_compat.hrl index 0baf8dd2..bd5129c4 100644 --- a/include/ejabberd.hrl +++ b/include/type_compat.hrl @@ -18,41 +18,6 @@ %%% %%%---------------------------------------------------------------------- --ifndef(EJABBERD_HRL). --define(EJABBERD_HRL, true). - --define(VERSION, ejabberd_config:get_version()). - --define(MYHOSTS, ejabberd_config:get_myhosts()). - --define(MYNAME, hd(ejabberd_config:get_myhosts())). - --define(MYLANG, ejabberd_config:get_mylang()). - --define(MSGS_DIR, filename:join(["priv", "msgs"])). - --define(SQL_DIR, filename:join(["priv", "sql"])). - --define(CONFIG_PATH, <<"ejabberd.yml">>). - --define(LOG_PATH, "ejabberd.log"). - --define(EJABBERD_URI, <<"http://www.process-one.net/en/ejabberd/">>). - --define(COPYRIGHT, "Copyright (c) ProcessOne"). - -%%-define(DBGFSM, true). - --record(scram, - {storedkey = <<"">>, - serverkey = <<"">>, - salt = <<"">>, - iterationcount = 0 :: integer()}). - --type scram() :: #scram{}. - --define(SCRAM_DEFAULT_ITERATION_COUNT, 4096). - -ifdef(ERL_DEPRECATED_TYPES). -define(TDICT, dict()). @@ -68,5 +33,3 @@ -define(TQUEUE, queue:queue()). -endif. - --endif. |