.TH "notification.c" 3elektra "Fri Aug 4 2023" "Version 0.11.0" "Elektra" \" -*- nroff -*-
.ad l
.nh
.SH NAME
notification.c \- Implementation of notification functions as defined in \fBkdbnotification\&.h\fP\&.  

.SH SYNOPSIS
.br
.PP
\fC#include <kdbassert\&.h>\fP
.br
\fC#include <kdbease\&.h>\fP
.br
\fC#include <kdbhelper\&.h>\fP
.br
\fC#include <kdbinvoke\&.h>\fP
.br
\fC#include <kdbioprivate\&.h>\fP
.br
\fC#include <kdblogger\&.h>\fP
.br
\fC#include <kdbnotification\&.h>\fP
.br
\fC#include <kdbnotificationinternal\&.h>\fP
.br
\fC#include <kdbplugin\&.h>\fP
.br
\fC#include <kdbprivate\&.h>\fP
.br
\fC#include <stdio\&.h>\fP
.br

.SS "Functions"

.in +1c
.ti -1c
.RI "int \fBelektraNotificationContract\fP (KeySet *contract)"
.br
.RI "Creates a contract for use with \fBkdbOpen()\fP that sets up notifications\&. "
.ti -1c
.RI "int \fBelektraNotificationRegisterCallback\fP (KDB *kdb, Key *key, \fBElektraNotificationChangeCallback\fP callback, void *context)"
.br
.RI "Subscribe for updates via callback when a given key value is changed\&. "
.ti -1c
.RI "int \fBelektraNotificationRegisterCallbackSameOrBelow\fP (KDB *kdb, Key *key, \fBElektraNotificationChangeCallback\fP callback, void *context)"
.br
.RI "Subscribe for updates via callback when a given key or a key below changed\&. "
.in -1c
.SH "Detailed Description"
.PP 
Implementation of notification functions as defined in \fBkdbnotification\&.h\fP\&. 


.PP
\fBCopyright\fP
.RS 4
BSD License (see LICENSE\&.md or https://www.libelektra.org) 
.RE
.PP

.SH "Function Documentation"
.PP 
.SS "int elektraNotificationContract (KeySet * contract)"

.PP
Creates a contract for use with \fBkdbOpen()\fP that sets up notifications\&. When you call \fBkdbOpen()\fP with this contract, the \fCinternalnotification\fP plugin will be mounted automatically\&. This allows you to call other \fCelektraNotification*\fP functions\&.
.PP
If you need to configure notification transport plugins, you should manually add the relevant keys to \fCcontract\fP\&.
.PP
\fBParameters\fP
.RS 4
\fIcontract\fP The keyset into which the contract is written\&.
.RE
.PP
\fBReturn values\fP
.RS 4
\fI-1\fP if \fCcontract\fP is NULL 
.br
\fI0\fP on success 
.RE
.PP

.SH "Author"
.PP 
Generated automatically by Doxygen for Elektra from the source code\&.
