| Elektra 0.11.0

Functions
dbus.c File Reference

I/O Adapter for D-Bus. More...

`#include <kdbhelper.h>`
`#include <kdbio/adapters/dbus.h>`
`#include <kdblogger.h>`
`#include <stdlib.h>`
`#include <string.h>`

## Functions
ElektraIoAdapterDbusHandle * | elektraIoAdapterDbusAttach (DBusConnection *connection, ElektraIoInterface *ioBinding)
| Attach D-Bus connection to asynchronous I/O binding.
int | elektraIoAdapterDbusCleanup (ElektraIoAdapterDbusHandle *priv)
| Remove D-Bus connection from I/O binding.

## Detailed Description

I/O Adapter for D-Bus.

Copyright
  BSD License (see LICENSE.md or https://www.libelektra.org)

## Function Documentation

## ◆ elektraIoAdapterDbusAttach()

ElektraIoAdapterDbusHandle * elektraIoAdapterDbusAttach | ( | DBusConnection * | connection,
|  | ElektraIoInterface * | ioBinding
| ) |  |

Attach D-Bus connection to asynchronous I/O binding.

Messages are sent and received using the I/O binding

Parameters

  connection | D-Bus connection
  ioBinding | I/O binding

Returns
  handle to be used with elektraIoAdapterDbusCleanup() or NULL on error

## ◆ elektraIoAdapterDbusCleanup()

int elektraIoAdapterDbusCleanup | ( | ElektraIoAdapterDbusHandle * | handle | ) |

Remove D-Bus connection from I/O binding.

This function frees the passed handle.

Currently it is NOT possible to revert all changes made to a connection by elektraIoAdapterDbusAttach(). It is advisable to call dbus_connection_unref() or dbus_connection_close() in case of a private bus connection afterwards.

Parameters

  handle | adapter handle

Return values

  1 | on success
  0 | on error