\hypertarget{kdbprivate_8h}{}\doxysection{kdbprivate.\+h File Reference}
\label{kdbprivate_8h}\index{kdbprivate.h@{kdbprivate.h}}


Private declarations.  


{\ttfamily \#include $<$elektra.\+h$>$}\newline
{\ttfamily \#include $<$elektra/error.\+h$>$}\newline
{\ttfamily \#include $<$kdb.\+h$>$}\newline
{\ttfamily \#include $<$kdbextension.\+h$>$}\newline
{\ttfamily \#include $<$kdbhelper.\+h$>$}\newline
{\ttfamily \#include $<$kdbio.\+h$>$}\newline
{\ttfamily \#include $<$kdbmacros.\+h$>$}\newline
{\ttfamily \#include $<$kdbnotificationinternal.\+h$>$}\newline
{\ttfamily \#include $<$kdbplugin.\+h$>$}\newline
{\ttfamily \#include $<$kdbtypes.\+h$>$}\newline
{\ttfamily \#include $<$limits.\+h$>$}\newline
Include dependency graph for kdbprivate.\+h\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{kdbprivate_8h__incl}
\end{center}
\end{figure}
This graph shows which files directly or indirectly include this file\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{kdbprivate_8h__dep__incl}
\end{center}
\end{figure}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \mbox{\hyperlink{kdbprivate_8h_acf20140d9b29c3edc782e72b05b25bd1}{KEYSET\+\_\+\+SIZE}}~16
\begin{DoxyCompactList}\small\item\em The minimal allocation size of a keyset inclusive NULL byte. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{kdbprivate_8h_a98a9dd0e80f70ba8ad12cc00fedf52fb}\label{kdbprivate_8h_a98a9dd0e80f70ba8ad12cc00fedf52fb}} 
\#define \mbox{\hyperlink{kdbprivate_8h_a98a9dd0e80f70ba8ad12cc00fedf52fb}{APPROXIMATE\+\_\+\+NR\+\_\+\+OF\+\_\+\+BACKENDS}}~16
\begin{DoxyCompactList}\small\item\em Trie optimization. \end{DoxyCompactList}\item 
\#define \mbox{\hyperlink{kdbprivate_8h_a93f061df863d00deae4b596cb18b99f8}{KDB\+\_\+\+MAX\+\_\+\+UCHAR}}~(UCHAR\+\_\+\+MAX + 1)
\begin{DoxyCompactList}\small\item\em The maximum value of unsigned char+1, needed for iteration over trie children/values\+: \end{DoxyCompactList}\item 
\mbox{\Hypertarget{kdbprivate_8h_a93b6deccf1a55a100f74d2e076036f37}\label{kdbprivate_8h_a93b6deccf1a55a100f74d2e076036f37}} 
\#define \mbox{\hyperlink{kdbprivate_8h_a93b6deccf1a55a100f74d2e076036f37}{MAX\+\_\+\+LEN\+\_\+\+INT}}~31
\begin{DoxyCompactList}\small\item\em The maximum of how many characters an integer needs as decimal number. \end{DoxyCompactList}\item 
\#define \mbox{\hyperlink{kdbprivate_8h_a8891eaf029de761514dca775f19d6e18}{KDB\+\_\+\+SYSTEM\+\_\+\+ELEKTRA}}~\char`\"{}system\+:/elektra\char`\"{}
\begin{DoxyCompactList}\small\item\em Backend mounting information. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{kdbprivate_8h_abecff8814a02da83ec5d19d6bbac76de}\label{kdbprivate_8h_abecff8814a02da83ec5d19d6bbac76de}} 
\#define \mbox{\hyperlink{kdbprivate_8h_abecff8814a02da83ec5d19d6bbac76de}{KDB\+\_\+\+CACHE\+\_\+\+PREFIX}}~\char`\"{}system\+:/elektra/cache\char`\"{}
\begin{DoxyCompactList}\small\item\em All keys below this are used for cache metadata in the global keyset. \end{DoxyCompactList}\item 
\#define \mbox{\hyperlink{kdbprivate_8h_a22e02bbe80b6081a6485b3f3d2caec14}{test\+\_\+bit}}(var,  bit)~(((unsigned long long) (var)) \& ((unsigned long long) (bit)))
\begin{DoxyCompactList}\small\item\em Test a bit. \end{DoxyCompactList}\item 
\#define \mbox{\hyperlink{kdbprivate_8h_a4874f05226547f6afa54ed6d65dc54ae}{set\+\_\+bit}}(var,  bit)~((var) $\vert$= ((unsigned long long) (bit)))
\begin{DoxyCompactList}\small\item\em Set a bit. \end{DoxyCompactList}\item 
\#define \mbox{\hyperlink{kdbprivate_8h_a686cd59039c7112c10c8fbb82f9759e9}{clear\+\_\+bit}}(var,  bit)~((var) \&= $\sim$((unsigned long long) (bit)))
\begin{DoxyCompactList}\small\item\em Clear a bit. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef struct \+\_\+\+Backend\+Data \mbox{\hyperlink{kdbprivate_8h_ada35c6e75f4c30868a2d86365d841dbb}{Backend\+Data}}
\begin{DoxyCompactList}\small\item\em Holds all data for one backend. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
Plugin $\ast$ \mbox{\hyperlink{kdbprivate_8h_a853bd9e11745f72b944d56e0c521e454}{elektra\+Plugin\+Open}} (const char $\ast$backendname, Key\+Set $\ast$modules, Key\+Set $\ast$config, Key $\ast$error\+Key)
\begin{DoxyCompactList}\small\item\em Opens a plugin. \end{DoxyCompactList}\item 
size\+\_\+t \mbox{\hyperlink{kdbprivate_8h_a9c44a58fa46e132d04a513ff9c453201}{elektra\+Plugin\+Get\+Function}} (Plugin $\ast$plugin, const char $\ast$name)
\begin{DoxyCompactList}\small\item\em Retrieves a function exported by a plugin. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{kdbprivate_8h_ae7bbcecc6ef81631ebfa94662f5c9b1a}{init\+Hooks}} (KDB $\ast$kdb, const Key\+Set $\ast$config, Key\+Set $\ast$modules, const Key\+Set $\ast$contract, Key $\ast$error\+Key)
\begin{DoxyCompactList}\small\item\em Initializes the hooks stored in the passed KDB handle. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{kdbprivate_8h_a1578be51bff442159d04a5cfd3fbeb5a}{free\+Hooks}} (KDB $\ast$kdb, Key $\ast$error\+Key)
\begin{DoxyCompactList}\small\item\em Uninitializes and frees all hooks in the passed KDB handle. \end{DoxyCompactList}\item 
Plugin $\ast$ \mbox{\hyperlink{kdbprivate_8h_ad14db012d93631679d1aa26539d15770}{elektra\+Find\+Internal\+Notification\+Plugin}} (KDB $\ast$kdb)
\begin{DoxyCompactList}\small\item\em This method looks for the hook plugin \textquotesingle{}internalnotification\textquotesingle{}. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__keyname_gae22037aad3f76f4454de4e6400637b39}{key\+Replace\+Prefix}} (Key $\ast$key, const Key $\ast$old\+Prefix, const Key $\ast$new\+Prefix)
\begin{DoxyCompactList}\small\item\em Replaces a prefix of the key name of {\ttfamily key}. \end{DoxyCompactList}\item 
Key $\ast$ \mbox{\hyperlink{kdbprivate_8h_a0edeebda49ef1ad7c054411a36a9bf38}{elektra\+Ks\+Pop\+At\+Cursor}} (Key\+Set $\ast$ks, elektra\+Cursor pos)
\begin{DoxyCompactList}\small\item\em Pop key at given cursor position. \end{DoxyCompactList}\item 
Key\+Set $\ast$ \mbox{\hyperlink{group__kdb_ga1ba80a565f54490f362df95f401bcb29}{ks\+Rename\+Keys}} (Key\+Set $\ast$config, const char $\ast$name)
\begin{DoxyCompactList}\small\item\em Takes the first key and cuts off this common part for all other keys, instead name will be prepended. \end{DoxyCompactList}\item 
ssize\+\_\+t \mbox{\hyperlink{group__keyset_gaa9b59d3a7ccd58511b562755454d1fae}{ks\+Rename}} (Key\+Set $\ast$ks, const Key $\ast$root, const Key $\ast$new\+Root)
\begin{DoxyCompactList}\small\item\em Moves all keys below {\ttfamily root} to below {\ttfamily new\+Root}. \end{DoxyCompactList}\item 
elektra\+Cursor \mbox{\hyperlink{group__keyset_gaf29e567a3a733160303a452cc2366e69}{ks\+Find\+Hierarchy}} (const Key\+Set $\ast$ks, const Key $\ast$root, elektra\+Cursor $\ast$end)
\begin{DoxyCompactList}\small\item\em Searches for the start and optionally end of the key hierarchy rooted at {\ttfamily root} in {\ttfamily ks}. \end{DoxyCompactList}\item 
Key\+Set $\ast$ \mbox{\hyperlink{group__keyset_ga44563782d2aa169ce3f4926332792423}{ks\+Below}} (const Key\+Set $\ast$ks, const Key $\ast$root)
\begin{DoxyCompactList}\small\item\em Retrieves all Keys from Key\+Set {\ttfamily ks} that are below or at {\ttfamily root}. \end{DoxyCompactList}\item 
ssize\+\_\+t \mbox{\hyperlink{kdbprivate_8h_a6360a1271f6410f25fbb9b95e346da1a}{elektra\+Memcpy}} (Key $\ast$$\ast$array1, Key $\ast$$\ast$array2, size\+\_\+t size)
\begin{DoxyCompactList}\small\item\em Internal Methods for Elektra. \end{DoxyCompactList}\item 
ssize\+\_\+t \mbox{\hyperlink{kdbprivate_8h_abc60bdbe5d252a99734b0122687560be}{elektra\+Memmove}} (Key $\ast$$\ast$array1, Key $\ast$$\ast$array2, size\+\_\+t size)
\begin{DoxyCompactList}\small\item\em Copies the key array2 into where array1 points. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{group__keyname_ga26bacb092ebca8f69f3fee72069733d8}{elektra\+Key\+Name\+Validate}} (const char $\ast$name, bool is\+Complete)
\begin{DoxyCompactList}\small\item\em Takes an escaped key name and validates it. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__keyname_ga99ef3765a0ea0887c8ab72859ae2592e}{elektra\+Key\+Name\+Canonicalize}} (const char $\ast$name, char $\ast$$\ast$canonical\+Name, size\+\_\+t $\ast$canonical\+Size\+Ptr, size\+\_\+t offset, size\+\_\+t $\ast$usize\+Ptr)
\begin{DoxyCompactList}\small\item\em Takes a valid (non-\/)canonical key name and produces its canonical form. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__keyname_ga85dd2a5169e900c6c8371c54c7944edb}{elektra\+Key\+Name\+Unescape}} (const char $\ast$name, char $\ast$unescaped\+Name)
\begin{DoxyCompactList}\small\item\em Takes a canonical key name and unescapes it. \end{DoxyCompactList}\item 
size\+\_\+t \mbox{\hyperlink{group__keyname_ga35ac22f466de1a74ca72b05e8252980d}{elektra\+Key\+Name\+Escape\+Part}} (const char $\ast$part, char $\ast$$\ast$escaped\+Part)
\begin{DoxyCompactList}\small\item\em Takes a single key name part and produces its escaped form. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__keyname_ga331831b039b752751603e73d4a0a5d96}{elektra\+Is\+Array\+Part}} (const char $\ast$name\+Part)
\begin{DoxyCompactList}\small\item\em Checks if the given key name part is an array part. \end{DoxyCompactList}\item 
Elektra\+Error $\ast$ \mbox{\hyperlink{kdbprivate_8h_a0affd2cf7caf29441bf7cdf1d7cbb351}{elektra\+Error\+Create}} (const char $\ast$code, const char $\ast$description, const char $\ast$module, const char $\ast$file, kdb\+\_\+long\+\_\+t line)
\begin{DoxyCompactList}\small\item\em Creates a new Elektra\+Error using the provided values. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{kdbprivate_8h_a5b397979459c52ed2031d7b997679fca}{elektra\+Error\+Add\+Warning}} (Elektra\+Error $\ast$error, Elektra\+Error $\ast$warning)
\begin{DoxyCompactList}\small\item\em Adds a warning to an existing Elektra\+Error struct. \end{DoxyCompactList}\item 
Elektra\+Error $\ast$ \mbox{\hyperlink{kdbprivate_8h_a8634e58bc4cda4babdc73247fc55e25a}{elektra\+Error\+From\+Key}} (Key $\ast$key)
\begin{DoxyCompactList}\small\item\em Extracts the error and all warnings from the given key. \end{DoxyCompactList}\item 
Elektra\+Error $\ast$ \mbox{\hyperlink{kdbprivate_8h_a02947b47c6ddd80d97f76a52677aac4a}{elektra\+Error\+Key\+Not\+Found}} (const char $\ast$keyname)
\begin{DoxyCompactList}\small\item\em Creates a \char`\"{}\+Key not found\char`\"{} error. \end{DoxyCompactList}\item 
Elektra\+Error $\ast$ \mbox{\hyperlink{kdbprivate_8h_a4925bb1b9eb65b1be0cc46982888b4c4}{elektra\+Error\+Wrong\+Type}} (const char $\ast$keyname, KDBType expected\+Type, KDBType actual\+Type)
\begin{DoxyCompactList}\small\item\em Creates a \char`\"{}\+Wrong type\char`\"{} error. \end{DoxyCompactList}\item 
Elektra\+Error $\ast$ \mbox{\hyperlink{kdbprivate_8h_a69e23143abcac7e05dd2d1d9d42ddc66}{elektra\+Error\+Null\+Error}} (const char $\ast$function)
\begin{DoxyCompactList}\small\item\em Creates a \char`\"{}\+Null error argument\char`\"{} error. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Private declarations. 

