WockyDiscoIdentity

WockyDiscoIdentity — Structure holding XMPP disco identity information.

Functions

Types and Values

Object Hierarchy

    GBoxed
    ╰── WockyDiscoIdentity

Description

Contains information regarding the identity information in disco replies, as described in XEP-0030.

Functions

wocky_disco_identity_new ()

WockyDiscoIdentity *
wocky_disco_identity_new (const gchar *category,
                          const gchar *type,
                          const gchar *lang,
                          const gchar *name);

Parameters

category

disco category

 

type

disco type

 

lang

disco language

 

name

disco name

 

Returns

a new WockyDiscoIdentity which should be freed using wocky_disco_identity_free().


wocky_disco_identity_copy ()

WockyDiscoIdentity *
wocky_disco_identity_copy (const WockyDiscoIdentity *source);

Creates a new WockyDiscoIdentity structure with the data given by source . The copy also copies the internal data so source can be freed after this function is called.

Parameters

source

the WockyDiscoIdentity to copy

 

Returns

a new WockyDiscoIdentity which is a deep copy of source


wocky_disco_identity_free ()

void
wocky_disco_identity_free (WockyDiscoIdentity *identity);

Frees the memory used by identity .

Parameters

identity

a WockyDiscoIdentity

 

wocky_disco_identity_cmp ()

gint
wocky_disco_identity_cmp (WockyDiscoIdentity *left,
                          WockyDiscoIdentity *right);

Compares left and right . It returns an integer less than, equal to, or greater than zero if left is found, respectively, to be less than, to match, or be greater than right.

This function can be casted to a GCompareFunc to sort a list of WockyDiscoIdentity structures.

Parameters

left

a WockyDiscoIdentity

 

right

a WockyDiscoIdentity

 

Returns

the result of comparing left and right


wocky_disco_identity_array_new ()

GPtrArray *
wocky_disco_identity_array_new (void);

Creates a new array of WockyDiscoIdentity structures.

Returns

A newly instantiated array. wocky_disco_identity_array_free() should beq used to free the memory allocated by this array. See: wocky_disco_identity_array_free()


wocky_disco_identity_array_copy ()

GPtrArray *
wocky_disco_identity_array_copy (const GPtrArray *source);

Copies an array of WockyDiscoIdentity objects. The returned array contains new copies of the contents of the source array.

Parameters

source

The source array to be copied.

 

Returns

A newly instantiated array with new copies of the contents of the source array. See: wocky_disco_identity_array_new()


wocky_disco_identity_array_free ()

void
wocky_disco_identity_array_free (GPtrArray *arr);

Frees an array of WockyDiscoIdentity objects created with wocky_disco_identity_array_new() or returned by wocky_disco_identity_array_copy().

Note that if this method is called with an array created with g_ptr_array_new(), the caller should also free the array contents.

See: wocky_disco_identity_array_new(), wocky_disco_identity_array_copy()

Parameters

arr

Array to be freed.

 

Types and Values

struct WockyDiscoIdentity

struct WockyDiscoIdentity {
  gchar *category;
  gchar *type;
  gchar *lang;
  gchar *name;
};

A structure used to hold information regarding an identity from a disco reply as described in XEP-0030.

Members

gchar *category;

the identity category

 

gchar *type;

the identity type

 

gchar *lang;

the identity language

 

gchar *name;

the identity name