Gio.bus_own_name_with_closures
Description: Reference for Gio.bus_own_name_with_closures

### Function

# Giobus_own_name_with_closures

since: 2.26

#### Declaration

    guint
    g_bus_own_name_with_closures (
      GBusType bus_type,
      const gchar* name,
      GBusNameOwnerFlags flags,
      GClosure* bus_acquired_closure,
      GClosure* name_acquired_closure,
      GClosure* name_lost_closure
    )

#### Description

Version of `g_bus_own_name()` using closures instead of callbacks for easier binding in other languages.

Available since: 2.26

This method is renamed to `g_bus_own_name()` in language bindings

#### Parameters

`bus_type`

  Type: `GBusType`

  The type of bus to own a name on.

`name`

  Type: `const gchar*`

  The well-known name to own.

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`flags`

  Type: `GBusNameOwnerFlags`

  A set of flags from the `GBusNameOwnerFlags` enumeration.

`bus_acquired_closure`

  Type: `GClosure`

  `GClosure` to invoke when connected to the bus of type `bus_type` or `NULL`.

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

`name_acquired_closure`

  Type: `GClosure`

  `GClosure` to invoke when `name` is acquired or `NULL`.

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

`name_lost_closure`

  Type: `GClosure`

  `GClosure` to invoke when `name` is lost or `NULL`.

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

#### Return value

Type: `guint`

An identifier (never 0) that can be used with `g_bus_unown_name()` to stop owning the name.