\begin{DoxyCopyright}{Copyright}
BSD License (see LICENSE.\+md or \href{https://www.libelektra.org}{\texttt{ https\+://www.\+libelektra.\+org}}) 
\end{DoxyCopyright}


\doxysubsection{Macro Definition Documentation}
\mbox{\Hypertarget{kdbprivate_8h_a686cd59039c7112c10c8fbb82f9759e9}\label{kdbprivate_8h_a686cd59039c7112c10c8fbb82f9759e9}} 
\index{kdbprivate.h@{kdbprivate.h}!clear\_bit@{clear\_bit}}
\index{clear\_bit@{clear\_bit}!kdbprivate.h@{kdbprivate.h}}
\doxysubsubsection{\texorpdfstring{clear\_bit}{clear\_bit}}
{\footnotesize\ttfamily \#define clear\+\_\+bit(\begin{DoxyParamCaption}\item[{}]{var,  }\item[{}]{bit }\end{DoxyParamCaption})~((var) \&= $\sim$((unsigned long long) (bit)))}



Clear a bit. 

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{kdbprivate_8h_a4874f05226547f6afa54ed6d65dc54ae}{set\+\_\+bit()}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{kdbprivate_8h_a93f061df863d00deae4b596cb18b99f8}\label{kdbprivate_8h_a93f061df863d00deae4b596cb18b99f8}} 
\index{kdbprivate.h@{kdbprivate.h}!KDB\_MAX\_UCHAR@{KDB\_MAX\_UCHAR}}
\index{KDB\_MAX\_UCHAR@{KDB\_MAX\_UCHAR}!kdbprivate.h@{kdbprivate.h}}
\doxysubsubsection{\texorpdfstring{KDB\_MAX\_UCHAR}{KDB\_MAX\_UCHAR}}
{\footnotesize\ttfamily \#define KDB\+\_\+\+MAX\+\_\+\+UCHAR~(UCHAR\+\_\+\+MAX + 1)}



The maximum value of unsigned char+1, needed for iteration over trie children/values\+: 

for (i=0; i$<$KDB\+\_\+\+MAX\+\_\+\+UCHAR; ++i) \mbox{\Hypertarget{kdbprivate_8h_a8891eaf029de761514dca775f19d6e18}\label{kdbprivate_8h_a8891eaf029de761514dca775f19d6e18}} 
\index{kdbprivate.h@{kdbprivate.h}!KDB\_SYSTEM\_ELEKTRA@{KDB\_SYSTEM\_ELEKTRA}}
\index{KDB\_SYSTEM\_ELEKTRA@{KDB\_SYSTEM\_ELEKTRA}!kdbprivate.h@{kdbprivate.h}}
\doxysubsubsection{\texorpdfstring{KDB\_SYSTEM\_ELEKTRA}{KDB\_SYSTEM\_ELEKTRA}}
{\footnotesize\ttfamily \#define KDB\+\_\+\+SYSTEM\+\_\+\+ELEKTRA~\char`\"{}system\+:/elektra\char`\"{}}



Backend mounting information. 

This key directory tells you where each backend is mounted to which mountpoint. \mbox{\Hypertarget{kdbprivate_8h_acf20140d9b29c3edc782e72b05b25bd1}\label{kdbprivate_8h_acf20140d9b29c3edc782e72b05b25bd1}} 
\index{kdbprivate.h@{kdbprivate.h}!KEYSET\_SIZE@{KEYSET\_SIZE}}
\index{KEYSET\_SIZE@{KEYSET\_SIZE}!kdbprivate.h@{kdbprivate.h}}
\doxysubsubsection{\texorpdfstring{KEYSET\_SIZE}{KEYSET\_SIZE}}
{\footnotesize\ttfamily \#define KEYSET\+\_\+\+SIZE~16}



The minimal allocation size of a keyset inclusive NULL byte. 

ks\+Get\+Alloc() will return one less because it says how much can actually be stored. \mbox{\Hypertarget{kdbprivate_8h_a4874f05226547f6afa54ed6d65dc54ae}\label{kdbprivate_8h_a4874f05226547f6afa54ed6d65dc54ae}} 
\index{kdbprivate.h@{kdbprivate.h}!set\_bit@{set\_bit}}
\index{set\_bit@{set\_bit}!kdbprivate.h@{kdbprivate.h}}
\doxysubsubsection{\texorpdfstring{set\_bit}{set\_bit}}
{\footnotesize\ttfamily \#define set\+\_\+bit(\begin{DoxyParamCaption}\item[{}]{var,  }\item[{}]{bit }\end{DoxyParamCaption})~((var) $\vert$= ((unsigned long long) (bit)))}



Set a bit. 

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{kdbprivate_8h_a686cd59039c7112c10c8fbb82f9759e9}{clear\+\_\+bit()}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{kdbprivate_8h_a22e02bbe80b6081a6485b3f3d2caec14}\label{kdbprivate_8h_a22e02bbe80b6081a6485b3f3d2caec14}} 
\index{kdbprivate.h@{kdbprivate.h}!test\_bit@{test\_bit}}
\index{test\_bit@{test\_bit}!kdbprivate.h@{kdbprivate.h}}
\doxysubsubsection{\texorpdfstring{test\_bit}{test\_bit}}
{\footnotesize\ttfamily \#define test\+\_\+bit(\begin{DoxyParamCaption}\item[{}]{var,  }\item[{}]{bit }\end{DoxyParamCaption})~(((unsigned long long) (var)) \& ((unsigned long long) (bit)))}



Test a bit. 

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{kdbprivate_8h_a4874f05226547f6afa54ed6d65dc54ae}{set\+\_\+bit()}}, \mbox{\hyperlink{kdbprivate_8h_a686cd59039c7112c10c8fbb82f9759e9}{clear\+\_\+bit()}} 
\end{DoxySeeAlso}


\doxysubsection{Typedef Documentation}
\mbox{\Hypertarget{kdbprivate_8h_ada35c6e75f4c30868a2d86365d841dbb}\label{kdbprivate_8h_ada35c6e75f4c30868a2d86365d841dbb}} 
\index{kdbprivate.h@{kdbprivate.h}!BackendData@{BackendData}}
\index{BackendData@{BackendData}!kdbprivate.h@{kdbprivate.h}}
\doxysubsubsection{\texorpdfstring{BackendData}{BackendData}}
{\footnotesize\ttfamily typedef struct \+\_\+\+Backend\+Data \mbox{\hyperlink{kdbprivate_8h_ada35c6e75f4c30868a2d86365d841dbb}{Backend\+Data}}}



Holds all data for one backend. 

This struct is used for the key values in \+\_\+\+KDB.\+backends 

\doxysubsection{Function Documentation}
\mbox{\Hypertarget{kdbprivate_8h_a5b397979459c52ed2031d7b997679fca}\label{kdbprivate_8h_a5b397979459c52ed2031d7b997679fca}} 
\index{kdbprivate.h@{kdbprivate.h}!elektraErrorAddWarning@{elektraErrorAddWarning}}
\index{elektraErrorAddWarning@{elektraErrorAddWarning}!kdbprivate.h@{kdbprivate.h}}
\doxysubsubsection{\texorpdfstring{elektraErrorAddWarning()}{elektraErrorAddWarning()}}
{\footnotesize\ttfamily void elektra\+Error\+Add\+Warning (\begin{DoxyParamCaption}\item[{Elektra\+Error $\ast$}]{error,  }\item[{Elektra\+Error $\ast$}]{warning }\end{DoxyParamCaption})}



Adds a warning to an existing Elektra\+Error struct. 

If you want to report a warning without an error, create a dummy error with \mbox{\hyperlink{group__highlevel_ga4895fb4c40822a11219846b189395db0}{elektra\+Error\+Pure\+Warning()}} and then add a warning to it.


\begin{DoxyParams}{Parameters}
{\em error} & The error to which {\ttfamily warning} shall be added. \\
\hline
{\em warning} & The warning to add. Once added it is owned by {\ttfamily error}. DO NOT call \mbox{\hyperlink{group__highlevel_ga591f7ed4b57a341928bf7bb3d7adb693}{elektra\+Error\+Reset()}} on it afterwards. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{kdbprivate_8h_a0affd2cf7caf29441bf7cdf1d7cbb351}\label{kdbprivate_8h_a0affd2cf7caf29441bf7cdf1d7cbb351}} 
\index{kdbprivate.h@{kdbprivate.h}!elektraErrorCreate@{elektraErrorCreate}}
\index{elektraErrorCreate@{elektraErrorCreate}!kdbprivate.h@{kdbprivate.h}}
\doxysubsubsection{\texorpdfstring{elektraErrorCreate()}{elektraErrorCreate()}}
{\footnotesize\ttfamily Elektra\+Error$\ast$ elektra\+Error\+Create (\begin{DoxyParamCaption}\item[{const char $\ast$}]{code,  }\item[{const char $\ast$}]{description,  }\item[{const char $\ast$}]{module,  }\item[{const char $\ast$}]{file,  }\item[{kdb\+\_\+long\+\_\+t}]{line }\end{DoxyParamCaption})}



Creates a new Elektra\+Error using the provided values. 

The returned value will be allocated with \mbox{\hyperlink{internal_8c_a848ed030434c76176167fac6ab79429c}{elektra\+Calloc()}}.


\begin{DoxyParams}{Parameters}
{\em code} & The error code of the error. Will be copied and stored in the struct. \\
\hline
{\em description} & The description of the error. Will be copied and stored in the struct. \\
\hline
{\em module} & The module that raised the error. Will be copied and stored in the struct. \\
\hline
{\em file} & The file that raised the error. Will be copied and stored in the struct. \\
\hline
{\em line} & The line in which the error was raised.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A newly allocated Elektra\+Error (free with \mbox{\hyperlink{group__highlevel_ga591f7ed4b57a341928bf7bb3d7adb693}{elektra\+Error\+Reset()}}). 
\end{DoxyReturn}
\mbox{\Hypertarget{kdbprivate_8h_a8634e58bc4cda4babdc73247fc55e25a}\label{kdbprivate_8h_a8634e58bc4cda4babdc73247fc55e25a}} 
\index{kdbprivate.h@{kdbprivate.h}!elektraErrorFromKey@{elektraErrorFromKey}}
\index{elektraErrorFromKey@{elektraErrorFromKey}!kdbprivate.h@{kdbprivate.h}}
\doxysubsubsection{\texorpdfstring{elektraErrorFromKey()}{elektraErrorFromKey()}}
{\footnotesize\ttfamily Elektra\+Error$\ast$ elektra\+Error\+From\+Key (\begin{DoxyParamCaption}\item[{Key $\ast$}]{key }\end{DoxyParamCaption})}



Extracts the error and all warnings from the given key. 

If no error exists, a pure warning error will be used. \begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__highlevel_ga4895fb4c40822a11219846b189395db0}{elektra\+Error\+Pure\+Warning}}
\end{DoxySeeAlso}
\begin{DoxyNote}{Note}
Use the functions in \mbox{\hyperlink{errors_8c}{src/libs/elektra/errors.\+c}} to add errors to a key.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em key} & The to extract error and warnings from.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A newly allocated Elektra\+Error (free with \mbox{\hyperlink{group__highlevel_ga591f7ed4b57a341928bf7bb3d7adb693}{elektra\+Error\+Reset()}}). 
\end{DoxyReturn}
\mbox{\Hypertarget{kdbprivate_8h_a02947b47c6ddd80d97f76a52677aac4a}\label{kdbprivate_8h_a02947b47c6ddd80d97f76a52677aac4a}} 
\index{kdbprivate.h@{kdbprivate.h}!elektraErrorKeyNotFound@{elektraErrorKeyNotFound}}
\index{elektraErrorKeyNotFound@{elektraErrorKeyNotFound}!kdbprivate.h@{kdbprivate.h}}
\doxysubsubsection{\texorpdfstring{elektraErrorKeyNotFound()}{elektraErrorKeyNotFound()}}
{\footnotesize\ttfamily Elektra\+Error$\ast$ elektra\+Error\+Key\+Not\+Found (\begin{DoxyParamCaption}\item[{const char $\ast$}]{keyname }\end{DoxyParamCaption})}



Creates a \char`\"{}\+Key not found\char`\"{} error. 


\begin{DoxyParams}{Parameters}
{\em keyname} & The name of the key that wasn\textquotesingle{}t found.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A newly allocated Elektra\+Error (free with \mbox{\hyperlink{group__highlevel_ga591f7ed4b57a341928bf7bb3d7adb693}{elektra\+Error\+Reset()}}). 
\end{DoxyReturn}
\mbox{\Hypertarget{kdbprivate_8h_a69e23143abcac7e05dd2d1d9d42ddc66}\label{kdbprivate_8h_a69e23143abcac7e05dd2d1d9d42ddc66}} 
\index{kdbprivate.h@{kdbprivate.h}!elektraErrorNullError@{elektraErrorNullError}}
\index{elektraErrorNullError@{elektraErrorNullError}!kdbprivate.h@{kdbprivate.h}}
\doxysubsubsection{\texorpdfstring{elektraErrorNullError()}{elektraErrorNullError()}}
{\footnotesize\ttfamily Elektra\+Error$\ast$ elektra\+Error\+Null\+Error (\begin{DoxyParamCaption}\item[{const char $\ast$}]{function }\end{DoxyParamCaption})}



Creates a \char`\"{}\+Null error argument\char`\"{} error. 


\begin{DoxyParams}{Parameters}
{\em function} & The name of the function that was called with a null pointer error argument.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A newly allocated Elektra\+Error (free with \mbox{\hyperlink{group__highlevel_ga591f7ed4b57a341928bf7bb3d7adb693}{elektra\+Error\+Reset()}}). 
\end{DoxyReturn}
\mbox{\Hypertarget{kdbprivate_8h_a4925bb1b9eb65b1be0cc46982888b4c4}\label{kdbprivate_8h_a4925bb1b9eb65b1be0cc46982888b4c4}} 
\index{kdbprivate.h@{kdbprivate.h}!elektraErrorWrongType@{elektraErrorWrongType}}
\index{elektraErrorWrongType@{elektraErrorWrongType}!kdbprivate.h@{kdbprivate.h}}
\doxysubsubsection{\texorpdfstring{elektraErrorWrongType()}{elektraErrorWrongType()}}
{\footnotesize\ttfamily Elektra\+Error$\ast$ elektra\+Error\+Wrong\+Type (\begin{DoxyParamCaption}\item[{const char $\ast$}]{keyname,  }\item[{KDBType}]{expected\+Type,  }\item[{KDBType}]{actual\+Type }\end{DoxyParamCaption})}



Creates a \char`\"{}\+Wrong type\char`\"{} error. 


\begin{DoxyParams}{Parameters}
{\em keyname} & The name of the key that had the wrong type. \\
\hline
{\em expected\+Type} & The type that was expected. \\
\hline
{\em actual\+Type} & The type that was actually found.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A newly allocated Elektra\+Error (free with \mbox{\hyperlink{group__highlevel_ga591f7ed4b57a341928bf7bb3d7adb693}{elektra\+Error\+Reset()}}). 
\end{DoxyReturn}
\mbox{\Hypertarget{kdbprivate_8h_ad14db012d93631679d1aa26539d15770}\label{kdbprivate_8h_ad14db012d93631679d1aa26539d15770}} 
\index{kdbprivate.h@{kdbprivate.h}!elektraFindInternalNotificationPlugin@{elektraFindInternalNotificationPlugin}}
\index{elektraFindInternalNotificationPlugin@{elektraFindInternalNotificationPlugin}!kdbprivate.h@{kdbprivate.h}}
\doxysubsubsection{\texorpdfstring{elektraFindInternalNotificationPlugin()}{elektraFindInternalNotificationPlugin()}}
{\footnotesize\ttfamily Plugin$\ast$ elektra\+Find\+Internal\+Notification\+Plugin (\begin{DoxyParamCaption}\item[{KDB $\ast$}]{kdb }\end{DoxyParamCaption})}



This method looks for the hook plugin \textquotesingle{}internalnotification\textquotesingle{}. 


\begin{DoxyParams}{Parameters}
{\em kdb} & the KDB instance in which to search \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
NULL if not loaded, pointer to the plugin otherwise 
\end{DoxyReturn}
\mbox{\Hypertarget{kdbprivate_8h_a0edeebda49ef1ad7c054411a36a9bf38}\label{kdbprivate_8h_a0edeebda49ef1ad7c054411a36a9bf38}} 
\index{kdbprivate.h@{kdbprivate.h}!elektraKsPopAtCursor@{elektraKsPopAtCursor}}
\index{elektraKsPopAtCursor@{elektraKsPopAtCursor}!kdbprivate.h@{kdbprivate.h}}
\doxysubsubsection{\texorpdfstring{elektraKsPopAtCursor()}{elektraKsPopAtCursor()}}
{\footnotesize\ttfamily Key$\ast$ elektra\+Ks\+Pop\+At\+Cursor (\begin{DoxyParamCaption}\item[{Key\+Set $\ast$}]{ks,  }\item[{elektra\+Cursor}]{pos }\end{DoxyParamCaption})}



Pop key at given cursor position. 


\begin{DoxyParams}{Parameters}
{\em ks} & the keyset to pop key from \\
\hline
{\em c} & where to pop\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the popped key 
\end{DoxyReturn}

\begin{DoxyRetVals}{Return values}
{\em 0} & if ks is 0 \\
\hline
\end{DoxyRetVals}
\mbox{\Hypertarget{kdbprivate_8h_a6360a1271f6410f25fbb9b95e346da1a}\label{kdbprivate_8h_a6360a1271f6410f25fbb9b95e346da1a}} 
\index{kdbprivate.h@{kdbprivate.h}!elektraMemcpy@{elektraMemcpy}}
\index{elektraMemcpy@{elektraMemcpy}!kdbprivate.h@{kdbprivate.h}}
\doxysubsubsection{\texorpdfstring{elektraMemcpy()}{elektraMemcpy()}}
{\footnotesize\ttfamily ssize\+\_\+t elektra\+Memcpy (\begin{DoxyParamCaption}\item[{Key $\ast$$\ast$}]{array1,  }\item[{Key $\ast$$\ast$}]{array2,  }\item[{size\+\_\+t}]{size }\end{DoxyParamCaption})}



Internal Methods for Elektra. 

To use them\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <\mbox{\hyperlink{kdbinternal_8h}{kdbinternal.h}}>}}

