tp_verify_true()

#define tp_verify_true(R)

Make an assertion at compile time, like C++0x's proposed static_assert
keyword. If R is determined to be true, there is no overhead at runtime,
and the macro evaluates to 1 as an integer constant expression;
if R is determined to be false, compilation will fail.

This macro can be used anywhere that an integer constant expression would
be allowed.

tp_strdiff ()

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

tp_mixin_offset_cast ()

gpointer tp_mixin_offset_cast (gpointer instance,
guint offset);

Extend a pointer by an offset, provided the offset is not 0.
This is used to cast from an object instance to one of the telepathy-glib
mixin classes.

instance :

A pointer to a structure

offset :

The offset of a structure member in bytes, which must not be 0

Returns :

a pointer offset bytes beyond instance

tp_mixin_class_get_offset ()

guint tp_mixin_class_get_offset (gpointer klass,
GQuark quark);

If the type of klass, or any of its ancestor types, has had an offset
attached using qdata with the given quark, return that offset. If not,
this indicates a programming error and results are undefined.

This is used to implement the telepathy-glib mixin classes.

klass :

A pointer to a GObjectClass-derived class structure

quark :

A quark that was used to store the offset with g_type_set_qdata()

Returns :

the offset of the mixin class

tp_mixin_instance_get_offset ()

guint tp_mixin_instance_get_offset (gpointer instance,
GQuark quark);

If the type of instance, or any of its ancestor types, has had an offset
attached using qdata with the given quark, return that offset. If not,
this indicates a programming error and results are undefined.

This is used to implement the telepathy-glib mixin classes.

instance :

A pointer to a GObject-derived instance structure

quark :

A quark that was used to store the offset with g_type_set_qdata()

Returns :

the offset of the mixin

tp_escape_as_identifier ()

gchar* tp_escape_as_identifier (const gchar *name);

Escape an arbitrary string so it follows the rules for a C identifier,
and hence an object path component, interface element component,
bus name component or member name in D-Bus.

Unlike g_strcanon this is a reversible encoding, so it preserves
distinctness.

The escaping consists of replacing all non-alphanumerics, and the first
character if it's a digit, with an underscore and two lower-case hex
digits:

"0123abc_xyz\x01\xff" -> _30123abc_5fxyz_01_ff

i.e. similar to URI encoding, but with _ taking the role of %, and a
smaller allowed set. As a special case, "" is escaped to "_" (just for
completeness, really).