aboutsummaryrefslogtreecommitdiff
path: root/src/ejabberd_commands.hrl
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2008-10-12 11:53:25 +0000
committerBadlop <badlop@process-one.net>2008-10-12 11:53:25 +0000
commitdda582db13bf9245edcddc1e3c2e1bd0bf6c8b67 (patch)
treeebef3a09c4206ad96f2221256c9a767e003ca67d /src/ejabberd_commands.hrl
parent* src/mod_proxy65/mod_proxy65.erl: Update so the listener starts (diff)
* src/ejabberd_commands.erl: New 'ejabberd commands': separate
command definition and calling interface (EJAB-694) * src/ejabberd_commands.hrl: Likewise SVN Revision: 1633
Diffstat (limited to 'src/ejabberd_commands.hrl')
-rw-r--r--src/ejabberd_commands.hrl52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/ejabberd_commands.hrl b/src/ejabberd_commands.hrl
new file mode 100644
index 000000000..ce7aadb9b
--- /dev/null
+++ b/src/ejabberd_commands.hrl
@@ -0,0 +1,52 @@
+%%%----------------------------------------------------------------------
+%%%
+%%% ejabberd, Copyright (C) 2002-2008 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., 59 Temple Place, Suite 330, Boston, MA
+%%% 02111-1307 USA
+%%%
+%%%----------------------------------------------------------------------
+
+-record(ejabberd_commands, {name, tags = [],
+ desc = "", longdesc = "",
+ module, function,
+ args = [], result = rescode}).
+
+%% @type ejabberd_commands() = #ejabberd_commands{
+%% name = atom(),
+%% tags = [atom()],
+%% desc = string(),
+%% longdesc = string(),
+%% module = atom(),
+%% function = atom(),
+%% args = [aterm()],
+%% result = rterm()
+%% }.
+%% desc: Description of the command
+%% args: Describe the accepted arguments.
+%% This way the function that calls the command can format the
+%% arguments before calling.
+
+%% @type atype() = integer | string | {tuple, [aterm()]} | {list, aterm()}.
+%% Allowed types for arguments are integer, string, tuple and list.
+
+%% @type rtype() = integer | string | atom | {tuple, [rterm()]} | {list, rterm()} | rescode | restuple.
+%% A rtype is either an atom or a tuple with two elements.
+
+%% @type aterm() = {Name::atom(), Type::atype()}.
+%% An argument term is a tuple with the term name and the term type.
+
+%% @type rterm() = {Name::atom(), Type::rtype()}.
+%% A result term is a tuple with the term name and the term type.