\hypertarget{split_8c}{\section{split.\+c File Reference}
\label{split_8c}\index{split.\+c@{split.\+c}}
}


Interna of splitting functionality.  


{\ttfamily \#include $<$kdberrors.\+h$>$}\\*
{\ttfamily \#include $<$kdbinternal.\+h$>$}\\*
Include dependency graph for split.\+c\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{split_8c__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
Split $\ast$ \hyperlink{split_8c_ad2245a38809f28e325cd9b32089b4c68}{elektra\+Split\+New} (void)
\begin{DoxyCompactList}\small\item\em Allocates a new split object. \end{DoxyCompactList}\item 
void \hyperlink{split_8c_ae569ef1bc4cd8e931b4a7840d8ce48e6}{elektra\+Split\+Del} (Split $\ast$keysets)
\begin{DoxyCompactList}\small\item\em Delete a split object. \end{DoxyCompactList}\item 
void \hyperlink{split_8c_ab6067083cc1afb5d42180bf75f7f86ef}{elektra\+Split\+Remove} (Split $\ast$split, size\+\_\+t where)
\begin{DoxyCompactList}\small\item\em Remove one part of split. \end{DoxyCompactList}\item 
void \hyperlink{split_8c_a9816931521a6a16bd553c08abb957c62}{elektra\+Split\+Resize} (Split $\ast$split)
\begin{DoxyCompactList}\small\item\em Doubles the size of how many parts of keysets can be appended. \end{DoxyCompactList}\item 
ssize\+\_\+t \hyperlink{split_8c_a0c8c5c6c26aa42404d8aa06e6476a0f6}{elektra\+Split\+Append} (Split $\ast$split, Backend $\ast$backend, Key $\ast$parent\+Key, int syncbits)
\begin{DoxyCompactList}\small\item\em Increases the size of split and appends a new empty keyset. \end{DoxyCompactList}\item 
ssize\+\_\+t \hyperlink{split_8c_a887dd183bf21c635c6993cd480ff3b21}{elektra\+Split\+Search\+Backend} (Split $\ast$split, Backend $\ast$backend, Key $\ast$parent)
\begin{DoxyCompactList}\small\item\em Determines if the backend is already inserted or not. \end{DoxyCompactList}\item 
int \hyperlink{split_8c_afb25e1f946f07e5490a962a42320a0cc}{elektra\+Split\+Search\+Root} (Split $\ast$split, Key $\ast$parent\+Key)
\item 
int \hyperlink{split_8c_aabebbc4b0e47527f59942fcf95b9fcb5}{elektra\+Split\+Buildup} (Split $\ast$split, K\+D\+B $\ast$kdb, Key $\ast$parent\+Key)
\begin{DoxyCompactList}\small\item\em Walks through kdb-\/$>$split and adds all backends below parent\+Key to split. \end{DoxyCompactList}\item 
int \hyperlink{split_8c_a447e430a045cef7b107762171fbdc104}{elektra\+Split\+Divide} (Split $\ast$split, K\+D\+B $\ast$handle, Key\+Set $\ast$ks)
\begin{DoxyCompactList}\small\item\em Splits up the keysets and search for a sync bit in every key. \end{DoxyCompactList}\item 
void \hyperlink{split_8c_a5dde14941040fe97dd036555e858bb69}{elektra\+Split\+Update\+File\+Name} (Split $\ast$split, K\+D\+B $\ast$handle, Key $\ast$key)
\begin{DoxyCompactList}\small\item\em Update the (configuration) file name for the parent key. \end{DoxyCompactList}\item 
int \hyperlink{split_8c_afee68d5935a6875ece69945e32242895}{elektra\+Split\+Appoint} (Split $\ast$split, K\+D\+B $\ast$handle, Key\+Set $\ast$ks)
\begin{DoxyCompactList}\small\item\em Appoints all keys from ks to yet unsynced splits. \end{DoxyCompactList}\item 
int \hyperlink{split_8c_ab9abad2c6146816e966976d9f18f0c88}{elektra\+Split\+Get} (Split $\ast$split, Key $\ast$warning\+Key, K\+D\+B $\ast$handle)
\begin{DoxyCompactList}\small\item\em Does some work after getting of backends is finished. \end{DoxyCompactList}\item 
int \hyperlink{split_8c_a603c8c0fce6da478623a68367e2c7175}{elektra\+Split\+Check\+Size} (Split $\ast$split)
\begin{DoxyCompactList}\small\item\em Check if any of the split is uninitialized. \end{DoxyCompactList}\item 
int \hyperlink{split_8c_af7619472c17c782befa93d2e029bc328}{elektra\+Split\+Update\+Size} (Split $\ast$split)
\begin{DoxyCompactList}\small\item\em Also update sizes after \hyperlink{group__kdb_ga11436b058408f83d303ca5e996832bcf}{kdb\+Set()} to recognize multiple \hyperlink{group__kdb_ga11436b058408f83d303ca5e996832bcf}{kdb\+Set()} attempts. \end{DoxyCompactList}\item 
int \hyperlink{split_8c_af3b1e5f1810964dddc3bd3a00822bca6}{elektra\+Split\+Merge} (Split $\ast$split, Key\+Set $\ast$dest)
\begin{DoxyCompactList}\small\item\em Merges together all parts of split into dest. \end{DoxyCompactList}\item 
int \hyperlink{split_8c_a3176eff9c1b5a9bfcf3d2e648f537993}{elektra\+Split\+Sync} (Split $\ast$split)
\begin{DoxyCompactList}\small\item\em Add sync bits everywhere keys were removed/added. \end{DoxyCompactList}\item 
void \hyperlink{split_8c_a44f9f801daa8ff1b29e48e31e49752f7}{elektra\+Split\+Prepare} (Split $\ast$split)
\begin{DoxyCompactList}\small\item\em Prepares for \hyperlink{group__kdb_ga11436b058408f83d303ca5e996832bcf}{kdb\+Set()} mainloop afterwards. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Interna of splitting 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{split_8c_a0c8c5c6c26aa42404d8aa06e6476a0f6}{\index{split.\+c@{split.\+c}!elektra\+Split\+Append@{elektra\+Split\+Append}}
\index{elektra\+Split\+Append@{elektra\+Split\+Append}!split.\+c@{split.\+c}}
\subsubsection[{elektra\+Split\+Append}]{\setlength{\rightskip}{0pt plus 5cm}ssize\+\_\+t elektra\+Split\+Append (
\begin{DoxyParamCaption}
\item[{Split $\ast$}]{split, }
\item[{Backend $\ast$}]{backend, }
\item[{Key $\ast$}]{parent\+Key, }
\item[{int}]{syncbits}
\end{DoxyParamCaption}
)}}\label{split_8c_a0c8c5c6c26aa42404d8aa06e6476a0f6}


Increases the size of split and appends a new empty keyset. 

Initializes the element with the given parameters at size-\/1 to be used.

Will automatically resize split if needed.


\begin{DoxyParams}{Parameters}
{\em split} & the split object to work with \\
\hline
{\em backend} & the backend which should be appended \\
\hline
{\em parent\+Key} & the parent\+Key which should be appended \\
\hline
{\em syncbits} & the initial syncstate which should be appended\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em -\/1} & if no split is found \\
\hline
\end{DoxyRetVals}
\begin{DoxyReturn}{Returns}
the position of the new element\+: size-\/1 
\end{DoxyReturn}
\hypertarget{split_8c_afee68d5935a6875ece69945e32242895}{\index{split.\+c@{split.\+c}!elektra\+Split\+Appoint@{elektra\+Split\+Appoint}}
\index{elektra\+Split\+Appoint@{elektra\+Split\+Appoint}!split.\+c@{split.\+c}}
\subsubsection[{elektra\+Split\+Appoint}]{\setlength{\rightskip}{0pt plus 5cm}int elektra\+Split\+Appoint (
\begin{DoxyParamCaption}
\item[{Split $\ast$}]{split, }
\item[{K\+D\+B $\ast$}]{handle, }
\item[{Key\+Set $\ast$}]{ks}
\end{DoxyParamCaption}
)}}\label{split_8c_afee68d5935a6875ece69945e32242895}


Appoints all keys from ks to yet unsynced splits. 

\begin{DoxyPrecond}{Precondition}
\hyperlink{split_8c_aabebbc4b0e47527f59942fcf95b9fcb5}{elektra\+Split\+Buildup()} need to be executed before.
\end{DoxyPrecond}

\begin{DoxyParams}{Parameters}
{\em split} & the split object to work with \\
\hline
{\em handle} & to determine to which backend a key belongs \\
\hline
{\em ks} & the keyset to appoint to split\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em 1} & on success \\
\hline
{\em -\/1} & if no backend was found for a key \\
\hline
\end{DoxyRetVals}
\hypertarget{split_8c_aabebbc4b0e47527f59942fcf95b9fcb5}{\index{split.\+c@{split.\+c}!elektra\+Split\+Buildup@{elektra\+Split\+Buildup}}
\index{elektra\+Split\+Buildup@{elektra\+Split\+Buildup}!split.\+c@{split.\+c}}
\subsubsection[{elektra\+Split\+Buildup}]{\setlength{\rightskip}{0pt plus 5cm}int elektra\+Split\+Buildup (
\begin{DoxyParamCaption}
\item[{Split $\ast$}]{split, }
\item[{K\+D\+B $\ast$}]{kdb, }
\item[{Key $\ast$}]{parent\+Key}
\end{DoxyParamCaption}
)}}\label{split_8c_aabebbc4b0e47527f59942fcf95b9fcb5}


Walks through kdb-\/$>$split and adds all backends below parent\+Key to split. 

Sets syncbits to 2 if it is a default or root backend (which needs splitting). The information is copied from kdb-\/$>$split.

\begin{DoxyPrecond}{Precondition}
split needs to be empty, directly after creation with \hyperlink{split_8c_ad2245a38809f28e325cd9b32089b4c68}{elektra\+Split\+New()}.

there needs to be a valid default\+Backend but its ok not to have a trie inside K\+D\+B.

parent\+Key must be a valid key! (could be implemented more generally, but that would require splitting up of keysets of the same backend)
\end{DoxyPrecond}

\begin{DoxyParams}{Parameters}
{\em split} & will get all backends appended \\
\hline
{\em kdb} & the handle to get information about backends \\
\hline
{\em parent\+Key} & the information below which key the backends are from interest\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em 1} & always \\
\hline
\end{DoxyRetVals}
\hypertarget{split_8c_a603c8c0fce6da478623a68367e2c7175}{\index{split.\+c@{split.\+c}!elektra\+Split\+Check\+Size@{elektra\+Split\+Check\+Size}}
\index{elektra\+Split\+Check\+Size@{elektra\+Split\+Check\+Size}!split.\+c@{split.\+c}}
\subsubsection[{elektra\+Split\+Check\+Size}]{\setlength{\rightskip}{0pt plus 5cm}int elektra\+Split\+Check\+Size (
\begin{DoxyParamCaption}
\item[{Split $\ast$}]{split}
\end{DoxyParamCaption}
)}}\label{split_8c_a603c8c0fce6da478623a68367e2c7175}


