| Top |
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.
gchar *
wocky_normalise_jid (const gchar *jid);
a normalised JID, using the same rules as wocky_decode_jid(),
or NULL if the JID could not be sensibly decoded.
This value should be freed when you are done with it.
gboolean wocky_decode_jid (const gchar *jid,gchar **node,gchar **domain,gchar **resource);
If jid
is valid, returns TRUE and sets the caller's node
, domain
and
resource
pointers. node
and resource
will be set to NULL if the
respective part is not present in jid
. If jid
is invalid, sets node
,
domain
and resource
to NULL and returns FALSE.
In theory, the returned parts will be normalised as specified in RFC 6122 (XMPP Address Format); in practice, Wocky does not fully implement the normalisation and validation algorithms. FIXME: Do nodeprep/resourceprep and length checking.
gchar * wocky_compose_jid (const gchar *node,const gchar *domain,const gchar *resource);
Composes a JID from its parts. If node
is empty or NULL, the '@'
separator is also omitted; if resource
is empty or NULL, the '/' separator
is also omitted. node
and domain
are assumed to have already been
normalised.
GValue *
wocky_g_value_slice_new (GType type);
Slice-allocate an empty GValue. wocky_g_value_slice_new_boolean() and similar
functions are likely to be more convenient to use for the types supported.
a newly allocated, newly initialized GValue, to be freed with
wocky_g_value_slice_free() or g_slice_free().
Since 0.5.14
GValue *
wocky_g_value_slice_new_boolean (gboolean b);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type G_TYPE_BOOLEAN with value b
, to be freed with
wocky_g_value_slice_free() or g_slice_free()
Since 0.7.27
GValue *
wocky_g_value_slice_new_int (gint n);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type G_TYPE_INT with value n
, to be freed with
wocky_g_value_slice_free() or g_slice_free()
Since 0.7.27
GValue *
wocky_g_value_slice_new_int64 (gint64 n);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type G_TYPE_INT64 with value n
, to be freed with
wocky_g_value_slice_free() or g_slice_free()
Since 0.7.27
GValue *
wocky_g_value_slice_new_uint (guint n);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type G_TYPE_UINT with value n
, to be freed with
wocky_g_value_slice_free() or g_slice_free()
Since 0.7.27
GValue *
wocky_g_value_slice_new_uint64 (guint64 n);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type G_TYPE_UINT64 with value n
, to be freed with
wocky_g_value_slice_free() or g_slice_free()
Since 0.7.27
GValue *
wocky_g_value_slice_new_double (double d);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type G_TYPE_DOUBLE with value n
, to be freed with
wocky_g_value_slice_free() or g_slice_free()
Since 0.7.27
GValue *
wocky_g_value_slice_new_string (const gchar *string);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type G_TYPE_STRING whose value is a copy of string
,
to be freed with wocky_g_value_slice_free() or g_slice_free()
Since 0.7.27
GValue *
wocky_g_value_slice_new_static_string (const gchar *string);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type G_TYPE_STRING whose value is string
,
to be freed with wocky_g_value_slice_free() or g_slice_free()
Since 0.7.27
GValue *
wocky_g_value_slice_new_take_string (gchar *string);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type G_TYPE_STRING whose value is string
,
to be freed with wocky_g_value_slice_free() or g_slice_free()
Since 0.7.27
GValue * wocky_g_value_slice_new_boxed (GType type,gconstpointer p);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type type
whose value is a copy of p
,
to be freed with wocky_g_value_slice_free() or g_slice_free()
Since 0.7.27
GValue * wocky_g_value_slice_new_static_boxed (GType type,gconstpointer p);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
a GValue of type type
whose value is p
,
to be freed with wocky_g_value_slice_free() or g_slice_free()
Since 0.7.27
GValue * wocky_g_value_slice_new_take_boxed (GType type,gpointer p);
Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.
type |
a boxed type |
|
p |
a pointer of type |
a GValue of type type
whose value is p
,
to be freed with wocky_g_value_slice_free() or g_slice_free()
Since 0.7.27
void
wocky_g_value_slice_free (GValue *value);
Unset and free a slice-allocated GValue.
(GDestroyNotify) wocky_g_value_slice_free can be used
as a destructor for values in a GHashTable, for example.
GValue *
wocky_g_value_slice_dup (const GValue *value);
a newly allocated copy of value
, to be freed with
wocky_g_value_slice_free() or g_slice_free().
Since 0.5.14
gboolean wocky_enum_from_nick (GType enum_type,const gchar *nick,gint *value);
enum_type |
the GType of a subtype of GEnum |
|
nick |
a non- |
|
value |
the address at which to store the value of |
gchar *
wocky_absolutize_path (const gchar *path);
Return an absolute form of path
. This cleans up duplicate slashes, "." or
".." path segments, etc., and prepends g_get_current_dir() if necessary, but
does not necessarily resolve symlinks.
#define wocky_implement_finish_copy_pointer(source, tag, copy_func, \
out_param)
#define wocky_implement_finish_return_copy_pointer(source, tag, \
copy_func)