Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# .git-blame-ignore-revs

# Use this file when viewing blame:
# git blame --ignore-revs-file .git-blame-ignore-revs
# Or configure git to use always this file:
# git config blame.ignoreRevsFile .git-blame-ignore-revs

# Accumulated patch to binarize and indent code
9deb294328bb3f9eb6bd2c0e7cd500732e9b5830
# Result of running "make format indent" for the first time
6b7d15f0271686b6902a0edc82f407e529b35a90
11 changes: 8 additions & 3 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ SED = @SED@
ERL = @ERL@
EPMD = @EPMD@
IEX = @IEX@
EMACS = @EMACS@

INSTALLUSER=@INSTALLUSER@
INSTALLGROUP=@INSTALLGROUP@
Expand Down Expand Up @@ -266,11 +267,15 @@ _build/edoc/logo.png: edoc_compile
#' format / indent
#

.SILENT: format indent

FORMAT_LOG=/tmp/ejabberd-format.log

format:
tools/rebar3-format.sh $(REBAR3)
tools/rebar3-format.sh $(FORMAT_LOG) $(REBAR3)

indent:
tools/emacs-indent.sh
tools/emacs-indent.sh $(FORMAT_LOG) $(EMACS)

#.
#' copy-files
Expand Down Expand Up @@ -714,7 +719,7 @@ help:
@echo " translations Extract translation files"
@echo " TAGS Generate tags file for text editors"
@echo ""
@echo " format Format source code using rebar3_format"
@echo " format Format source code using efmt [rebar3]"
@echo " indent Indent source code using erlang-mode [emacs]"
@echo ""
@echo " dialyzer Run Dialyzer static analyzer"
Expand Down
2 changes: 1 addition & 1 deletion _checkouts/configure_deps/rebar.config
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{erl_opts, [debug_info]}.
{deps, []}.
{deps, []}.
5 changes: 2 additions & 3 deletions _checkouts/configure_deps/src/configure_deps.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{vsn, "0.0.1"},
{registered, []},
{applications, [kernel, stdlib]},
{env,[]},
{env, []},
{modules, []},
{links, []}
]}.
{links, []}]}.
1 change: 1 addition & 0 deletions _checkouts/configure_deps/src/configure_deps.erl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

-export([init/1]).


-spec init(rebar_state:t()) -> {ok, rebar_state:t()}.
init(State) ->
{ok, State1} = configure_deps_prv:init(State),
Expand Down
39 changes: 22 additions & 17 deletions _checkouts/configure_deps/src/configure_deps_prv.erl
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
-export([init/1, do/1, format_error/1]).

-define(PROVIDER, 'configure-deps').
-define(DEPS, [install_deps]).
-define(DEPS, [install_deps]).


%% ===================================================================
%% Public API
%% ===================================================================
-spec init(rebar_state:t()) -> {ok, rebar_state:t()}.
init(State) ->
Provider = providers:create([
{namespace, default},
{name, ?PROVIDER}, % The 'user friendly' name of the task
{module, ?MODULE}, % The module implementation of the task
{bare, true}, % The task can be run by the user, always true
{deps, ?DEPS}, % The list of dependencies
{example, "rebar3 configure-deps"}, % How to use the plugin
{opts, []}, % list of options understood by the plugin
{short_desc, "Explicitly run ./configure for dependencies"},
{desc, "A rebar plugin to allow explicitly running ./configure on dependencies. Useful if dependencies might change prior to compilation when configure is run."}
]),
Provider = providers:create(
[{namespace, default},
{name, ?PROVIDER}, % The 'user friendly' name of the task
{module, ?MODULE}, % The module implementation of the task
{bare, true}, % The task can be run by the user, always true
{deps, ?DEPS}, % The list of dependencies
{example, "rebar3 configure-deps"}, % How to use the plugin
{opts, []}, % list of options understood by the plugin
{short_desc, "Explicitly run ./configure for dependencies"},
{desc, "A rebar plugin to allow explicitly running ./configure on dependencies. Useful if dependencies might change prior to compilation when configure is run."}]),
{ok, rebar_state:add_provider(State, Provider)}.


Expand All @@ -30,25 +30,30 @@ do(State) ->
lists:foreach(fun do_app/1, Apps),
{ok, State}.


exec_configure({'configure-deps', Cmd}, Dir) ->
rebar_utils:sh(Cmd, [{cd, Dir}, {use_stdout, true}]);
rebar_utils:sh(Cmd, [{cd, Dir}, {use_stdout, true}]);
exec_configure(_, Acc) -> Acc.


parse_pre_hooks({pre_hooks, PreHooks}, Acc) ->
lists:foldl(fun exec_configure/2, Acc, PreHooks);
parse_pre_hooks(_, Acc) -> Acc.


parse_additions({add, App, Additions}, {MyApp, Dir}) when App == MyApp ->
lists:foldl(fun parse_pre_hooks/2, Dir, Additions),
{MyApp, Dir};
{MyApp, Dir};
parse_additions(_, Acc) -> Acc.