Check if any of the split is uninitialized. 


\begin{DoxyParams}{Parameters}
{\em split} & \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em -\/1} & if size is wrong \\
\hline
{\em 1} & if everything is ok \\
\hline
\end{DoxyRetVals}
\hypertarget{split_8c_ae569ef1bc4cd8e931b4a7840d8ce48e6}{\index{split.\+c@{split.\+c}!elektra\+Split\+Del@{elektra\+Split\+Del}}
\index{elektra\+Split\+Del@{elektra\+Split\+Del}!split.\+c@{split.\+c}}
\subsubsection[{elektra\+Split\+Del}]{\setlength{\rightskip}{0pt plus 5cm}void elektra\+Split\+Del (
\begin{DoxyParamCaption}
\item[{Split $\ast$}]{keysets}
\end{DoxyParamCaption}
)}}\label{split_8c_ae569ef1bc4cd8e931b4a7840d8ce48e6}


Delete a split object. 

Will free all allocated resources of a split keyset.


\begin{DoxyParams}{Parameters}
{\em keysets} & the split object to work with \\
\hline
\end{DoxyParams}
\hypertarget{split_8c_a447e430a045cef7b107762171fbdc104}{\index{split.\+c@{split.\+c}!elektra\+Split\+Divide@{elektra\+Split\+Divide}}
\index{elektra\+Split\+Divide@{elektra\+Split\+Divide}!split.\+c@{split.\+c}}
\subsubsection[{elektra\+Split\+Divide}]{\setlength{\rightskip}{0pt plus 5cm}int elektra\+Split\+Divide (
\begin{DoxyParamCaption}
\item[{Split $\ast$}]{split, }
\item[{K\+D\+B $\ast$}]{handle, }
\item[{Key\+Set $\ast$}]{ks}
\end{DoxyParamCaption}
)}}\label{split_8c_a447e430a045cef7b107762171fbdc104}


