Type Alias (GI Alias)

GLib-2.0GLibQuark

Quark: number

A GQuark is a non-zero integer which uniquely identifies a particular string.

A GQuark value of zero is associated to NULL.

Given either the string or the GLib.Quark identifier it is possible to retrieve the other.

Quarks are used for both datasets and keyed data lists.

To create a new quark from a string, use GLib.quark_from_string or GLib.quark_from_static_string.

To find the string corresponding to a given GLib.Quark, use GLib.quark_to_string.

To find the GLib.Quark corresponding to a given string, use GLib.quark_try_string.

Another use for the string pool maintained for the quark functions is string interning, using GLib.intern_string or GLib.intern_static_string. An interned string is a canonical representation for a string. One important advantage of interned strings is that they can be compared for equality by a simple pointer comparison, rather than using strcmp().