Elektra: kdbnotificationinternal.h File Reference

Elektra 0.8.24

Typedefs
kdbnotificationinternal.h File Reference
Notification

Elektra-Notification structures and declarations for developing notification and transport plugins. More...

`#include "kdb.h"`
`#include "kdbnotification.h"`
`#include "kdbplugin.h"`

## Typedefs
typedef int(* | ElektraNotificationPluginRegisterCallback) (Plugin *handle, Key *key, ElektraNotificationChangeCallback callback, void *context)
| Subscribe for updates via callback when a given key value is changed. More...
typedef int(* | ElektraNotificationPluginRegisterCallbackSameOrBelow) (Plugin *handle, Key *key, ElektraNotificationChangeCallback callback, void *context)
| Subscribe for updates via callback when a given key or a key below is changed. More...
typedef void(* | ElektraNotificationSetConversionErrorCallback) (Plugin *handle, ElektraNotificationConversionErrorCallback callback, void *context)
| Allow setting a callback that is called when a value conversion failed. More...
typedef struct _ElektraNotificationCallbackContext | ElektraNotificationCallbackContext
| Context for notification callbacks.
typedef void(* | ElektraNotificationCallback) (Key *key, ElektraNotificationCallbackContext *context)
| Notify notification library of changes to a key. More...
typedef void(* | ElektraNotificationOpenNotification) (Plugin *handle, KeySet *parameters)
| Initialize plugin's notification capabilities. More...
typedef void(* | ElektraNotificationCloseNotification) (Plugin *handle, KeySet *parameters)
| Teardown plugin's notification capabilities. More...
typedef void(* | ElektraNotificationKdbUpdate) (KDB *kdb, Key *changedKey)
| Used by notification plugins to get values from the key database. More...

## Detailed Description

Elektra-Notification structures and declarations for developing notification and transport plugins.

Only available in Elektra's source.

Only used by elektra-notification library, notification plugins (e.g. internalnotification) and transport plugins.

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

## Typedef Documentation

## ◆ ElektraNotificationCallback

typedef void(* ElektraNotificationCallback) (Key *key, ElektraNotificationCallbackContext *context)

Notify notification library of changes to a key.

This callback is passed by `elektraNotificationOpen` to plugins exporting a `openNotification` function.

Parameters

  key | changed key
  context | context passed by ElektraNotificationOpenNotification

## ◆ ElektraNotificationCloseNotification

typedef void(* ElektraNotificationCloseNotification) (Plugin *handle, KeySet *parameters)

Teardown plugin's notification capabilities.

Exported as "closeNotification" by transport plugins.

Parameters

  handle | plugin handle
  parameters | unused

## ◆ ElektraNotificationKdbUpdate

typedef void(* ElektraNotificationKdbUpdate) (KDB *kdb, Key *changedKey)

Used by notification plugins to get values from the key database.

Parameters

  kdb | kdb handle
  changedKey | which key was updated

## ◆ ElektraNotificationOpenNotification

typedef void(* ElektraNotificationOpenNotification) (Plugin *handle, KeySet *parameters)

Initialize plugin's notification capabilities.

Exported as "openNotification" by transport plugins.

Parameters

  handle | plugin handle
  parameters | contains the keys "/callback" (ElektraNotificationCallback) and "/context" (ElektraNotificationCallbackContext *).

## ◆ ElektraNotificationPluginRegisterCallback

typedef int(* ElektraNotificationPluginRegisterCallback) (Plugin *handle, Key *key, ElektraNotificationChangeCallback callback, void *context)

Subscribe for updates via callback when a given key value is changed.

Exported as "registerCallback" by notification plugins.

Parameters

  handle | plugin handle
  key | key to watch for changes
  callback | callback function
  context | user supplied context passed to callback function

Return values

  1 | on success
  0 | on failure

## ◆ ElektraNotificationPluginRegisterCallbackSameOrBelow

typedef int(* ElektraNotificationPluginRegisterCallbackSameOrBelow) (Plugin *handle, Key *key, ElektraNotificationChangeCallback callback, void *context)

Subscribe for updates via callback when a given key or a key below is changed.

Exported as "registerCallbackSameOrBelow" by notification plugins.

Parameters

  handle | plugin handle
  key | key to watch for changes
  callback | callback function
  context | user supplied context passed to callback function

Return values

  1 | on success
  0 | on failure

## ◆ ElektraNotificationSetConversionErrorCallback

typedef void(* ElektraNotificationSetConversionErrorCallback) (Plugin *handle, ElektraNotificationConversionErrorCallback callback, void *context)

Allow setting a callback that is called when a value conversion failed.

Exported as "setConversionErrorCallback" notification plugins.

Parameters

  kdb | kdb handle
  callback | callback
  context | context