Splits up the keysets and search for a sync bit in every key. 

It does not check if there were removed keys, see \hyperlink{split_8c_a3176eff9c1b5a9bfcf3d2e648f537993}{elektra\+Split\+Sync()} for the next step.

It does not create new backends, this has to be done by buildup before.

\begin{DoxyPrecond}{Precondition}
\hyperlink{split_8c_aabebbc4b0e47527f59942fcf95b9fcb5}{elektra\+Split\+Buildup()} need to be executed before.
\end{DoxyPrecond}

\begin{DoxyParams}{Parameters}
{\em split} & the split object to work with \\
\hline
{\em handle} & to get information where the individual keys belong \\
\hline
{\em ks} & the keyset to divide\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em 0} & if there were no sync bits \\
\hline
{\em 1} & if there were sync bits \\
\hline
{\em -\/1} & if no backend was found for any key \\
\hline
\end{DoxyRetVals}
\hypertarget{split_8c_ab9abad2c6146816e966976d9f18f0c88}{\index{split.\+c@{split.\+c}!elektra\+Split\+Get@{elektra\+Split\+Get}}
\index{elektra\+Split\+Get@{elektra\+Split\+Get}!split.\+c@{split.\+c}}
\subsubsection[{elektra\+Split\+Get}]{\setlength{\rightskip}{0pt plus 5cm}int elektra\+Split\+Get (
\begin{DoxyParamCaption}
\item[{Split $\ast$}]{split, }
\item[{Key $\ast$}]{warning\+Key, }
\item[{K\+D\+B $\ast$}]{handle}
\end{DoxyParamCaption}
)}}\label{split_8c_ab9abad2c6146816e966976d9f18f0c88}


