GLib.datalist_foreach
Description: Reference for GLib.datalist_foreach

### Function

# GLibdatalist_foreach

#### Declaration [src]

    void
    g_datalist_foreach (
      GData** datalist,
      GDataForeachFunc func,
      gpointer user_data
    )

#### Description [src]

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. Note that this function is NOT thread-safe. So unless `datalist` can be protected from any modifications during invocation of this function, it should not be called.

`func` can make changes to `datalist`, but the iteration will not reflect changes made during the `g_datalist_foreach()` call, other than skipping over elements that are removed.

#### Parameters

`datalist`

  Type: `GData`

  A datalist.

  The data is owned by the caller of the function.

`func`

  Type: `GDataForeachFunc`

  The function to call for each data element.

`user_data`

  Type: `gpointer`

  User data to pass to the function.

  The argument can be `NULL`.
  The data is owned by the caller of the function.