\hypertarget{interfaceorg_1_1libelektra_1_1Elektra}{}\doxysection{org.\+libelektra.\+Elektra Interface Reference}
\label{interfaceorg_1_1libelektra_1_1Elektra}\index{org.libelektra.Elektra@{org.libelektra.Elektra}}


The JNA dynamic proxy interface to libelektra.  




Inherits Library.

\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
Pointer \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a32639cf92429fe65bf3744a007d8647f}{kdb\+Open}} (@Nullable Pointer contract\+Key\+Set, Pointer error\+Key)
\begin{DoxyCompactList}\small\item\em Opens the session with the \mbox{\hyperlink{classorg_1_1libelektra_1_1Key}{Key}} database. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a60cf0c7cefd0a6a34b4608bdc5eded4b}{kdb\+Close}} (Pointer handle, Pointer error\+Key)
\begin{DoxyCompactList}\small\item\em Closes the session with the \mbox{\hyperlink{classorg_1_1libelektra_1_1Key}{Key}} database. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a09ad2a446a215b6cce4cfb31d9871ac2}{kdb\+Get}} (Pointer handle, Pointer return\+Key\+Set, Pointer parent\+Key)
\begin{DoxyCompactList}\small\item\em Retrieve keys in an atomic and universal way. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a7b69b22fd8b712891d188215707e0540}{kdb\+Set}} (Pointer handle, Pointer key\+Set, Pointer parent\+Key)
\begin{DoxyCompactList}\small\item\em Set keys in an atomic and universal way. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_aba251761ea3e25ba205df77f7729e1bf}{elektra\+GOpts\+Contract\+From\+Strings}} (Pointer contract\+Key\+Set, long args\+Size, String args, long env\+Size, String env, Pointer parent\+Key, @Nullable Pointer gopts\+Config\+Key\+Set)
\begin{DoxyCompactList}\small\item\em Sets up a contract for use with \mbox{\hyperlink{}{kdb\+Open()}} that configures the. \end{DoxyCompactList}\item 
Pointer \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_ae437441010a3a634a39107e37808cbd1}{key\+New}} (@Nullable String name, @Nullable Object... args)
\begin{DoxyCompactList}\small\item\em A practical way to fully create a \mbox{\hyperlink{classorg_1_1libelektra_1_1Key}{Key}} object in one step. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{interfaceorg_1_1libelektra_1_1Elektra_a5a69a68a26ccec272c0f992f0a94a4cc}\label{interfaceorg_1_1libelektra_1_1Elektra_a5a69a68a26ccec272c0f992f0a94a4cc}} 
\mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra}{Elektra}} \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a5a69a68a26ccec272c0f992f0a94a4cc}{INSTANCE}} = Native.\+load (\char`\"{}elektra-\/kdb\char`\"{}, Elektra.\+class)
\begin{DoxyCompactList}\small\item\em Singleton instance of the native library proxy. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
The JNA dynamic proxy interface to libelektra. 

This proxy is not intended to be used directly by libelektra API consumers. Please see \mbox{\hyperlink{classorg_1_1libelektra_1_1KDB}{KDB}} and its accompanying classes. 

\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{interfaceorg_1_1libelektra_1_1Elektra_aba251761ea3e25ba205df77f7729e1bf}\label{interfaceorg_1_1libelektra_1_1Elektra_aba251761ea3e25ba205df77f7729e1bf}} 
\index{org.libelektra.Elektra@{org.libelektra.Elektra}!elektraGOptsContractFromStrings@{elektraGOptsContractFromStrings}}
\index{elektraGOptsContractFromStrings@{elektraGOptsContractFromStrings}!org.libelektra.Elektra@{org.libelektra.Elektra}}
\doxysubsubsection{\texorpdfstring{elektraGOptsContractFromStrings()}{elektraGOptsContractFromStrings()}}
{\footnotesize\ttfamily int org.\+libelektra.\+Elektra.\+elektra\+GOpts\+Contract\+From\+Strings (\begin{DoxyParamCaption}\item[{Pointer}]{contract\+Key\+Set,  }\item[{long}]{args\+Size,  }\item[{String}]{args,  }\item[{long}]{env\+Size,  }\item[{String}]{env,  }\item[{Pointer}]{parent\+Key,  }\item[{@Nullable Pointer}]{gopts\+Config\+Key\+Set }\end{DoxyParamCaption})}



