wocky-utils

wocky-utils

Synopsis

gboolean            wocky_strdiff                       (const gchar *left,
                                                         const gchar *right);
gboolean            wocky_decode_jid                    (const gchar *jid,
                                                         gchar **node,
                                                         gchar **domain,
                                                         gchar **resource);

Description

Details

wocky_strdiff ()

gboolean            wocky_strdiff                       (const gchar *left,
                                                         const gchar *right);

Return TRUE if the given strings are different. Unlike strcmp this function will handle null pointers, treating them as distinct from any string.

left :

The first string to compare (may be NULL)

right :

The second string to compare (may be NULL)

Returns :

FALSE if left and right are both NULL, or if neither is NULL and both have the same contents; TRUE otherwise

wocky_decode_jid ()

gboolean            wocky_decode_jid                    (const gchar *jid,
                                                         gchar **node,
                                                         gchar **domain,
                                                         gchar **resource);

If the JID is valid, returns TRUE and sets the caller's node/domain/resource pointers if they are not NULL. The node and resource pointers will be set to NULL if the respective part is not present in the JID. The node and domain are lower-cased because the Jabber protocol treats them case-insensitively.

XXX: Do nodeprep/resourceprep and length checking.

See RFC 3920 §3.

jid :

a JID

node :

address to which return the username/room part of the JID

domain :

address to which return the server/service part of the JID

resource :

address to which return the resource/nick part of the JID

Returns :