\hypertarget{mount_8c}{\section{mount.\+c File Reference}
\label{mount_8c}\index{mount.\+c@{mount.\+c}}
}


Interna of mount functionality.  


{\ttfamily \#include \char`\"{}kdbinternal.\+h\char`\"{}}\\*
Include dependency graph for mount.\+c\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{mount_8c__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{mount_8c_ad3c84032644ff56feb44106a7924d3fe}{elektra\+Mount\+Open} (K\+D\+B $\ast$kdb, Key\+Set $\ast$config, Key\+Set $\ast$modules, Key $\ast$error\+Key)
\begin{DoxyCompactList}\small\item\em Creates a trie from a given configuration. \end{DoxyCompactList}\item 
int \hyperlink{mount_8c_a10c21e6fe8931013a0dd3f00c87833d8}{elektra\+Mount\+Default} (K\+D\+B $\ast$kdb, Key\+Set $\ast$modules, int in\+Fallback, Key $\ast$error\+Key)
\begin{DoxyCompactList}\small\item\em Reopens the default backend and mounts the default backend if needed. \end{DoxyCompactList}\item 
int \hyperlink{mount_8c_a54e32ffc628b2ca1e1876efb6d28cfc7}{elektra\+Mount\+Modules} (K\+D\+B $\ast$kdb, Key\+Set $\ast$modules, Key $\ast$error\+Key)
\begin{DoxyCompactList}\small\item\em Mount all module configurations. \end{DoxyCompactList}\item 
int \hyperlink{mount_8c_a6362fc7585d7a308c08005cb3cb1a4cd}{elektra\+Mount\+Version} (K\+D\+B $\ast$kdb, Key $\ast$error\+Key)
\begin{DoxyCompactList}\small\item\em Mount the version backend. \end{DoxyCompactList}\item 
int \hyperlink{mount_8c_a746a6f6758e8cdfb985b4c46a0e246ff}{elektra\+Mount\+Backend} (K\+D\+B $\ast$kdb, Backend $\ast$backend, Key $\ast$error\+Key)
\begin{DoxyCompactList}\small\item\em Mounts a backend into the trie. \end{DoxyCompactList}\item 
Key $\ast$ \hyperlink{mount_8c_a0cdbb658c5ac280672e4ac22419075f1}{elektra\+Mount\+Get\+Mountpoint} (K\+D\+B $\ast$handle, const Key $\ast$where)
\begin{DoxyCompactList}\small\item\em Lookup a mountpoint in a handle for a specific key. \end{DoxyCompactList}\item 
Backend $\ast$ \hyperlink{mount_8c_aa66ed093e4c71d97018ffc66d46d0e1f}{elektra\+Mount\+Get\+Backend} (K\+D\+B $\ast$handle, const Key $\ast$key)
\begin{DoxyCompactList}\small\item\em Lookup a backend handle for a specific key. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Interna of mount functionality. 

\begin{DoxyCopyright}{Copyright}
B\+S\+D License (see doc/\+C\+O\+P\+Y\+I\+N\+G or \href{http://www.libelektra.org}{\tt http\+://www.\+libelektra.\+org}) 
\end{DoxyCopyright}


\subsection{Function Documentation}
\hypertarget{mount_8c_a746a6f6758e8cdfb985b4c46a0e246ff}{\index{mount.\+c@{mount.\+c}!elektra\+Mount\+Backend@{elektra\+Mount\+Backend}}
\index{elektra\+Mount\+Backend@{elektra\+Mount\+Backend}!mount.\+c@{mount.\+c}}
\subsubsection[{elektra\+Mount\+Backend}]{\setlength{\rightskip}{0pt plus 5cm}int elektra\+Mount\+Backend (
\begin{DoxyParamCaption}
\item[{K\+D\+B $\ast$}]{kdb, }
\item[{Backend $\ast$}]{backend, }
\item[{Key $\ast$}]{error\+Key}
\end{DoxyParamCaption}
)}}\label{mount_8c_a746a6f6758e8cdfb985b4c46a0e246ff}


Mounts a backend into the trie. 

\begin{DoxyPrecond}{Precondition}
user must pass correctly allocated backend 
\end{DoxyPrecond}
\begin{DoxyPostcond}{Postcondition}
sets reference counter of backend
\end{DoxyPostcond}
\begin{DoxyWarning}{Warning}
in case of init and default backends, the reference counter needs to be modified {\itshape after} calling elektra\+Mount\+Backend.
\end{DoxyWarning}

\begin{DoxyParams}{Parameters}
{\em kdb} & the handle to work with \\
\hline
{\em backend} & the backend to mount \\
\hline
{\em error\+Key} & the key used to report warnings \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em -\/1} & on failure \\
\hline
{\em 1} & on success \\
\hline
\end{DoxyRetVals}
\hypertarget{mount_8c_a10c21e6fe8931013a0dd3f00c87833d8}{\index{mount.\+c@{mount.\+c}!elektra\+Mount\+Default@{elektra\+Mount\+Default}}
\index{elektra\+Mount\+Default@{elektra\+Mount\+Default}!mount.\+c@{mount.\+c}}
\subsubsection[{elektra\+Mount\+Default}]{\setlength{\rightskip}{0pt plus 5cm}int elektra\+Mount\+Default (
\begin{DoxyParamCaption}
\item[{K\+D\+B $\ast$}]{kdb, }
\item[{Key\+Set $\ast$}]{modules, }
\item[{int}]{in\+Fallback, }
\item[{Key $\ast$}]{error\+Key}
\end{DoxyParamCaption}
)}}\label{mount_8c_a10c21e6fe8931013a0dd3f00c87833d8}


Reopens the default backend and mounts the default backend if needed. 

\begin{DoxyPrecond}{Precondition}
Default Backend is closed. elektra\+Mount\+Open was executed before.
\end{DoxyPrecond}

\begin{DoxyParams}{Parameters}
{\em kdb} & the handle to work with \\
\hline
{\em modules} & the current list of loaded modules \\
\hline
{\em error\+Key} & the key used to report warnings \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em -\/1} & on error \\
\hline
{\em 0} & on success \\
\hline
\end{DoxyRetVals}
\hypertarget{mount_8c_aa66ed093e4c71d97018ffc66d46d0e1f}{\index{mount.\+c@{mount.\+c}!elektra\+Mount\+Get\+Backend@{elektra\+Mount\+Get\+Backend}}
\index{elektra\+Mount\+Get\+Backend@{elektra\+Mount\+Get\+Backend}!mount.\+c@{mount.\+c}}
\subsubsection[{elektra\+Mount\+Get\+Backend}]{\setlength{\rightskip}{0pt plus 5cm}Backend$\ast$ elektra\+Mount\+Get\+Backend (
\begin{DoxyParamCaption}
\item[{K\+D\+B $\ast$}]{handle, }
\item[{const Key $\ast$}]{key}
\end{DoxyParamCaption}
)}}\label{mount_8c_aa66ed093e4c71d97018ffc66d46d0e1f}


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 K\+D\+B could be found.

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


\begin{DoxyParams}{Parameters}
{\em handle} & is the data structure, where the mounted directories are saved. \\
\hline
{\em key} & the key, that should be looked up. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the backend handle associated with the key 
\end{DoxyReturn}
\hypertarget{mount_8c_a0cdbb658c5ac280672e4ac22419075f1}{\index{mount.\+c@{mount.\+c}!elektra\+Mount\+Get\+Mountpoint@{elektra\+Mount\+Get\+Mountpoint}}
\index{elektra\+Mount\+Get\+Mountpoint@{elektra\+Mount\+Get\+Mountpoint}!mount.\+c@{mount.\+c}}
\subsubsection[{elektra\+Mount\+Get\+Mountpoint}]{\setlength{\rightskip}{0pt plus 5cm}Key$\ast$ elektra\+Mount\+Get\+Mountpoint (
\begin{DoxyParamCaption}
\item[{K\+D\+B $\ast$}]{handle, }
\item[{const Key $\ast$}]{where}
\end{DoxyParamCaption}
)}}\label{mount_8c_a0cdbb658c5ac280672e4ac22419075f1}


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}
1 Key * key = keyNew ("system/template");
2 KDB * handle = kdbOpen();
3 Key *mountpoint=0;
4 mountpoint=kdbGetMountpoint(handle, key);
5 
6 printf("The backend I am using is %s mounted in %s\(\backslash\)n",
7         keyValue(mountpoint),
8         keyName(mountpoint));
9 kdbClose (handle);
10 keyDel (key);
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em handle} & is the data structure, where the mounted directories are saved. \\
\hline
{\em where} & the key, that should be looked up. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the mountpoint associated with the key 
\end{DoxyReturn}
\hypertarget{mount_8c_a54e32ffc628b2ca1e1876efb6d28cfc7}{\index{mount.\+c@{mount.\+c}!elektra\+Mount\+Modules@{elektra\+Mount\+Modules}}
\index{elektra\+Mount\+Modules@{elektra\+Mount\+Modules}!mount.\+c@{mount.\+c}}
\subsubsection[{elektra\+Mount\+Modules}]{\setlength{\rightskip}{0pt plus 5cm}int elektra\+Mount\+Modules (
\begin{DoxyParamCaption}
\item[{K\+D\+B $\ast$}]{kdb, }
\item[{Key\+Set $\ast$}]{modules, }
\item[{Key $\ast$}]{error\+Key}
\end{DoxyParamCaption}
)}}\label{mount_8c_a54e32ffc628b2ca1e1876efb6d28cfc7}