Sets up a contract for use with \mbox{\hyperlink{}{kdb\+Open()}} that configures the. 


\begin{DoxyCode}{0}
\DoxyCodeLine{gopts }

\end{DoxyCode}
 plugin.


\begin{DoxyParams}{Parameters}
{\em contract\+Key\+Set} & \mbox{\hyperlink{}{Pointer}} to a valid
\begin{DoxyCode}{1}
\DoxyCodeLine{KeySet }

\end{DoxyCode}
 into which the contract will be written. \\
\hline
{\em args\+Size} & Size of the
\begin{DoxyCode}{1}
\DoxyCodeLine{args }

\end{DoxyCode}
 data. \\
\hline
{\em args} & Continuous buffer containing all
\begin{DoxyCode}{1}
\DoxyCodeLine{argv }

\end{DoxyCode}
 arguments separated (and terminated) by zero bytes. The whole buffer is copied, so the pointer only has to be valid for this function call. \\
\hline
{\em env\+Size} & Size of the
\begin{DoxyCode}{1}
\DoxyCodeLine{env }

\end{DoxyCode}
 data. \\
\hline
{\em env} & Continuous buffer containing all environment variables separated (and terminated) by zero bytes The whole buffer is copied, so the pointer only has to be valid for this function call. \\
\hline
{\em parent\+Key} & The parent key that should be used by
\begin{DoxyCode}{1}
\DoxyCodeLine{gopts }

\end{DoxyCode}
 . Only the key name is copied. The key can be deleted immediately after calling this function. \\
\hline
{\em gopts\+Config\+Key\+Set} & Configuration that is used to mount the 
\begin{DoxyCode}{1}
\DoxyCodeLine{gopts }

\end{DoxyCode}
 plugin. Only keys in the 
\begin{DoxyCode}{1}
\DoxyCodeLine{user:/ }

\end{DoxyCode}
 namespace will be used. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 
\begin{DoxyCode}{0}
\DoxyCodeLine{0 }

\end{DoxyCode}
 on success 
\item 
\begin{DoxyCode}{0}
\DoxyCodeLine{-\/1 }

\end{DoxyCode}
 on
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{null} }

\end{DoxyCode}
 pointer passed 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceorg_1_1libelektra_1_1Elektra_a60cf0c7cefd0a6a34b4608bdc5eded4b}\label{interfaceorg_1_1libelektra_1_1Elektra_a60cf0c7cefd0a6a34b4608bdc5eded4b}} 
\index{org.libelektra.Elektra@{org.libelektra.Elektra}!kdbClose@{kdbClose}}
\index{kdbClose@{kdbClose}!org.libelektra.Elektra@{org.libelektra.Elektra}}
\doxysubsubsection{\texorpdfstring{kdbClose()}{kdbClose()}}
{\footnotesize\ttfamily int org.\+libelektra.\+Elektra.\+kdb\+Close (\begin{DoxyParamCaption}\item[{Pointer}]{handle,  }\item[{Pointer}]{error\+Key }\end{DoxyParamCaption})}



Closes the session with the \mbox{\hyperlink{classorg_1_1libelektra_1_1Key}{Key}} database. 

~\newline
 ~\newline
 You must call this method when you finished your affairs with the key database. You can still manipulate
\begin{DoxyCode}{0}
\DoxyCodeLine{Key }

\end{DoxyCode}
 and
\begin{DoxyCode}{0}
\DoxyCodeLine{KeySet }

