Article - Talk gen mod
Return the list of ejabberd core modules
Modules utilities (gen_mod)
gen_mod provide the “gen_mod” behavior.
It also provide some utility functions useful in a module.
API
get_opt/2 and get_opt/3
get_opt(Opt, Opts) -> Value
get_opt(Opt, Opts, Default) -> Value
get_module_opt(Host, Module, Opt, Default) -> Value
Opts = [{Opt, Value}]
Opt = Default = Value = Host = string()
Return the value associated to Opt. Opts is the list passed as the second parameter of the start/2 of the module. If the Opt option is not set in the configuration file, Default is used instead.
get_hosts/2
get_hosts(Opts, Prefix) ->
Prefix = string()
Opts = [{Opt, Value}]
Returns the XMPP name of the module as set by the host or hosts configuration option. If not set, the name of the module is constructed by appending Prefix to the virtual host name.
get_module_proc/2
get_module_proc(Host, Base) -> Procname
Host = string()
Base = Procname = atom()
Host is the name of the virtual host. Base is a unique name corresponding to the module (?MODULE can be used).
Return the name of the thread associated to the module by appending Base to Host. Use this function to register the name of the thread with register/2.
loaded_modules/1 and loaded_modules_with_opts/1
loaded_modules(Host) -> [Module]
loaded_modules_with_opts(Host) -> [{Module, Opts}]
Host = string()
Opts = [{Opt, Value}]
loaded_modules/1 returns the list of loaded modules. loaded_modules_with_opts/1 returns the list of loaded modules with their options.