Does some work after getting of backends is finished. 


\begin{DoxyItemize}
\item Update sizes
\item Removal of wrong keys
\end{DoxyItemize}

\begin{DoxyPrecond}{Precondition}
\hyperlink{split_8c_afee68d5935a6875ece69945e32242895}{elektra\+Split\+Appoint()} needs to be executed before.
\end{DoxyPrecond}

\begin{DoxyItemize}
\item check if keys are in correct backend
\item remove syncbits
\item update sizes in the backends
\end{DoxyItemize}


\begin{DoxyParams}{Parameters}
{\em split} & the split object to work with \\
\hline
{\em warning\+Key} & postcondition violations are reported here \\
\hline
{\em handle} & the handle to preprocess the keys \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em 1} & on success \\
\hline
{\em -\/1} & if no backend was found for a key or split-\/$>$parents has invalid namespace \\
\hline
\end{DoxyRetVals}
\hypertarget{split_8c_af3b1e5f1810964dddc3bd3a00822bca6}{\index{split.\+c@{split.\+c}!elektra\+Split\+Merge@{elektra\+Split\+Merge}}
\index{elektra\+Split\+Merge@{elektra\+Split\+Merge}!split.\+c@{split.\+c}}
\subsubsection[{elektra\+Split\+Merge}]{\setlength{\rightskip}{0pt plus 5cm}int elektra\+Split\+Merge (
\begin{DoxyParamCaption}
\item[{Split $\ast$}]{split, }
\item[{Key\+Set $\ast$}]{dest}
\end{DoxyParamCaption}
)}}\label{split_8c_af3b1e5f1810964dddc3bd3a00822bca6}


Merges together all parts of split into dest. 


