\hypertarget{notification_8c}{}\section{notification.\+c File Reference}
\label{notification_8c}\index{notification.\+c@{notification.\+c}}


Implementation of notification functions as defined in \hyperlink{kdbnotification_8h}{kdbnotification.\+h}.  


{\ttfamily \#include $<$kdbassert.\+h$>$}\newline
{\ttfamily \#include $<$kdbease.\+h$>$}\newline
{\ttfamily \#include $<$kdbhelper.\+h$>$}\newline
{\ttfamily \#include $<$kdbinvoke.\+h$>$}\newline
{\ttfamily \#include $<$kdbioprivate.\+h$>$}\newline
{\ttfamily \#include $<$kdblogger.\+h$>$}\newline
{\ttfamily \#include $<$kdbnotification.\+h$>$}\newline
{\ttfamily \#include $<$kdbnotificationinternal.\+h$>$}\newline
{\ttfamily \#include $<$kdbplugin.\+h$>$}\newline
{\ttfamily \#include $<$kdbprivate.\+h$>$}\newline
{\ttfamily \#include $<$stdio.\+h$>$}\newline
Include dependency graph for notification.\+c\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{notification_8c__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{notification_8c_ad9290f444f315d3eac3f7cfdaf4efcda}{elektra\+Notification\+Contract} (Key\+Set $\ast$contract)
\begin{DoxyCompactList}\small\item\em Creates a contract for use with \hyperlink{group__kdb_ga844e1299a84c3fbf1d3a905c5c893ba5}{kdb\+Open()} that sets up notifications. \end{DoxyCompactList}\item 
int \hyperlink{group__kdbnotification_gab42738703162b3769b1336dcade47b18}{elektra\+Notification\+Register\+Callback} (K\+DB $\ast$kdb, Key $\ast$key, \hyperlink{group__kdbnotification_gad0d800e32a72d89780321e5723301eb9}{Elektra\+Notification\+Change\+Callback} callback, void $\ast$context)
\begin{DoxyCompactList}\small\item\em Subscribe for updates via callback when a given key value is changed. \end{DoxyCompactList}\item 
int \hyperlink{group__kdbnotification_ga374edd4f4fff527d6511ce4d0df62681}{elektra\+Notification\+Register\+Callback\+Same\+Or\+Below} (K\+DB $\ast$kdb, Key $\ast$key, \hyperlink{group__kdbnotification_gad0d800e32a72d89780321e5723301eb9}{Elektra\+Notification\+Change\+Callback} callback, void $\ast$context)
\begin{DoxyCompactList}\small\item\em Subscribe for updates via callback when a given key or a key below changed. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Implementation of notification functions as defined in \hyperlink{kdbnotification_8h}{kdbnotification.\+h}. 

\begin{DoxyCopyright}{Copyright}
B\+SD License (see L\+I\+C\+E\+N\+S\+E.\+md or \href{https://www.libelektra.org}{\tt https\+://www.\+libelektra.\+org}) 
\end{DoxyCopyright}


\subsection{Function Documentation}
\mbox{\Hypertarget{notification_8c_ad9290f444f315d3eac3f7cfdaf4efcda}\label{notification_8c_ad9290f444f315d3eac3f7cfdaf4efcda}} 
\index{notification.\+c@{notification.\+c}!elektra\+Notification\+Contract@{elektra\+Notification\+Contract}}
\index{elektra\+Notification\+Contract@{elektra\+Notification\+Contract}!notification.\+c@{notification.\+c}}
\subsubsection{\texorpdfstring{elektra\+Notification\+Contract()}{elektraNotificationContract()}}
{\footnotesize\ttfamily int elektra\+Notification\+Contract (\begin{DoxyParamCaption}\item[{Key\+Set $\ast$}]{contract }\end{DoxyParamCaption})}



Creates a contract for use with \hyperlink{group__kdb_ga844e1299a84c3fbf1d3a905c5c893ba5}{kdb\+Open()} that sets up notifications. 

When you call \hyperlink{group__kdb_ga844e1299a84c3fbf1d3a905c5c893ba5}{kdb\+Open()} with this contract, the {\ttfamily internalnotification} plugin will be mounted automatically. This allows you to call other {\ttfamily elektra\+Notification$\ast$} functions.

If you need to configure notification transport plugins, you should manually add the relevant keys to {\ttfamily contract}.


\begin{DoxyParams}{Parameters}
{\em contract} & The keyset into which the contract is written.\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em -\/1} & if {\ttfamily contract} is N\+U\+LL \\
\hline
{\em 0} & on success \\
\hline
\end{DoxyRetVals}