\end{DoxyCode}
 objects after calling
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{preprocessor}{\#kdbClose(Pointer, Pointer) }}

\end{DoxyCode}
 , but you must not use any 
\begin{DoxyCode}{0}
\DoxyCodeLine{\mbox{\hyperlink{namespacekdb}{kdb}}*() }

\end{DoxyCode}
 call afterwards.~\newline


\begin{DoxySeeAlso}{See also}
\#kdb\+Open(\+Pointer, Pointer) \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a32639cf92429fe65bf3744a007d8647f}{kdb\+Open()}} 

\#key\+New(\+String, Object...) \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_ae437441010a3a634a39107e37808cbd1}{key\+New()}}
\end{DoxySeeAlso}

\begin{DoxyParams}{Parameters}
{\em handle} & \mbox{\hyperlink{}{Pointer}} to a valid
\begin{DoxyCode}{1}
\DoxyCodeLine{KDB handle }

\end{DoxyCode}
 as returned by \mbox{\hyperlink{}{kdb\+Open()}}. \\
\hline
{\em error\+Key} & \mbox{\hyperlink{}{Pointer}} to a valid
\begin{DoxyCode}{1}
\DoxyCodeLine{Key }

\end{DoxyCode}
 , where issued errors and warnings will be made available. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 
\begin{DoxyCode}{0}
\DoxyCodeLine{0 }

\end{DoxyCode}
 on success 
\item 
\begin{DoxyCode}{0}
\DoxyCodeLine{-\/1 }

\end{DoxyCode}
 on
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{null} }

\end{DoxyCode}
 pointer passed 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceorg_1_1libelektra_1_1Elektra_a09ad2a446a215b6cce4cfb31d9871ac2}\label{interfaceorg_1_1libelektra_1_1Elektra_a09ad2a446a215b6cce4cfb31d9871ac2}} 
\index{org.libelektra.Elektra@{org.libelektra.Elektra}!kdbGet@{kdbGet}}
\index{kdbGet@{kdbGet}!org.libelektra.Elektra@{org.libelektra.Elektra}}
\doxysubsubsection{\texorpdfstring{kdbGet()}{kdbGet()}}
{\footnotesize\ttfamily int org.\+libelektra.\+Elektra.\+kdb\+Get (\begin{DoxyParamCaption}\item[{Pointer}]{handle,  }\item[{Pointer}]{return\+Key\+Set,  }\item[{Pointer}]{parent\+Key }\end{DoxyParamCaption})}



Retrieve keys in an atomic and universal way. 

~\newline
 ~\newline
 The
\begin{DoxyCode}{0}
\DoxyCodeLine{returnKeySet }

\end{DoxyCode}
 may already contain some keys, e.\+g. from previous \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a09ad2a446a215b6cce4cfb31d9871ac2}{kdb\+Get()}} calls. The new retrieved keys will be appended using the native function underlying \mbox{\hyperlink{}{ks\+Append\+Key()}}.

@api\+Note \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a09ad2a446a215b6cce4cfb31d9871ac2}{kdb\+Get()}} might retrieve more keys than requested (that are not below parent\+Key). These keys must be passed to when saving modifications via \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a7b69b22fd8b712891d188215707e0540}{kdb\+Set()}}, otherwise they will be lost. This stems from the fact that the user has the only copy of the whole configuration and backends only write configuration that was passed to them. For example, if you get 
\begin{DoxyCode}{0}
\DoxyCodeLine{system:/mountpoint/interest }

\end{DoxyCode}
 you will not only get all keys below
\begin{DoxyCode}{0}
\DoxyCodeLine{system:/mountpoint/interest }

\end{DoxyCode}
 , but also all keys below 
\begin{DoxyCode}{0}
\DoxyCodeLine{system:/mountpoint }