Mount all module configurations. 


\begin{DoxyParams}{Parameters}
{\em kdb} & the handle to work with \\
\hline
{\em modules} & the current list of loaded modules \\
\hline
{\em error\+Key} & the key used to report warnings\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em -\/1} & if not rootkey was found \\
\hline
{\em 0} & otherwise \\
\hline
\end{DoxyRetVals}
\hypertarget{mount_8c_ad3c84032644ff56feb44106a7924d3fe}{\index{mount.\+c@{mount.\+c}!elektra\+Mount\+Open@{elektra\+Mount\+Open}}
\index{elektra\+Mount\+Open@{elektra\+Mount\+Open}!mount.\+c@{mount.\+c}}
\subsubsection[{elektra\+Mount\+Open}]{\setlength{\rightskip}{0pt plus 5cm}int elektra\+Mount\+Open (
\begin{DoxyParamCaption}
\item[{K\+D\+B $\ast$}]{kdb, }
\item[{Key\+Set $\ast$}]{config, }
\item[{Key\+Set $\ast$}]{modules, }
\item[{Key $\ast$}]{error\+Key}
\end{DoxyParamCaption}
)}}\label{mount_8c_ad3c84032644ff56feb44106a7924d3fe}


Creates a trie from a given configuration. 

The config will be deleted within this function.

