| Elektra 0.11.0

Typedefs | Functions
kdbnotification.h File Reference
Notification

Elektra-Notification structures and declarations for application developers. More...

`#include "kdb.h"`
`#include "kdbtypes.h"`

## Typedefs
typedef void(* | ElektraNotificationConversionErrorCallback) (Key *key, void *context)
| Callback function called when string to number conversion failed.
typedef void(* | ElektraNotificationChangeCallback) (Key *key, void *context)
| Callback function for key changes.

## Functions
int | elektraNotificationContract (KeySet *contract)
| Creates a contract for use with kdbOpen() that sets up notifications.
int | elektraNotificationRegisterCallback (KDB *kdb, Key *key, ElektraNotificationChangeCallback callback, void *context)
| Subscribe for updates via callback when a given key value is changed.
int | elektraNotificationRegisterCallbackSameOrBelow (KDB *kdb, Key *key, ElektraNotificationChangeCallback callback, void *context)
| Subscribe for updates via callback when a given key or a key below changed.

## Detailed Description

Elektra-Notification structures and declarations for application developers.

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

## Function Documentation

## ◆ elektraNotificationContract()

int elektraNotificationContract | ( | KeySet * | contract | ) |

Creates a contract for use with kdbOpen() that sets up notifications.

When you call kdbOpen() with this contract, the `internalnotification` plugin will be mounted automatically. This allows you to call other `elektraNotification*` functions.

If you need to configure notification transport plugins, you should manually add the relevant keys to `contract`.

Parameters

  contract | The keyset into which the contract is written.

Return values

  -1 | if `contract` is NULL
  0 | on success