aboutsummaryrefslogtreecommitdiff
path: root/src/ejabberd_commands.hrl
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2013-03-14 10:33:02 +0100
committerBadlop <badlop@process-one.net>2013-03-14 10:33:02 +0100
commit9deb294328bb3f9eb6bd2c0e7cd500732e9b5830 (patch)
tree7e1066c130250627ee0abab44a135f583a28d07f /src/ejabberd_commands.hrl
parentlist_to_integer/2 only works in OTP R14 and newer (diff)
Accumulated patch to binarize and indent code
Diffstat (limited to '')
-rw-r--r--src/ejabberd_commands.hrl31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/ejabberd_commands.hrl b/src/ejabberd_commands.hrl
index 1ababc8be..116bb7357 100644
--- a/src/ejabberd_commands.hrl
+++ b/src/ejabberd_commands.hrl
@@ -19,10 +19,32 @@
%%%
%%%----------------------------------------------------------------------
--record(ejabberd_commands, {name, tags = [],
- desc = "", longdesc = "",
- module, function,
- args = [], result = rescode}).
+-type aterm() :: {atom(), atype()}.
+-type atype() :: integer | string | binary |
+ {tuple, [aterm()]} | {list, aterm()}.
+-type rterm() :: {atom(), rtype()}.
+-type rtype() :: integer | string | atom |
+ {tuple, [rterm()]} | {list, rterm()} |
+ rescode | restuple.
+
+-record(ejabberd_commands,
+ {name :: atom(),
+ tags = [] :: [atom()] | '_' | '$2',
+ desc = "" :: string() | '_' | '$3',
+ longdesc = "" :: string() | '_',
+ module :: atom(),
+ function :: atom(),
+ args = [] :: [aterm()] | '_' | '$1' | '$2',
+ result = {res, rescode} :: rterm() | '_' | '$2'}).
+
+-type ejabberd_commands() :: #ejabberd_commands{name :: atom(),
+ tags :: [atom()],
+ desc :: string(),
+ longdesc :: string(),
+ module :: atom(),
+ function :: atom(),
+ args :: [aterm()],
+ result :: rterm()}.
%% @type ejabberd_commands() = #ejabberd_commands{
%% name = atom(),
@@ -50,3 +72,4 @@
%% @type rterm() = {Name::atom(), Type::rtype()}.
%% A result term is a tuple with the term name and the term type.
+