Keyed Data Lists lists of data elements which are accessible by a string or #GQuark identifier. Keyed data lists provide lists of arbitrary data elements which can be accessed either with a string or with a #GQuark corresponding to the string. The #GQuark methods are quicker, since the strings have to be converted to #GQuarks anyway. Data lists are used for associating arbitrary data with #GObjects, using g_object_set_data() and related functions. To create a datalist, use g_datalist_init(). To add data elements to a datalist use g_datalist_id_set_data(), g_datalist_id_set_data_full(), g_datalist_set_data() and g_datalist_set_data_full(). To get data elements from a datalist use g_datalist_id_get_data() and g_datalist_get_data(). To iterate over all data elements in a datalist use g_datalist_foreach(). To remove data elements from a datalist use g_datalist_id_remove_data() and g_datalist_remove_data(). To remove all data elements from a datalist, use g_datalist_clear(). The #GData struct is an opaque data structure to represent a Keyed Data List. It should only be accessed via the following functions. Resets the datalist to %NULL. It does not free any memory or call any destroy functions. @datalist: a pointer to a pointer to a datalist. Sets the data corresponding to the given #GQuark id. Any previous data with the same key is removed, and its destroy function is called. @dl: a datalist. @q: the #GQuark to identify the data element. @d: the data element, or %NULL to remove any previous element corresponding to @q. Sets the data corresponding to the given #GQuark id, and the function to be called when the element is removed from the datalist. Any previous data with the same key is removed, and its destroy function is called. @datalist: a datalist. @key_id: the #GQuark to identify the data element. @data: the data element or %NULL to remove any previous element corresponding to @key_id. @destroy_func: the function to call when the data element is removed. This function will be called with the data element and can be used to free any memory allocated for it. If @data is %NULL, then @destroy_func must also be %NULL. Retrieves the data element corresponding to @key_id. @datalist: a datalist. @key_id: the #GQuark identifying a data element. @Returns: the data element, or %NULL if it is not found. Removes an element, using its #GQuark identifier. @dl: a datalist. @q: the #GQuark identifying the data element. Removes an element, without calling its destroy notification function. @datalist: a datalist. @key_id: the #GQuark identifying a data element. @Returns: the data previously stored at @key_id, or %NULL if none. Sets the data element corresponding to the given string identifier. @dl: a datalist. @k: the string to identify the data element. @d: the data element, or %NULL to remove any previous element corresponding to @k. Sets the data element corresponding to the given string identifier, and the function to be called when the data element is removed. @dl: a datalist. @k: the string to identify the data element. @d: the data element, or %NULL to remove any previous element corresponding to @k. @f: the function to call when the data element is removed. This function will be called with the data element and can be used to free any memory allocated for it. If @d is %NULL, then @f must also be %NULL. Gets a data element, using its string identifer. This is slower than g_datalist_id_get_data() because the string is first converted to a #GQuark. @dl: a datalist. @k: the string identifying a data element. @Returns: the data element, or %NULL if it is not found. Removes an element using its string identifier. The data element's destroy function is called if it has been set. @dl: a datalist. @k: the string identifying the data element. Removes an element, without calling its destroy notifier. @dl: a datalist. @k: the string identifying the data element. Calls the given function for each data element of the datalist. The function is called with each data element's #GQuark id and data, together with the given @user_data parameter. @datalist: a datalist. @func: the function to call for each data element. @user_data: user data to pass to the function. Frees all the data elements of the datalist. The data elements' destroy functions are called if they have been set. @datalist: a datalist.