do_app(App) ->
Dir = rebar_app_info:dir(App),
Opts = rebar_app_info:opts(App),
Overrides = rebar_opts:get(Opts, overrides),
Opts = rebar_app_info:opts(App),
Overrides = rebar_opts:get(Opts, overrides),
lists:foldl(fun parse_additions/2, {binary_to_atom(rebar_app_info:name(App), utf8), Dir}, Overrides).

-spec format_error(any()) -> iolist().

-spec format_error(any()) -> iolist().
format_error(Reason) ->
io_lib:format("~p", [Reason]).
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ AC_PATH_PROG([ESCRIPT], [escript], [], [$ERLANG_ROOT_DIR/bin])
#locating make
AC_CHECK_PROG([MAKE], [make], [make], [])

AC_PATH_TOOL(EMACS, emacs, , [${extra_erl_path}$PATH])

if test "x$ESCRIPT" = "x"; then
AC_MSG_ERROR(['escript' was not found])
fi
Expand Down
126 changes: 74 additions & 52 deletions include/ELDAPv3.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -3,79 +3,101 @@
%% SEQUENCE and SET, and macro definitions for each value
%% definition,in module ELDAPv3

-record('LDAPMessage', {
messageID, protocolOp, controls = asn1_NOVALUE
}).

-record('AttributeValueAssertion', {
attributeDesc, assertionValue
}).

-record('LDAPMessage',{
messageID, protocolOp, controls = asn1_NOVALUE}).
-record('Attribute', {
type, vals
}).

-record('AttributeValueAssertion',{
attributeDesc, assertionValue}).
-record('LDAPResult', {
resultCode, matchedDN, errorMessage, referral = asn1_NOVALUE
}).

-record('Attribute',{
type, vals}).
-record('Control', {
controlType, criticality = asn1_DEFAULT, controlValue = asn1_NOVALUE
}).

-record('LDAPResult',{
resultCode, matchedDN, errorMessage, referral = asn1_NOVALUE}).
-record('BindRequest', {
version, name, authentication
}).

-record('Control',{
controlType, criticality = asn1_DEFAULT, controlValue = asn1_NOVALUE}).
-record('SaslCredentials', {
mechanism, credentials = asn1_NOVALUE
}).

-record('BindRequest',{
version, name, authentication}).
-record('BindResponse', {
resultCode, matchedDN, errorMessage, referral = asn1_NOVALUE, serverSaslCreds = asn1_NOVALUE
}).

-record('SaslCredentials',{
mechanism, credentials = asn1_NOVALUE}).
-record('SearchRequest', {
baseObject, scope, derefAliases, sizeLimit, timeLimit, typesOnly, filter, attributes
}).

-record('BindResponse',{
resultCode, matchedDN, errorMessage, referral = asn1_NOVALUE, serverSaslCreds = asn1_NOVALUE}).
-record('SubstringFilter', {
type, substrings
}).

-record('SearchRequest',{
baseObject, scope, derefAliases, sizeLimit, timeLimit, typesOnly, filter, attributes}).
-record('MatchingRuleAssertion', {
matchingRule = asn1_NOVALUE, type = asn1_NOVALUE, matchValue, dnAttributes = asn1_DEFAULT
}).

-record('SubstringFilter',{
type, substrings}).
-record('SearchResultEntry', {
objectName, attributes
}).

-record('MatchingRuleAssertion',{
matchingRule = asn1_NOVALUE, type = asn1_NOVALUE, matchValue, dnAttributes = asn1_DEFAULT}).
-record('PartialAttributeList_SEQOF', {
type, vals
}).

-record('SearchResultEntry',{
objectName, attributes}).
-record('ModifyRequest', {
object, modification
}).

-record('PartialAttributeList_SEQOF',{
type, vals}).
-record('ModifyRequest_modification_SEQOF', {
operation, modification
}).

-record('ModifyRequest',{
object, modification}).
-record('AttributeTypeAndValues', {
type, vals
}).

-record('ModifyRequest_modification_SEQOF',{
operation, modification}).
-record('AddRequest', {
entry, attributes
}).

-record('AttributeTypeAndValues',{
type, vals}).
-record('AttributeList_SEQOF', {
type, vals
}).

-record('AddRequest',{
entry, attributes}).
-record('ModifyDNRequest', {
entry, newrdn, deleteoldrdn, newSuperior = asn1_NOVALUE
}).

-record('AttributeList_SEQOF',{
type, vals}).
-record('CompareRequest', {
entry, ava
}).

-record('ModifyDNRequest',{
entry, newrdn, deleteoldrdn, newSuperior = asn1_NOVALUE}).
-record('ExtendedRequest', {
requestName, requestValue = asn1_NOVALUE
}).

