Elektra  0.8.22
Typedefs | Functions
kdbnotification.h File Reference

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

#include "kdb.h"
Include dependency graph for kdbnotification.h:
This graph shows which files directly or indirectly include this file:

Typedefs

typedef void(* ElektraNotificationChangeCallback) (Key *key)
 Callback function for key changes. More...
 

Functions

int elektraNotificationOpen (KDB *kdb)
 Initialize the notification system for the given KDB instance. More...
 
int elektraNotificationClose (KDB *kdb)
 Stop the notification system for the given KDB instance. More...
 
int elektraNotificationRegisterInt (KDB *kdb, Key *key, int *variable)
 Subscribe for automatic updates to a given integer variable when the given key value is changed. More...
 
int elektraNotificationRegisterCallback (KDB *kdb, Key *key, ElektraNotificationChangeCallback callback)
 Subscribe for updates via callback when a given key value is changed. More...
 

Detailed Description

Elektra-Notification structures and declarations for application developers.

Typedef Documentation

◆ ElektraNotificationChangeCallback

typedef void(* ElektraNotificationChangeCallback) (Key *key)

Callback function for key changes.

Parameters
keychanged key

Function Documentation

◆ elektraNotificationClose()

int elektraNotificationClose ( KDB *  kdb)

Stop the notification system for the given KDB instance.

May only be called after elektraNotificationOpen() was called for given KDB instance.

Parameters
kdbKDB instance
Return values
1on success
0on error

◆ elektraNotificationOpen()

int elektraNotificationOpen ( KDB *  kdb)

Initialize the notification system for the given KDB instance.

May only be called once for a KDB instance. Subsequent calls return 0.

Parameters
kdbKDB instance
Return values
1on success
0on error

◆ elektraNotificationRegisterCallback()

int elektraNotificationRegisterCallback ( KDB *  kdb,
Key *  key,
ElektraNotificationChangeCallback  callback 
)

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

Parameters
handleplugin handle
keykey to watch for changes
callbackcallback function
Return values
1on success
0on failure

◆ elektraNotificationRegisterInt()

int elektraNotificationRegisterInt ( KDB *  kdb,
Key *  key,
int *  variable 
)

Subscribe for automatic updates to a given integer variable when the given key value is changed.

Parameters
handleplugin handle
keykey to watch for changes
variableinteger variable
Return values
1on success
0on failure