\end{DoxyCode}


There are some areas where libraries have to reimplement some basic functions to archive support for non-\/standard systems, for testing purposes or to provide a little more convenience. Copies the key array2 into where array1 points. It copies size elements.

Overlapping is prohibited, use \mbox{\hyperlink{internal_8c_abc60bdbe5d252a99734b0122687560be}{elektra\+Memmove()}} instead.


\begin{DoxyParams}{Parameters}
{\em array1} & the destination \\
\hline
{\em array2} & the source \\
\hline
{\em size} & how many pointer to Keys to copy \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em -\/1} & on null pointers \\
\hline
{\em 0} & if nothing was done \\
\hline
\end{DoxyRetVals}
\begin{DoxyReturn}{Returns}
size how many keys were copied 
\end{DoxyReturn}
\mbox{\Hypertarget{kdbprivate_8h_abc60bdbe5d252a99734b0122687560be}\label{kdbprivate_8h_abc60bdbe5d252a99734b0122687560be}} 
\index{kdbprivate.h@{kdbprivate.h}!elektraMemmove@{elektraMemmove}}
\index{elektraMemmove@{elektraMemmove}!kdbprivate.h@{kdbprivate.h}}
\doxysubsubsection{\texorpdfstring{elektraMemmove()}{elektraMemmove()}}
{\footnotesize\ttfamily ssize\+\_\+t elektra\+Memmove (\begin{DoxyParamCaption}\item[{Key $\ast$$\ast$}]{array1,  }\item[{Key $\ast$$\ast$}]{array2,  }\item[{size\+\_\+t}]{size }\end{DoxyParamCaption})}



