Gio.SettingsBackend.flatten_tree
Description: Reference for Gio.SettingsBackend.flatten_tree

### Function

# Gio SettingsBackendflatten_tree

since: 2.26

#### Declaration

    void
    g_settings_backend_flatten_tree (
      GTree* tree,
      gchar** path,
      const gchar*** keys,
      GVariant*** values
    )

#### Description

Calculate the longest common prefix of all keys in a tree and write out an array of the key names relative to that prefix and, optionally, the value to store at each of those keys.

You must free the value returned in `path`, `keys` and `values` using g_free(). You should not attempt to free or unref the contents of `keys` or `values`.

Available since: 2.26

#### Parameters

`tree`

  Type: `GTree`

  A `GTree` containing the changes.

  The data is owned by the caller of the function.

`path`

  Type: `gchar**`

  The location to save the path.

  The argument will be set by the function.
  The caller of the function takes ownership of the data, and is responsible for freeing it.
  The value is a NUL terminated UTF-8 string.

`keys`

  Type: An array of `gchar**`

  The location to save the relative keys.

  The argument will be set by the function.
  The array must be `NULL`-terminated.
  The caller of the function takes ownership of the data container, but not the data inside it.
  Each element is a NUL terminated UTF-8 string.

`values`

  Type: An array of `GVariant**`

           the location to save the values, or `NULL`.

  The argument will be set by the function.
  The argument can be `NULL`.
  The array must be `NULL`-terminated.
  The caller of the function takes ownership of the data container, but not the data inside it.