Elektra  0.8.23
Functions
notification.c File Reference

Implementation of notification functions as defined in kdbnotification.h. More...

#include <kdbassert.h>
#include <kdbease.h>
#include <kdbinternal.h>
#include <kdbioprivate.h>
#include <kdblogger.h>
#include <kdbnotification.h>
#include <kdbnotificationinternal.h>
#include <stdio.h>
Include dependency graph for notification.c:

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

Implementation of notification functions as defined in kdbnotification.h.

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.

Asynchronous receiving of notifications requires an I/O binding. Use elektraIoSetBinding() before calling this function.

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