Copies the key array2 into where array1 points. 

It copies size elements.

Overlapping is ok. If they do not overlap consider \mbox{\hyperlink{internal_8c_a6360a1271f6410f25fbb9b95e346da1a}{elektra\+Memcpy()}} instead.


\begin{DoxyParams}{Parameters}
{\em array1} & the destination \\
\hline
{\em array2} & the source \\
\hline
{\em size} & how many pointer to Keys to copy \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em -\/1} & on null pointers \\
\hline
{\em 0} & if nothing was done \\
\hline
\end{DoxyRetVals}
\begin{DoxyReturn}{Returns}
size how many keys were copied 
\end{DoxyReturn}
\mbox{\Hypertarget{kdbprivate_8h_a9c44a58fa46e132d04a513ff9c453201}\label{kdbprivate_8h_a9c44a58fa46e132d04a513ff9c453201}} 
\index{kdbprivate.h@{kdbprivate.h}!elektraPluginGetFunction@{elektraPluginGetFunction}}
\index{elektraPluginGetFunction@{elektraPluginGetFunction}!kdbprivate.h@{kdbprivate.h}}
\doxysubsubsection{\texorpdfstring{elektraPluginGetFunction()}{elektraPluginGetFunction()}}
{\footnotesize\ttfamily size\+\_\+t elektra\+Plugin\+Get\+Function (\begin{DoxyParamCaption}\item[{Plugin $\ast$}]{plugin,  }\item[{const char $\ast$}]{name }\end{DoxyParamCaption})}



