$darkmode
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>
Include dependency graph for dbus.c:

Functions

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

Detailed Description

I/O Adapter for D-Bus.

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
connectionD-Bus connection
ioBindingI/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
handleadapter handle
Return values
1on success
0on error