\end{DoxyCode}
 (if
\begin{DoxyCode}{0}
\DoxyCodeLine{system:/mountpoint }

\end{DoxyCode}
 is a mountpoint as the name suggests, but 
\begin{DoxyCode}{0}
\DoxyCodeLine{system:/mountpoint/interest }

\end{DoxyCode}
 is not a mountpoint). Make sure to not touch or remove keys outside the keys of interest, because others may need them!

@impl\+Note Optimization\+: In the first run of \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a09ad2a446a215b6cce4cfb31d9871ac2}{kdb\+Get()}} all requested (or more) keys are retrieved. On subsequent calls only the keys are retrieved where something was changed inside the key database. The other keys stay in the
\begin{DoxyCode}{0}
\DoxyCodeLine{KeySet }

\end{DoxyCode}
 returned as passed.

\begin{DoxySeeAlso}{See also}
\#kdb\+Open(\+Pointer, Pointer) \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a32639cf92429fe65bf3744a007d8647f}{kdb\+Open()}} which needs to be called before 

\#ks\+Lookup(\+Pointer, Pointer, int) \mbox{\hyperlink{group__keyset_ga60f1ddcf23272f2b29b90e92ebe9b56f}{ks\+Lookup()}} and 

\#ks\+Lookup\+By\+Name(\+Pointer, String, int) \mbox{\hyperlink{group__keyset_gad65d2cdcbb5381194a1688e169af8a83}{ks\+Lookup\+By\+Name()}} for powerful lookups after the
\begin{DoxyCode}{0}
\DoxyCodeLine{KeySet }

\end{DoxyCode}
 was retrieved 

\mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a7b69b22fd8b712891d188215707e0540}{kdb\+Set(\+Pointer, Pointer, Pointer)}} \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a7b69b22fd8b712891d188215707e0540}{kdb\+Set()}} to save the configuration afterwards 

\mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a60cf0c7cefd0a6a34b4608bdc5eded4b}{kdb\+Close(\+Pointer, Pointer)}} \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a60cf0c7cefd0a6a34b4608bdc5eded4b}{kdb\+Close()}} to finish affairs with the \mbox{\hyperlink{group__key}{Key}} database
\end{DoxySeeAlso}

\begin{DoxyParams}{Parameters}
{\em handle} & \mbox{\hyperlink{}{Pointer}} to a valid
\begin{DoxyCode}{1}
\DoxyCodeLine{KDB handle }

\end{DoxyCode}
 as returned by \mbox{\hyperlink{}{kdb\+Open()}}. \\
\hline
{\em return\+Key\+Set} & \mbox{\hyperlink{}{Pointer}} to a valid
\begin{DoxyCode}{1}
\DoxyCodeLine{KeySet }

\end{DoxyCode}
 to be populated with all keys found. It will not be changed on error or if no update is required. \\
\hline
{\em parent\+Key} & \mbox{\hyperlink{}{Pointer}} to a valid
\begin{DoxyCode}{1}
\DoxyCodeLine{Key }

\end{DoxyCode}
 . It is used to add warnings and set an error information. Additionally, its name is a hint which keys should be retrieved (it is possible that more are retrieved, see API Note). 
\begin{DoxyItemize}
\item cascading keys (starting with \char`\"{}/\char`\"{}) will retrieve the same path in all namespaces 
\item \char`\"{}/\char`\"{} will retrieve all keys. 
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 
\begin{DoxyCode}{0}
\DoxyCodeLine{1 }

\end{DoxyCode}
 if the keys were retrieved successfully 
\item 
\begin{DoxyCode}{0}
\DoxyCodeLine{0 }

\end{DoxyCode}
 if there was no update 
\item 
\begin{DoxyCode}{0}
\DoxyCodeLine{-\/1 }

\end{DoxyCode}
 on failure or
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{null} }

\end{DoxyCode}
 pointer passed 
\end{DoxyItemize}When a backend fails, \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a09ad2a446a215b6cce4cfb31d9871ac2}{kdb\+Get()}} will return
\begin{DoxyCode}{0}
\DoxyCodeLine{-\/1 }