Retrieves a function exported by a plugin. 


\begin{DoxyParams}{Parameters}
{\em plugin} & Plugin handle \\
\hline
{\em name} & Function name. Must be a valid key name suffix. May not contain the sequence \textquotesingle{}..\textquotesingle{} \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Pointer to function. NULL if function not found or not enough memory available 
\end{DoxyReturn}
\mbox{\Hypertarget{kdbprivate_8h_a853bd9e11745f72b944d56e0c521e454}\label{kdbprivate_8h_a853bd9e11745f72b944d56e0c521e454}} 
\index{kdbprivate.h@{kdbprivate.h}!elektraPluginOpen@{elektraPluginOpen}}
\index{elektraPluginOpen@{elektraPluginOpen}!kdbprivate.h@{kdbprivate.h}}
\doxysubsubsection{\texorpdfstring{elektraPluginOpen()}{elektraPluginOpen()}}
{\footnotesize\ttfamily Plugin$\ast$ elektra\+Plugin\+Open (\begin{DoxyParamCaption}\item[{const char $\ast$}]{name,  }\item[{Key\+Set $\ast$}]{modules,  }\item[{Key\+Set $\ast$}]{config,  }\item[{Key $\ast$}]{error\+Key }\end{DoxyParamCaption})}



Opens a plugin. 

