\hypertarget{group__mount}{
\section{Interface for mounting backends}
\label{group__mount}\index{Interface for mounting backends@{Interface for mounting backends}}
}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{group__mount_gad3c84032644ff56feb44106a7924d3fe}{elektraMountOpen} (\hyperlink{struct__KDB}{KDB} $\ast$kdb, \hyperlink{struct__KeySet}{KeySet} $\ast$config, \hyperlink{struct__KeySet}{KeySet} $\ast$modules, \hyperlink{struct__Key}{Key} $\ast$errorKey)
\item 
int \hyperlink{group__mount_ga97152dfe71e1c834476d5dd12c71c54f}{elektraMountDefault} (\hyperlink{struct__KDB}{KDB} $\ast$kdb, \hyperlink{struct__KeySet}{KeySet} $\ast$modules, \hyperlink{struct__Key}{Key} $\ast$errorKey)
\item 
int \hyperlink{group__mount_ga54e32ffc628b2ca1e1876efb6d28cfc7}{elektraMountModules} (\hyperlink{struct__KDB}{KDB} $\ast$kdb, \hyperlink{struct__KeySet}{KeySet} $\ast$modules, \hyperlink{struct__Key}{Key} $\ast$errorKey)
\item 
int \hyperlink{group__mount_ga6362fc7585d7a308c08005cb3cb1a4cd}{elektraMountVersion} (\hyperlink{struct__KDB}{KDB} $\ast$kdb, \hyperlink{struct__Key}{Key} $\ast$errorKey)
\item 
int \hyperlink{group__mount_ga746a6f6758e8cdfb985b4c46a0e246ff}{elektraMountBackend} (\hyperlink{struct__KDB}{KDB} $\ast$kdb, \hyperlink{struct__Backend}{Backend} $\ast$backend, \hyperlink{struct__Key}{Key} $\ast$errorKey)
\item 
\hyperlink{struct__Key}{Key} $\ast$ \hyperlink{group__mount_ga0cdbb658c5ac280672e4ac22419075f1}{elektraMountGetMountpoint} (\hyperlink{struct__KDB}{KDB} $\ast$handle, const \hyperlink{struct__Key}{Key} $\ast$where)
\item 
\hyperlink{struct__Backend}{Backend} $\ast$ \hyperlink{group__mount_gaa66ed093e4c71d97018ffc66d46d0e1f}{elektraMountGetBackend} (\hyperlink{struct__KDB}{KDB} $\ast$handle, const \hyperlink{struct__Key}{Key} $\ast$key)
\end{DoxyCompactItemize}


\subsection{Function Documentation}
\hypertarget{group__mount_ga746a6f6758e8cdfb985b4c46a0e246ff}{
\index{mount@{mount}!elektraMountBackend@{elektraMountBackend}}
\index{elektraMountBackend@{elektraMountBackend}!mount@{mount}}
\subsubsection[{elektraMountBackend}]{\setlength{\rightskip}{0pt plus 5cm}int elektraMountBackend (
\begin{DoxyParamCaption}
\item[{{\bf KDB} $\ast$}]{ kdb, }
\item[{{\bf Backend} $\ast$}]{ backend, }
\item[{{\bf Key} $\ast$}]{ errorKey}
\end{DoxyParamCaption}
)}}
\label{group__mount_ga746a6f6758e8cdfb985b4c46a0e246ff}
Mounts a backend into the trie.


\begin{DoxyParams}{Parameters}
\item[{\em kdb}]the handle to work with \item[{\em backend}]the backend to mount \item[{\em errorKey}]the key used to report warnings \end{DoxyParams}
\begin{DoxyReturn}{Returns}
-\/1 on failure 

1 on success 
\end{DoxyReturn}
\hypertarget{group__mount_ga97152dfe71e1c834476d5dd12c71c54f}{
\index{mount@{mount}!elektraMountDefault@{elektraMountDefault}}
\index{elektraMountDefault@{elektraMountDefault}!mount@{mount}}
\subsubsection[{elektraMountDefault}]{\setlength{\rightskip}{0pt plus 5cm}int elektraMountDefault (
\begin{DoxyParamCaption}
\item[{{\bf KDB} $\ast$}]{ kdb, }
\item[{{\bf KeySet} $\ast$}]{ modules, }
\item[{{\bf Key} $\ast$}]{ errorKey}
\end{DoxyParamCaption}
)}}
\label{group__mount_ga97152dfe71e1c834476d5dd12c71c54f}
Reopens the default backend and mounts the default backend if needed.

\begin{DoxyPrecond}{Precondition}
Default Backend is closed. elektraMountOpen was executed before.
\end{DoxyPrecond}

\begin{DoxyParams}{Parameters}
\item[{\em kdb}]the handle to work with \item[{\em modules}]the current list of loaded modules \item[{\em errorKey}]the key used to report warnings \end{DoxyParams}
\begin{DoxyReturn}{Returns}
-\/1 on error 

0 on success 
\end{DoxyReturn}
\hypertarget{group__mount_gaa66ed093e4c71d97018ffc66d46d0e1f}{
\index{mount@{mount}!elektraMountGetBackend@{elektraMountGetBackend}}
\index{elektraMountGetBackend@{elektraMountGetBackend}!mount@{mount}}
\subsubsection[{elektraMountGetBackend}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Backend}$\ast$ elektraMountGetBackend (
\begin{DoxyParamCaption}
\item[{{\bf KDB} $\ast$}]{ handle, }
\item[{const {\bf Key} $\ast$}]{ key}
\end{DoxyParamCaption}
)}}
\label{group__mount_gaa66ed093e4c71d97018ffc66d46d0e1f}
Lookup a backend handle for a specific key.