\end{DoxyCode}
 with all error and warning information in the
\begin{DoxyCode}{0}
\DoxyCodeLine{parentKey }

\end{DoxyCode}
 and
\begin{DoxyCode}{0}
\DoxyCodeLine{returnKeySet }

\end{DoxyCode}
 left unchanged. 
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceorg_1_1libelektra_1_1Elektra_a32639cf92429fe65bf3744a007d8647f}\label{interfaceorg_1_1libelektra_1_1Elektra_a32639cf92429fe65bf3744a007d8647f}} 
\index{org.libelektra.Elektra@{org.libelektra.Elektra}!kdbOpen@{kdbOpen}}
\index{kdbOpen@{kdbOpen}!org.libelektra.Elektra@{org.libelektra.Elektra}}
\doxysubsubsection{\texorpdfstring{kdbOpen()}{kdbOpen()}}
{\footnotesize\ttfamily Pointer org.\+libelektra.\+Elektra.\+kdb\+Open (\begin{DoxyParamCaption}\item[{@Nullable Pointer}]{contract\+Key\+Set,  }\item[{Pointer}]{error\+Key }\end{DoxyParamCaption})}



Opens the session with the \mbox{\hyperlink{classorg_1_1libelektra_1_1Key}{Key}} database. 

~\newline
 ~\newline
 You must always call this method before retrieving or committing any keys to the database. In the end of the program, after using the key database, you must not forget to \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a60cf0c7cefd0a6a34b4608bdc5eded4b}{kdb\+Close()}}.~\newline
 ~\newline
 Get a
\begin{DoxyCode}{0}
\DoxyCodeLine{KDB handle }

\end{DoxyCode}
 for every thread using \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra}{Elektra}}. Don\textquotesingle{}t share the handle across threads, and also not the pointer accessing it.~\newline
 ~\newline
 You don\textquotesingle{}t need \mbox{\hyperlink{}{kdb\+Open()}} if you only want to manipulate plain in-\/memory
\begin{DoxyCode}{0}
\DoxyCodeLine{Key }

\end{DoxyCode}
 or
\begin{DoxyCode}{0}
\DoxyCodeLine{KeySet }

\end{DoxyCode}
 objects.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a09ad2a446a215b6cce4cfb31d9871ac2}{kdb\+Get(\+Pointer, Pointer, Pointer)}} \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a09ad2a446a215b6cce4cfb31d9871ac2}{kdb\+Get()}} 

\mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a60cf0c7cefd0a6a34b4608bdc5eded4b}{kdb\+Close(\+Pointer, Pointer)}} \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a60cf0c7cefd0a6a34b4608bdc5eded4b}{kdb\+Close()}} 

\#key\+New(\+String, Object...) \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_ae437441010a3a634a39107e37808cbd1}{key\+New()}}
\end{DoxySeeAlso}

\begin{DoxyParams}{Parameters}
{\em contract\+Key\+Set} & TODO \#3754 -\/ documentation unclear -\/ the contract that should be ensured before opening the \mbox{\hyperlink{classorg_1_1libelektra_1_1KDB}{KDB}} all data is copied and the \mbox{\hyperlink{classorg_1_1libelektra_1_1KeySet}{Key\+Set}} can safely be used for e.\+g. \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a09ad2a446a215b6cce4cfb31d9871ac2}{kdb\+Get()}} later \\
\hline
{\em error\+Key} & \mbox{\hyperlink{}{Pointer}} to a valid
\begin{DoxyCode}{1}
\DoxyCodeLine{Key }

\end{DoxyCode}
 , where issued errors and warnings will be made available. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item \mbox{\hyperlink{}{Pointer}} to
\begin{DoxyCode}{0}
\DoxyCodeLine{KDB handle }

\end{DoxyCode}
 on success 
\item 
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{null} }