-record('CompareRequest',{
entry, ava}).
-record('ExtendedResponse', {
resultCode, matchedDN, errorMessage, referral = asn1_NOVALUE, responseName = asn1_NOVALUE, response = asn1_NOVALUE
}).

-record('ExtendedRequest',{
requestName, requestValue = asn1_NOVALUE}).
-record('PasswdModifyRequestValue', {
userIdentity = asn1_NOVALUE, oldPasswd = asn1_NOVALUE, newPasswd = asn1_NOVALUE
}).

-record('ExtendedResponse',{
resultCode, matchedDN, errorMessage, referral = asn1_NOVALUE, responseName = asn1_NOVALUE, response = asn1_NOVALUE}).
-record('PasswdModifyResponseValue', {
genPasswd = asn1_NOVALUE
}).

-record('PasswdModifyRequestValue',{
userIdentity = asn1_NOVALUE, oldPasswd = asn1_NOVALUE, newPasswd = asn1_NOVALUE}).

-record('PasswdModifyResponseValue',{
genPasswd = asn1_NOVALUE}).

-define('maxInt', 2147483647).
-define('passwdModifyOID', [49,46,51,46,54,46,49,46,52,46,49,46,52,50,48,51,46,49,46,49,49,46,49]).
-define('maxInt', 2147483647).
-define('passwdModifyOID', [49, 46, 51, 46, 54, 46, 49, 46, 52, 46, 49, 46, 52, 50, 48, 51, 46, 49, 46, 49, 49, 46, 49]).
25 changes: 14 additions & 11 deletions include/bosh.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,36 @@
%%%----------------------------------------------------------------------

-define(CT_XML,
{<<"Content-Type">>, <<"text/xml; charset=utf-8">>}).
{<<"Content-Type">>, <<"text/xml; charset=utf-8">>}).

-define(CT_PLAIN,
{<<"Content-Type">>, <<"text/plain">>}).
{<<"Content-Type">>, <<"text/plain">>}).

-define(CT_JSON,
{<<"Content-Type">>, <<"application/json">>}).

-define(AC_ALLOW_ORIGIN,
{<<"Access-Control-Allow-Origin">>, <<"*">>}).
{<<"Access-Control-Allow-Origin">>, <<"*">>}).

-define(AC_ALLOW_METHODS,
{<<"Access-Control-Allow-Methods">>,
<<"GET, POST, OPTIONS">>}).
{<<"Access-Control-Allow-Methods">>,
<<"GET, POST, OPTIONS">>}).

-define(AC_ALLOW_HEADERS,
{<<"Access-Control-Allow-Headers">>,
<<"Content-Type">>}).
{<<"Access-Control-Allow-Headers">>,
<<"Content-Type">>}).

-define(AC_MAX_AGE,
{<<"Access-Control-Max-Age">>, <<"86400">>}).
{<<"Access-Control-Max-Age">>, <<"86400">>}).

-define(OPTIONS_HEADER,
[?CT_PLAIN, ?AC_ALLOW_ORIGIN, ?AC_ALLOW_METHODS,
?AC_ALLOW_HEADERS, ?AC_MAX_AGE]).
[?CT_PLAIN,
?AC_ALLOW_ORIGIN,
?AC_ALLOW_METHODS,
?AC_ALLOW_HEADERS,
?AC_MAX_AGE]).

-define(HEADER(CType),
[CType, ?AC_ALLOW_ORIGIN, ?AC_ALLOW_HEADERS]).
[CType, ?AC_ALLOW_ORIGIN, ?AC_ALLOW_HEADERS]).

-define(BOSH_CACHE, bosh_cache).
6 changes: 4 additions & 2 deletions include/ejabberd_auth.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@
%%%
%%%----------------------------------------------------------------------

-record(passwd, {us = {<<"">>, <<"">>} :: {binary(), binary()} | {binary(), binary(), atom()} | '$1',
password = <<"">> :: binary() | scram() | '_'}).
-record(passwd, {
us = {<<"">>, <<"">>} :: {binary(), binary()} | {binary(), binary(), atom()} | '$1',
password = <<"">> :: binary() | scram() | '_'
}).
3 changes: 2 additions & 1 deletion include/ejabberd_commands.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
%%%
%%%----------------------------------------------------------------------
%% @efmt:off
%% @indent-begin

-type aterm() :: {atom(), atype()}.
-type atype() :: integer | string | binary | any | atom |
Expand Down Expand Up @@ -104,4 +106,3 @@
args_example :: none | [any()] | '_',
result_example :: any()
}.

2 changes: 2 additions & 0 deletions include/ejabberd_http.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
%%%
%%%----------------------------------------------------------------------
%% @efmt:off
%% @indent-begin

-record(request,
{method :: method(),
Expand Down
2 changes: 2 additions & 0 deletions include/ejabberd_oauth.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
%%%
%%%----------------------------------------------------------------------
%% @efmt:off
%% @indent-begin

-record(oauth_token, {
token = <<"">> :: binary() | '_',
Expand Down
Loading
Loading