Produits Support Open Source Company
 
 
 
Home > Wiki > jlib

Article - Talk jlib

Return the list of ejabberd core modules

Utilities (jlib)

Various helper functions. Modules should include the jlib.hrl file in order to use the records defined by this module.

API

JID handling

-record(jid{userserverresourceluserlserverlresource}). 

Define a JID. The fields beginning with ‘l’ are the normalized lowercase versions of the three first ones.
make_jid(UserServerRessource) -> #jid
make_jid({UserServerRessource}) -> #jid
string_to_jid(JID) -> #jid
jid_to_string(#jid) -> JID
JID Username Server Resource string() 

Create a #jid from string and vice versa.

IQ handling

-record(iq{id ""typexmlns ""lang ""sub_el}).
type get set
sub_el {xmlelementNameAttrsSubEl}
Attrs [{NameValue}]
Name Value string()
SubEl Packet 

Define an IQ.
iq_query_info(Packet) -> #iq
iq_to_xml(#iq) -> Packet
Packet {xmlelementNameAttrsSubEl}
Attrs [{NameValue}]
Name Value string()
SubEl Packet 

Create an IQ from a Packet and vice versa.

XMPP errors

make_error_reply(PacketError) -> ErrorPacket
Packet ErrorPacket {xmlelementNameAttrsSubEl}
Error = ?STANZA_ERROR/

Return a XMPP error packet. Packet is the XMPP packet initially received. Error is one of the ERR_\* macros defined in jlib.hrl

Miscanelleous

tolower(string()) -> string() 
 
 
 
Valid HTML 4.01!   Valid CSS!