\begin{DoxyNote}{Note}
elektra\+Mount\+Default is not allowed to be executed before
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em kdb} & the handle to work with \\
\hline
{\em modules} & the current list of loaded modules \\
\hline
{\em config} & the configuration which should be used to build up the trie. \\
\hline
{\em error\+Key} & the key used to report warnings \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em -\/1} & on failure \\
\hline
{\em 0} & on success \\
\hline
\end{DoxyRetVals}
\hypertarget{mount_8c_a6362fc7585d7a308c08005cb3cb1a4cd}{\index{mount.\+c@{mount.\+c}!elektra\+Mount\+Version@{elektra\+Mount\+Version}}
\index{elektra\+Mount\+Version@{elektra\+Mount\+Version}!mount.\+c@{mount.\+c}}
\subsubsection[{elektra\+Mount\+Version}]{\setlength{\rightskip}{0pt plus 5cm}int elektra\+Mount\+Version (
\begin{DoxyParamCaption}
\item[{K\+D\+B $\ast$}]{kdb, }
\item[{Key $\ast$}]{error\+Key}
\end{DoxyParamCaption}
)}}\label{mount_8c_a6362fc7585d7a308c08005cb3cb1a4cd}


Mount the version backend. 


\begin{DoxyParams}{Parameters}
{\em kdb} & the handle to work with \\
\hline
{\em error\+Key} & the key used to report warnings\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em 0} & on success \\
\hline
\end{DoxyRetVals}