The config will be used as is. So be sure to transfer ownership of the config to it, with e.\+g. \mbox{\hyperlink{group__keyset_gac59e4b328245463f1451f68d5106151c}{ks\+Dup()}}. elektra\+Plugin\+Close() will delete the config.

\begin{DoxyReturn}{Returns}
a pointer to a new created plugin or 0 on error 
\end{DoxyReturn}
\mbox{\Hypertarget{kdbprivate_8h_a1578be51bff442159d04a5cfd3fbeb5a}\label{kdbprivate_8h_a1578be51bff442159d04a5cfd3fbeb5a}} 
\index{kdbprivate.h@{kdbprivate.h}!freeHooks@{freeHooks}}
\index{freeHooks@{freeHooks}!kdbprivate.h@{kdbprivate.h}}
\doxysubsubsection{\texorpdfstring{freeHooks()}{freeHooks()}}
{\footnotesize\ttfamily void free\+Hooks (\begin{DoxyParamCaption}\item[{KDB $\ast$}]{kdb,  }\item[{Key $\ast$}]{error\+Key }\end{DoxyParamCaption})}



Uninitializes and frees all hooks in the passed KDB handle. 


\begin{DoxyParams}{Parameters}
{\em kdb} & the KDB handle where the hooks should be freed \\
\hline
{\em error\+Key} & the key which holds errors and warnings which were issued \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{kdbprivate_8h_ae7bbcecc6ef81631ebfa94662f5c9b1a}\label{kdbprivate_8h_ae7bbcecc6ef81631ebfa94662f5c9b1a}} 
\index{kdbprivate.h@{kdbprivate.h}!initHooks@{initHooks}}
\index{initHooks@{initHooks}!kdbprivate.h@{kdbprivate.h}}
\doxysubsubsection{\texorpdfstring{initHooks()}{initHooks()}}
{\footnotesize\ttfamily int init\+Hooks (\begin{DoxyParamCaption}\item[{KDB $\ast$}]{kdb,  }\item[{const Key\+Set $\ast$}]{config,  }\item[{Key\+Set $\ast$}]{modules,  }\item[{const Key\+Set $\ast$}]{contract,  }\item[{Key $\ast$}]{error\+Key }\end{DoxyParamCaption})}



Initializes the hooks stored in the passed KDB handle. 

If the handle already contains initialized hooks, they will be reinitialized, including unloading and loading of their plugins. Parameters {\ttfamily config} and {\ttfamily contract} will be used to determine which hooks to populate.


\begin{DoxyParams}{Parameters}
{\em kdb} & the KDB instance where the hooks should be initialized \\
\hline
{\em config} & Key\+Set containing the current config in {\ttfamily system\+:/elektra} namespace \\
\hline
{\em modules} & the current list of loaded modules \\
\hline
{\em contract} & the contract passed to {\ttfamily kdb\+Open} \\
\hline
{\em error\+Key} & the key which holds errors and warnings which were issued \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, -\/1 on failure 
\end{DoxyReturn}
