\hypertarget{elektra__error_8c}{}\section{elektra\+\_\+error.\+c File Reference}
\label{elektra__error_8c}\index{elektra\+\_\+error.\+c@{elektra\+\_\+error.\+c}}


Elektra error codes.  


{\ttfamily \#include \char`\"{}elektra/conversion.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}elektra/error.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}kdberrors.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}kdbhelper.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}kdbprivate.\+h\char`\"{}}\newline
{\ttfamily \#include $<$string.\+h$>$}\newline
Include dependency graph for elektra\+\_\+error.\+c\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{elektra__error_8c__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
Elektra\+Error $\ast$ \hyperlink{elektra__error_8c_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 \hyperlink{elektra__error_8c_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$ \hyperlink{elektra__error_8c_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$ \hyperlink{group__highlevel_ga4895fb4c40822a11219846b189395db0}{elektra\+Error\+Pure\+Warning} (void)
\begin{DoxyCompactList}\small\item\em Creates a dummy Elektra\+Error struct to store warnings in. \end{DoxyCompactList}\item 
const char $\ast$ \hyperlink{group__highlevel_ga22c0775760a9f42f29337c06bf8b2ab5}{elektra\+Error\+Code} (const Elektra\+Error $\ast$error)
\item 
const char $\ast$ \hyperlink{group__highlevel_ga781cda83af3981a55321e7c613afbef0}{elektra\+Error\+Description} (const Elektra\+Error $\ast$error)
\item 
void \hyperlink{group__highlevel_ga591f7ed4b57a341928bf7bb3d7adb693}{elektra\+Error\+Reset} (Elektra\+Error $\ast$$\ast$error)
\begin{DoxyCompactList}\small\item\em Frees the memory used by the error and sets the referenced error variable to N\+U\+LL. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Elektra error codes. 

\begin{DoxyCopyright}{Copyright}
B\+SD License (see doc/\+L\+I\+C\+E\+N\+S\+E.\+md or \href{http://www.libelektra.org}{\tt http\+://www.\+libelektra.\+org}) 
\end{DoxyCopyright}


\subsection{Function Documentation}
\mbox{\Hypertarget{elektra__error_8c_a5b397979459c52ed2031d7b997679fca}\label{elektra__error_8c_a5b397979459c52ed2031d7b997679fca}} 
\index{elektra\+\_\+error.\+c@{elektra\+\_\+error.\+c}!elektra\+Error\+Add\+Warning@{elektra\+Error\+Add\+Warning}}
\index{elektra\+Error\+Add\+Warning@{elektra\+Error\+Add\+Warning}!elektra\+\_\+error.\+c@{elektra\+\_\+error.\+c}}
\subsubsection{\texorpdfstring{elektra\+Error\+Add\+Warning()}{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 \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 \hyperlink{group__highlevel_ga591f7ed4b57a341928bf7bb3d7adb693}{elektra\+Error\+Reset()} on it afterwards. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{elektra__error_8c_a0affd2cf7caf29441bf7cdf1d7cbb351}\label{elektra__error_8c_a0affd2cf7caf29441bf7cdf1d7cbb351}} 
\index{elektra\+\_\+error.\+c@{elektra\+\_\+error.\+c}!elektra\+Error\+Create@{elektra\+Error\+Create}}
\index{elektra\+Error\+Create@{elektra\+Error\+Create}!elektra\+\_\+error.\+c@{elektra\+\_\+error.\+c}}
\subsubsection{\texorpdfstring{elektra\+Error\+Create()}{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 \hyperlink{internal_8c_a848ed030434c76176167fac6ab79429c}{elektra\+Calloc()}.


\begin{DoxyParams}{Parameters}
{\em code} & The error code of the error. Must be compile-\/time constant. \\
\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. Must be compile-\/time constant. \\
\hline
{\em file} & The file that raised the error. Must be compile-\/time constant. \\
\hline
{\em line} & The line in which the error was raised.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A newly allocated Elektra\+Error (free with \hyperlink{internal_8c_a7f572149d2e0bfe18023a6ac969f195c}{elektra\+Free()}). 
\end{DoxyReturn}
\mbox{\Hypertarget{elektra__error_8c_a8634e58bc4cda4babdc73247fc55e25a}\label{elektra__error_8c_a8634e58bc4cda4babdc73247fc55e25a}} 
\index{elektra\+\_\+error.\+c@{elektra\+\_\+error.\+c}!elektra\+Error\+From\+Key@{elektra\+Error\+From\+Key}}
\index{elektra\+Error\+From\+Key@{elektra\+Error\+From\+Key}!elektra\+\_\+error.\+c@{elektra\+\_\+error.\+c}}
\subsubsection{\texorpdfstring{elektra\+Error\+From\+Key()}{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}
\hyperlink{group__highlevel_ga4895fb4c40822a11219846b189395db0}{elektra\+Error\+Pure\+Warning}
\end{DoxySeeAlso}

\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 \hyperlink{internal_8c_a7f572149d2e0bfe18023a6ac969f195c}{elektra\+Free()}). 
\end{DoxyReturn}