\begin{DoxyParams}{Parameters}
{\em split} & the split object to work with \\
\hline
{\em dest} & the destination keyset where all keysets are appended. \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em 1} & on success \\
\hline
\end{DoxyRetVals}
\hypertarget{split_8c_ad2245a38809f28e325cd9b32089b4c68}{\index{split.\+c@{split.\+c}!elektra\+Split\+New@{elektra\+Split\+New}}
\index{elektra\+Split\+New@{elektra\+Split\+New}!split.\+c@{split.\+c}}
\subsubsection[{elektra\+Split\+New}]{\setlength{\rightskip}{0pt plus 5cm}Split$\ast$ elektra\+Split\+New (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{split_8c_ad2245a38809f28e325cd9b32089b4c68}


Allocates a new split object. 

Splits up a keyset into multiple keysets where each of them will passed to the correct \hyperlink{group__kdb_ga11436b058408f83d303ca5e996832bcf}{kdb\+Set()}.

Initially the size is 0 and alloc is A\+P\+P\+R\+O\+X\+I\+M\+A\+T\+E\+\_\+\+N\+R\+\_\+\+O\+F\+\_\+\+B\+A\+C\+K\+E\+N\+D\+S.

\begin{DoxyReturn}{Returns}
a fresh allocated split object
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{split_8c_ae569ef1bc4cd8e931b4a7840d8ce48e6}{elektra\+Split\+Del()} 
\end{DoxySeeAlso}
\hypertarget{split_8c_a44f9f801daa8ff1b29e48e31e49752f7}{\index{split.\+c@{split.\+c}!elektra\+Split\+Prepare@{elektra\+Split\+Prepare}}
\index{elektra\+Split\+Prepare@{elektra\+Split\+Prepare}!split.\+c@{split.\+c}}
\subsubsection[{elektra\+Split\+Prepare}]{\setlength{\rightskip}{0pt plus 5cm}void elektra\+Split\+Prepare (
\begin{DoxyParamCaption}
\item[{Split $\ast$}]{split}
\end{DoxyParamCaption}
)}}\label{split_8c_a44f9f801daa8ff1b29e48e31e49752f7}


Prepares for \hyperlink{group__kdb_ga11436b058408f83d303ca5e996832bcf}{kdb\+Set()} mainloop afterwards. 

All splits which do not need sync are removed and a deep copy of the remaining keysets is done.


\begin{DoxyParams}{Parameters}
{\em split} & the split object to work with \\
\hline
\end{DoxyParams}
\hypertarget{split_8c_ab6067083cc1afb5d42180bf75f7f86ef}{\index{split.\+c@{split.\+c}!elektra\+Split\+Remove@{elektra\+Split\+Remove}}
\index{elektra\+Split\+Remove@{elektra\+Split\+Remove}!split.\+c@{split.\+c}}
\subsubsection[{elektra\+Split\+Remove}]{\setlength{\rightskip}{0pt plus 5cm}void elektra\+Split\+Remove (
\begin{DoxyParamCaption}
\item[{Split $\ast$}]{split, }
\item[{size\+\_\+t}]{where}
\end{DoxyParamCaption}
)}}\label{split_8c_ab6067083cc1afb5d42180bf75f7f86ef}


Remove one part of split. 


\begin{DoxyParams}{Parameters}
{\em split} & the split object to work with \\
\hline
{\em where} & the position to cut away\\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
where must be within the size of the split 
\end{DoxyPrecond}
\begin{DoxyPostcond}{Postcondition}
split will be removed 
\end{DoxyPostcond}
\hypertarget{split_8c_a9816931521a6a16bd553c08abb957c62}{\index{split.\+c@{split.\+c}!elektra\+Split\+Resize@{elektra\+Split\+Resize}}
\index{elektra\+Split\+Resize@{elektra\+Split\+Resize}!split.\+c@{split.\+c}}
\subsubsection[{elektra\+Split\+Resize}]{\setlength{\rightskip}{0pt plus 5cm}void elektra\+Split\+Resize (
\begin{DoxyParamCaption}
\item[{Split $\ast$}]{split}
\end{DoxyParamCaption}
)}}\label{split_8c_a9816931521a6a16bd553c08abb957c62}


Doubles the size of how many parts of keysets can be appended. 


\begin{DoxyParams}{Parameters}
{\em split} & the split object to work with \\
\hline
\end{DoxyParams}
\hypertarget{split_8c_a887dd183bf21c635c6993cd480ff3b21}{\index{split.\+c@{split.\+c}!elektra\+Split\+Search\+Backend@{elektra\+Split\+Search\+Backend}}
\index{elektra\+Split\+Search\+Backend@{elektra\+Split\+Search\+Backend}!split.\+c@{split.\+c}}
\subsubsection[{elektra\+Split\+Search\+Backend}]{\setlength{\rightskip}{0pt plus 5cm}ssize\+\_\+t elektra\+Split\+Search\+Backend (
\begin{DoxyParamCaption}
\item[{Split $\ast$}]{split, }
\item[{Backend $\ast$}]{backend, }
\item[{Key $\ast$}]{parent}
\end{DoxyParamCaption}
)}}\label{split_8c_a887dd183bf21c635c6993cd480ff3b21}


Determines if the backend is already inserted or not. 

\begin{DoxyWarning}{Warning}
If no parent Key is given, the default/root backends won't be searched.
\end{DoxyWarning}

\begin{DoxyParams}{Parameters}
{\em split} & the split object to work with \\
\hline
{\em backend} & the backend to search for \\
\hline
{\em parent} & the key to check for domains in default/root backends. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
pos of backend if it already exist 
\end{DoxyReturn}

\begin{DoxyRetVals}{Return values}
{\em -\/1} & if it does not exist \\
\hline
\end{DoxyRetVals}
\hypertarget{split_8c_afb25e1f946f07e5490a962a42320a0cc}{\index{split.\+c@{split.\+c}!elektra\+Split\+Search\+Root@{elektra\+Split\+Search\+Root}}
\index{elektra\+Split\+Search\+Root@{elektra\+Split\+Search\+Root}!split.\+c@{split.\+c}}
\subsubsection[{elektra\+Split\+Search\+Root}]{\setlength{\rightskip}{0pt plus 5cm}int elektra\+Split\+Search\+Root (
\begin{DoxyParamCaption}
\item[{Split $\ast$}]{split, }
\item[{Key $\ast$}]{parent\+Key}
\end{DoxyParamCaption}
)}}\label{split_8c_afb25e1f946f07e5490a962a42320a0cc}

\begin{DoxyRetVals}{Return values}
{\em 1} & if one of the backends in split has all keys below parent\+Key \\
\hline
{\em 0} & if parent\+Key == 0 or there are keys below or same than parent\+Key which do not fit in any of split keysets \\
\hline
\end{DoxyRetVals}

\begin{DoxyParams}{Parameters}
{\em split} & the split object to work with \\
\hline
{\em parent\+Key} & the key which relation is searched for \\
\hline
\end{DoxyParams}
\hypertarget{split_8c_a3176eff9c1b5a9bfcf3d2e648f537993}{\index{split.\+c@{split.\+c}!elektra\+Split\+Sync@{elektra\+Split\+Sync}}
\index{elektra\+Split\+Sync@{elektra\+Split\+Sync}!split.\+c@{split.\+c}}
\subsubsection[{elektra\+Split\+Sync}]{\setlength{\rightskip}{0pt plus 5cm}int elektra\+Split\+Sync (
\begin{DoxyParamCaption}
\item[{Split $\ast$}]{split}
\end{DoxyParamCaption}
)}}\label{split_8c_a3176eff9c1b5a9bfcf3d2e648f537993}


Add sync bits everywhere keys were removed/added. 


\begin{DoxyItemize}
\item checks if the size of a previous \hyperlink{group__kdb_ga28e385fd9cb7ccfe0b2f1ed2f62453a1}{kdb\+Get()} is unchanged.
\item checks if in correct state (\hyperlink{group__kdb_ga28e385fd9cb7ccfe0b2f1ed2f62453a1}{kdb\+Get()} needs to be executed before)
\end{DoxyItemize}

Only \hyperlink{split_8c_a447e430a045cef7b107762171fbdc104}{elektra\+Split\+Divide()} together with this function can really decide if sync is needed or not.

\begin{DoxyPrecond}{Precondition}
split needs to be processed with \hyperlink{split_8c_a447e430a045cef7b107762171fbdc104}{elektra\+Split\+Divide()} before.
\end{DoxyPrecond}

\begin{DoxyRetVals}{Return values}
{\em 0} & if \hyperlink{group__kdb_ga11436b058408f83d303ca5e996832bcf}{kdb\+Set()} is not needed \\
\hline
{\em 1} & if \hyperlink{group__kdb_ga11436b058408f83d303ca5e996832bcf}{kdb\+Set()} is needed \\
\hline
{\em -\/1} & on wrong keys (also has assert, should not happen) \\
\hline
{\em -\/2} & wrong spec state\+: \hyperlink{group__kdb_ga28e385fd9cb7ccfe0b2f1ed2f62453a1}{kdb\+Get()} was not executed before \\
\hline
{\em -\/3} & wrong dir state\+: \hyperlink{group__kdb_ga28e385fd9cb7ccfe0b2f1ed2f62453a1}{kdb\+Get()} was not executed before \\
\hline
{\em -\/4} & wrong user state\+: \hyperlink{group__kdb_ga28e385fd9cb7ccfe0b2f1ed2f62453a1}{kdb\+Get()} was not executed before \\
\hline
{\em -\/5} & wrong system state\+: \hyperlink{group__kdb_ga28e385fd9cb7ccfe0b2f1ed2f62453a1}{kdb\+Get()} was not executed before \\
\hline
\end{DoxyRetVals}
\begin{DoxyPrecond}{Precondition}
user/system was split before. 
\end{DoxyPrecond}

\begin{DoxyParams}{Parameters}
{\em split} & the split object to work with \\
\hline
\end{DoxyParams}
\hypertarget{split_8c_a5dde14941040fe97dd036555e858bb69}{\index{split.\+c@{split.\+c}!elektra\+Split\+Update\+File\+Name@{elektra\+Split\+Update\+File\+Name}}
\index{elektra\+Split\+Update\+File\+Name@{elektra\+Split\+Update\+File\+Name}!split.\+c@{split.\+c}}
\subsubsection[{elektra\+Split\+Update\+File\+Name}]{\setlength{\rightskip}{0pt plus 5cm}void elektra\+Split\+Update\+File\+Name (
\begin{DoxyParamCaption}
\item[{Split $\ast$}]{split, }
\item[{K\+D\+B $\ast$}]{handle, }
\item[{Key $\ast$}]{key}
\end{DoxyParamCaption}
)}}\label{split_8c_a5dde14941040fe97dd036555e858bb69}


Update the (configuration) file name for the parent key. 


\begin{DoxyParams}{Parameters}
{\em split} & the split to work with \\
\hline
{\em handle} & the handle to work with \\
\hline
{\em key} & the parent\+Key that should be updated (name must be correct) \\
\hline
\end{DoxyParams}
\hypertarget{split_8c_af7619472c17c782befa93d2e029bc328}{\index{split.\+c@{split.\+c}!elektra\+Split\+Update\+Size@{elektra\+Split\+Update\+Size}}
\index{elektra\+Split\+Update\+Size@{elektra\+Split\+Update\+Size}!split.\+c@{split.\+c}}
\subsubsection[{elektra\+Split\+Update\+Size}]{\setlength{\rightskip}{0pt plus 5cm}int elektra\+Split\+Update\+Size (
\begin{DoxyParamCaption}
\item[{Split $\ast$}]{split}
\end{DoxyParamCaption}
)}}\label{split_8c_af7619472c17c782befa93d2e029bc328}


Also update sizes after \hyperlink{group__kdb_ga11436b058408f83d303ca5e996832bcf}{kdb\+Set()} to recognize multiple \hyperlink{group__kdb_ga11436b058408f83d303ca5e996832bcf}{kdb\+Set()} attempts. 

\begin{DoxyWarning}{Warning}
cant use the same code with elektra\+Split\+Get because there is no default split part for \hyperlink{group__kdb_ga11436b058408f83d303ca5e996832bcf}{kdb\+Set()}. 
\end{DoxyWarning}