The required canonical name is ensured by using a key as parameter, which will transform the key to canonical representation.

Will return handle when no more specific KDB could be found.

If key is 0 or invalid the default backend will be returned.


\begin{DoxyParams}{Parameters}
\item[{\em handle}]is the data structure, where the mounted directories are saved. \item[{\em key}]the key, that should be looked up. \end{DoxyParams}
\begin{DoxyReturn}{Returns}
the backend handle associated with the key 
\end{DoxyReturn}
\hypertarget{group__mount_ga0cdbb658c5ac280672e4ac22419075f1}{
\index{mount@{mount}!elektraMountGetMountpoint@{elektraMountGetMountpoint}}
\index{elektraMountGetMountpoint@{elektraMountGetMountpoint}!mount@{mount}}
\subsubsection[{elektraMountGetMountpoint}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Key}$\ast$ elektraMountGetMountpoint (
\begin{DoxyParamCaption}
\item[{{\bf KDB} $\ast$}]{ handle, }
\item[{const {\bf Key} $\ast$}]{ where}
\end{DoxyParamCaption}
)}}
\label{group__mount_ga0cdbb658c5ac280672e4ac22419075f1}
Lookup a mountpoint in a handle for a specific key.

Will return a key representing the mountpoint or null if there is no appropriate mountpoint e.g. its the root mountpoint.

\begin{DoxyParagraph}{Example:}

\begin{DoxyCode}
Key * key = keyNew ("system/template");
KDB * handle = kdbOpen();
Key *mountpoint=0;
mountpoint=kdbGetMountpoint(handle, key);

printf("The backend I am using is %s mounted in %s\n",
        keyValue(mountpoint),
        keyName(mountpoint));
kdbClose (handle);
keyDel (key);
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
\item[{\em handle}]is the data structure, where the mounted directories are saved. \item[{\em where}]the key, that should be looked up. \end{DoxyParams}
\begin{DoxyReturn}{Returns}
the mountpoint associated with the key 
\end{DoxyReturn}
\hypertarget{group__mount_ga54e32ffc628b2ca1e1876efb6d28cfc7}{
\index{mount@{mount}!elektraMountModules@{elektraMountModules}}
\index{elektraMountModules@{elektraMountModules}!mount@{mount}}
\subsubsection[{elektraMountModules}]{\setlength{\rightskip}{0pt plus 5cm}int elektraMountModules (
\begin{DoxyParamCaption}
\item[{{\bf KDB} $\ast$}]{ kdb, }
\item[{{\bf KeySet} $\ast$}]{ modules, }
\item[{{\bf Key} $\ast$}]{ errorKey}
\end{DoxyParamCaption}
)}}
\label{group__mount_ga54e32ffc628b2ca1e1876efb6d28cfc7}
Mount all module configurations.


\begin{DoxyParams}{Parameters}
\item[{\em kdb}]the handle to work with \item[{\em modules}]the current list of loaded modules \item[{\em errorKey}]the key used to report warnings\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
\item[{\em -\/1}]if not rootkey was found \item[{\em 0}]otherwise \end{DoxyRetVals}
\hypertarget{group__mount_gad3c84032644ff56feb44106a7924d3fe}{
\index{mount@{mount}!elektraMountOpen@{elektraMountOpen}}
\index{elektraMountOpen@{elektraMountOpen}!mount@{mount}}
\subsubsection[{elektraMountOpen}]{\setlength{\rightskip}{0pt plus 5cm}int elektraMountOpen (
\begin{DoxyParamCaption}
\item[{{\bf KDB} $\ast$}]{ kdb, }
\item[{{\bf KeySet} $\ast$}]{ config, }
\item[{{\bf KeySet} $\ast$}]{ modules, }
\item[{{\bf Key} $\ast$}]{ errorKey}
\end{DoxyParamCaption}
)}}
\label{group__mount_gad3c84032644ff56feb44106a7924d3fe}
Creates a trie from a given configuration.

The config will be deleted within this function.

\begin{DoxyNote}{Note}
elektraMountDefault is not allowed to be executed before
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
\item[{\em kdb}]the handle to work with \item[{\em modules}]the current list of loaded modules \item[{\em config}]the configuration which should be used to build up the trie. \item[{\em errorKey}]the key used to report warnings \end{DoxyParams}
\begin{DoxyReturn}{Returns}
-\/1 on failure 

0 on success 
\end{DoxyReturn}
\hypertarget{group__mount_ga6362fc7585d7a308c08005cb3cb1a4cd}{
\index{mount@{mount}!elektraMountVersion@{elektraMountVersion}}
\index{elektraMountVersion@{elektraMountVersion}!mount@{mount}}
\subsubsection[{elektraMountVersion}]{\setlength{\rightskip}{0pt plus 5cm}int elektraMountVersion (
\begin{DoxyParamCaption}
\item[{{\bf KDB} $\ast$}]{ kdb, }
\item[{{\bf Key} $\ast$}]{ errorKey}
\end{DoxyParamCaption}
)}}
\label{group__mount_ga6362fc7585d7a308c08005cb3cb1a4cd}
Mount the version backend


\begin{DoxyParams}{Parameters}
\item[{\em kdb}]the handle to work with \item[{\em errorKey}]the key used to report warnings\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
\item[{\em 0}]on success \end{DoxyRetVals}
