ngfd-plugin: /build/ngfd/src/ngfd-1.4.1/src/include/ngf/core-dbus.h File Reference

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

  core | NCore structure
  cb | Callback called when signal witht the specified parameters is seen
  userdata | Data passed to callback
  type | Whether to use system or session bus
  iface | DBus interface
  path | DBus path
  member | DBus 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

  core | NCore structure
  cb | Callback called when pending call reply is received
  userdata | Data passed to callback
  type | Whether to use system or session bus
  destination | DBus destination
  iface | DBus interface
  path | DBus path
  method | DBus 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

  core | NCore structure
  cb | Callback called when pending call reply is received
  userdata | Data passed to callback
  type | Whether to use system or session bus
  msg | DBus 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

  core | NCore structure
  cb | Callback 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

  core | NCore structure
  match_id | Id for the match to remove