ngfd-plugin
Typedefs | Functions
core-dbus.h File Reference
#include <ngf/core.h>
#include <dbus/dbus.h>

Go to the source code of this file.

Typedefs

typedef DBusHandlerResult(* NDBusFilterFunc) (NCore *core, DBusConnection *connection, DBusMessage *msg, void *userdata)
 
typedef void(* NDBusReplyFunc) (NCore *core, DBusMessage *msg, void *userdata)
 

Functions

guint n_dbus_add_match (NCore *core, NDBusFilterFunc cb, void *userdata, DBusBusType type, const char *iface, const char *path, const char *member)
 Start listening for DBus signal.
 
void n_dbus_remove_match_by_id (NCore *core, guint match_id)
 Remove DBus signal listening.
 
void n_dbus_remove_match_by_cb (NCore *core, NDBusFilterFunc cb)
 Remove DBus signal listening.
 
gboolean n_dbus_async_call (NCore *core, NDBusReplyFunc cb, void *userdata, DBusBusType type, const char *destination, const char *path, const char *iface, const char *method)
 Make an asynchronous DBus call.
 
gboolean n_dbus_async_call_full (NCore *core, NDBusReplyFunc cb, void *userdata, DBusBusType type, DBusMessage *msg)
 Make an asynchronous DBus call.
 

Typedef Documentation

◆ NDBusFilterFunc

typedef DBusHandlerResult(* NDBusFilterFunc) (NCore *core, DBusConnection *connection, DBusMessage *msg, void *userdata)

◆ NDBusReplyFunc

typedef void(* NDBusReplyFunc) (NCore *core, DBusMessage *msg, void *userdata)

Function Documentation

◆ n_dbus_add_match()

guint n_dbus_add_match ( NCore core,
NDBusFilterFunc  cb,
void *  userdata,
DBusBusType  type,
const char *  iface,
const char *  path,
const char *  member 
)

Start listening for DBus signal.

Parameters
coreNCore structure
cbCallback called when signal witht the specified parameters is seen
userdataData passed to callback
typeWhether to use system or session bus
ifaceDBus interface
pathDBus path
memberDBus signal member
Returns
Zero on failure, otherwise identifier for match which can be used with n_dbus_remove_match_by_id()

◆ n_dbus_async_call()

gboolean n_dbus_async_call ( NCore core,
NDBusReplyFunc  cb,
void *  userdata,
DBusBusType  type,
const char *  destination,
const char *  path,
const char *  iface,
const char *  method 
)

Make an asynchronous DBus call.

If callback is defined pending call is set up and the callback is called with the pending call reply contents. Message part of pending call reply is passed to the NDBusFilterFunc callback.

Parameters
coreNCore structure
cbCallback called when pending call reply is received
userdataData passed to callback
typeWhether to use system or session bus
destinationDBus destination
ifaceDBus interface
pathDBus path
methodDBus method
Returns
TRUE if sending the message succeeded.

◆ n_dbus_async_call_full()

gboolean n_dbus_async_call_full ( NCore core,
NDBusReplyFunc  cb,
void *  userdata,
DBusBusType  type,
DBusMessage *  msg 
)

Make an asynchronous DBus call.

If callback is defined pending call is set up and the callback is called with the pending call reply contents. Message part of pending call reply is passed to the NDBusFilterFunc callback.

Parameters
coreNCore structure
cbCallback called when pending call reply is received
userdataData passed to callback
typeWhether to use system or session bus
msgDBus message to send
Returns
TRUE if sending the message succeeded.

◆ n_dbus_remove_match_by_cb()

void n_dbus_remove_match_by_cb ( NCore core,
NDBusFilterFunc  cb 
)

Remove DBus signal listening.

Parameters
coreNCore structure
cbCallback function used to add the match

◆ n_dbus_remove_match_by_id()

void n_dbus_remove_match_by_id ( NCore core,
guint  match_id 
)

Remove DBus signal listening.

Parameters
coreNCore structure
match_idId for the match to remove