Function

GLibdatalist_id_set_data_full

Declaration

void
g_datalist_id_set_data_full (
  GData** datalist,
  GQuark key_id,
  gpointer data,
  GDestroyNotify destroy_func
)

Description

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.

Parameters

datalist GData
 

A datalist.

 The data is owned by the caller of the function.
key_id GQuark
 

The GQuark to identify the data element.

data gpointer
 

The data element or NULL to remove any previous element corresponding to key_id.

destroy_func GDestroyNotify
 

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.