\end{DoxyCode}
 on failure 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceorg_1_1libelektra_1_1Elektra_a7b69b22fd8b712891d188215707e0540}\label{interfaceorg_1_1libelektra_1_1Elektra_a7b69b22fd8b712891d188215707e0540}} 
\index{org.libelektra.Elektra@{org.libelektra.Elektra}!kdbSet@{kdbSet}}
\index{kdbSet@{kdbSet}!org.libelektra.Elektra@{org.libelektra.Elektra}}
\doxysubsubsection{\texorpdfstring{kdbSet()}{kdbSet()}}
{\footnotesize\ttfamily int org.\+libelektra.\+Elektra.\+kdb\+Set (\begin{DoxyParamCaption}\item[{Pointer}]{handle,  }\item[{Pointer}]{key\+Set,  }\item[{Pointer}]{parent\+Key }\end{DoxyParamCaption})}



Set keys in an atomic and universal way. 

~\newline
 ~\newline
 For the particularities of error handling, please see the documentation of the native library\+: TODO \#3754 link to C API documentation

@api\+Note \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a09ad2a446a215b6cce4cfb31d9871ac2}{kdb\+Get()}} must be called before \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a7b69b22fd8b712891d188215707e0540}{kdb\+Set()}}\+: initially (after \mbox{\hyperlink{}{kdb\+Open()}}) and also after conflict errors in \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a7b69b22fd8b712891d188215707e0540}{kdb\+Set()}}.

@impl\+Note Optimization\+: Each key is checked using the native function underlying \mbox{\hyperlink{}{key\+Need\+Sync()}} before being actually committed. If no key of a backend needs to be synced any affairs to backends are omitted and
\begin{DoxyCode}{0}
\DoxyCodeLine{0 }

\end{DoxyCode}
 is returned.~\newline
 It is your responsibility to save the original keyset if you need it afterwards.~\newline
 If you want to be sure to get a fresh keyset again, you need to open a second handle to the key database using \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a32639cf92429fe65bf3744a007d8647f}{kdb\+Open()}}.

\begin{DoxySeeAlso}{See also}
\#key\+Need\+Sync(\+Pointer) \mbox{\hyperlink{group__keytest_gaf247df0de7aca04b32ef80e39ef12950}{key\+Need\+Sync()}} 

\#kdb\+Open(\+Pointer, Pointer) kdbopen() and 

\mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a09ad2a446a215b6cce4cfb31d9871ac2}{kdb\+Get(\+Pointer, Pointer, Pointer)}} \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a09ad2a446a215b6cce4cfb31d9871ac2}{kdb\+Get()}} must be called first 

\mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a60cf0c7cefd0a6a34b4608bdc5eded4b}{kdb\+Close(\+Pointer, Pointer)}} \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a60cf0c7cefd0a6a34b4608bdc5eded4b}{kdb\+Close()}} must be called afterwards
\end{DoxySeeAlso}

\begin{DoxyParams}{Parameters}
{\em handle} & \mbox{\hyperlink{}{Pointer}} to a valid
\begin{DoxyCode}{1}
\DoxyCodeLine{KDB handle }

\end{DoxyCode}
 as returned by \mbox{\hyperlink{}{kdb\+Open()}}. \\
\hline
{\em key\+Set} & \mbox{\hyperlink{}{Pointer}} to a valid
\begin{DoxyCode}{1}
\DoxyCodeLine{KeySet }

\end{DoxyCode}
 containing modified keys, otherwise no update is done. \\
\hline
{\em parent\+Key} & \mbox{\hyperlink{}{Pointer}} to a valid
\begin{DoxyCode}{1}
\DoxyCodeLine{Key }

\end{DoxyCode}
 . It is used to add warnings and set an error information. Additionally, its name is an hint which keys should be committed (it is possible that more are changed).~\newline
 With
\begin{DoxyCode}{1}
\DoxyCodeLine{parentKey }

\end{DoxyCode}
 you can give an hint which part of the given
\begin{DoxyCode}{1}
\DoxyCodeLine{KeySet }

\end{DoxyCode}
 is of interest to you. Then you promise to only modify or remove keys below this key. All others would be passed back as they were retrieved by \mbox{\hyperlink{interfaceorg_1_1libelektra_1_1Elektra_a09ad2a446a215b6cce4cfb31d9871ac2}{kdb\+Get()}}. 
\begin{DoxyItemize}
\item cascading keys (starting with \char`\"{}/\char`\"{}) will set the path in all namespaces 
\item \char`\"{}/\char`\"{} will commit all keys 
\item metanames will be rejected (error C01320) 
\item empty/invalid (error C01320) 
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 
\begin{DoxyCode}{0}
\DoxyCodeLine{1 }

\end{DoxyCode}
 on success 
\item 
\begin{DoxyCode}{0}
\DoxyCodeLine{0 }

\end{DoxyCode}
 if nothing had to be done, no changes in \mbox{\hyperlink{classorg_1_1libelektra_1_1KDB}{KDB}} 
\item 
\begin{DoxyCode}{0}
\DoxyCodeLine{-\/1 }

\end{DoxyCode}
 on failure or
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{null} }

\end{DoxyCode}
 pointer passed. No changes in \mbox{\hyperlink{classorg_1_1libelektra_1_1KDB}{KDB}}, an error will be set on
\begin{DoxyCode}{0}
\DoxyCodeLine{parentKey }

\end{DoxyCode}
 if possible 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceorg_1_1libelektra_1_1Elektra_ae437441010a3a634a39107e37808cbd1}\label{interfaceorg_1_1libelektra_1_1Elektra_ae437441010a3a634a39107e37808cbd1}} 
\index{org.libelektra.Elektra@{org.libelektra.Elektra}!keyNew@{keyNew}}
\index{keyNew@{keyNew}!org.libelektra.Elektra@{org.libelektra.Elektra}}
\doxysubsubsection{\texorpdfstring{keyNew()}{keyNew()}}
{\footnotesize\ttfamily Pointer org.\+libelektra.\+Elektra.\+key\+New (\begin{DoxyParamCaption}\item[{@Nullable String}]{name,  }\item[{@Nullable Object...}]{args }\end{DoxyParamCaption})}



A practical way to fully create a \mbox{\hyperlink{classorg_1_1libelektra_1_1Key}{Key}} object in one step. 

~\newline
 ~\newline
 For examples and further particularities, please see the documentation of the native library\+: TODO \#3754 link to C API documentation

\begin{DoxySeeAlso}{See also}
\#key\+Del(\+Pointer) \mbox{\hyperlink{group__key_ga3df95bbc2494e3e6703ece5639be5bb1}{key\+Del()}}
\end{DoxySeeAlso}

\begin{DoxyParams}{Parameters}
{\em name} & A valid name to the key, or \mbox{\hyperlink{}{KEY\+\_\+\+NAME\+\_\+\+SIMPLE\+\_\+\+INITALIZED\+\_\+\+BUT\+\_\+\+EMPTY\+\_\+\+OBJECT}} to get a simple initialized, but really empty, object. \\
\hline
{\em args} & Argument flags, each followed by a corresponding value, if appropriate. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item A \mbox{\hyperlink{}{Pointer}} to a newly allocated and initialized 
\begin{DoxyCode}{0}
\DoxyCodeLine{Key }

\end{DoxyCode}
 object on success 
\item 
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{null} }

\end{DoxyCode}
 on allocation error or if an invalid
\begin{DoxyCode}{0}
\DoxyCodeLine{name }

\end{DoxyCode}
 was passed (see \mbox{\hyperlink{}{key\+Set\+Name()}} 
\end{DoxyItemize}
\end{DoxyReturn}


The documentation for this interface was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
Elektra.\+java\end{DoxyCompactItemize}
