\hypertarget{reference_8c}{}\doxysection{reference.\+c File Reference}
\label{reference_8c}\index{reference.c@{reference.c}}


Reference methods.  


{\ttfamily \#include \char`\"{}kdbease.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}kdbhelper.\+h\char`\"{}}\newline
{\ttfamily \#include $<$string.\+h$>$}\newline
Include dependency graph for reference.\+c\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{reference_8c__incl}
\end{center}
\end{figure}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \mbox{\hyperlink{reference_8c_a65d00edc680cfd0312811995904f8167}{elektra\+Is\+Reference\+Redundant}} (const char $\ast$reference)
\begin{DoxyCompactList}\small\item\em Check whether a reference is redundant (i.\+e. \end{DoxyCompactList}\item 
char $\ast$ \mbox{\hyperlink{reference_8c_aa2b690f7c024f11772deb73cb5b7b5cc}{elektra\+Resolve\+Reference}} (const char $\ast$reference, const Key $\ast$base\+Key, const Key $\ast$parent\+Key)
\begin{DoxyCompactList}\small\item\em Resolve reference into a full keyname. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Reference methods. 

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


\doxysubsection{Function Documentation}
\mbox{\Hypertarget{reference_8c_a65d00edc680cfd0312811995904f8167}\label{reference_8c_a65d00edc680cfd0312811995904f8167}} 
\index{reference.c@{reference.c}!elektraIsReferenceRedundant@{elektraIsReferenceRedundant}}
\index{elektraIsReferenceRedundant@{elektraIsReferenceRedundant}!reference.c@{reference.c}}
\doxysubsubsection{\texorpdfstring{elektraIsReferenceRedundant()}{elektraIsReferenceRedundant()}}
{\footnotesize\ttfamily int elektra\+Is\+Reference\+Redundant (\begin{DoxyParamCaption}\item[{const char $\ast$}]{reference }\end{DoxyParamCaption})}



Check whether a reference is redundant (i.\+e. 

it can be expressed in less characters) or not.

This can be used to give a warning to users, because redundant references are often mistakes. Using \char`\"{}../some/key/../path\char`\"{} instead of \char`\"{}../some/path\char`\"{} may indicate, that either a mistake was made while editing, or the concept of references was misunderstood.


\begin{DoxyParams}{Parameters}
{\em reference} & the reference to check \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em 1} & if the reference is redundant \\
\hline
{\em 0} & otherwise \\
\hline
\end{DoxyRetVals}
\mbox{\Hypertarget{reference_8c_aa2b690f7c024f11772deb73cb5b7b5cc}\label{reference_8c_aa2b690f7c024f11772deb73cb5b7b5cc}} 
\index{reference.c@{reference.c}!elektraResolveReference@{elektraResolveReference}}
\index{elektraResolveReference@{elektraResolveReference}!reference.c@{reference.c}}
\doxysubsubsection{\texorpdfstring{elektraResolveReference()}{elektraResolveReference()}}
{\footnotesize\ttfamily char$\ast$ elektra\+Resolve\+Reference (\begin{DoxyParamCaption}\item[{const char $\ast$}]{reference,  }\item[{const Key $\ast$}]{base\+Key,  }\item[{const Key $\ast$}]{parent\+Key }\end{DoxyParamCaption})}



Resolve reference into a full keyname. 

References operate like U\+N\+IX paths, with some additions\+:
\begin{DoxyItemize}
\item \textquotesingle{}.\textquotesingle{} refers to the current key
\item \textquotesingle{}..\textquotesingle{} refers to the parent of the current key
\item \textquotesingle{}@\textquotesingle{} refers to the parent\+Key of K\+DB
\item references starting with anything but \textquotesingle{}./\textquotesingle{}, \textquotesingle{}../\textquotesingle{} and \textquotesingle{}@/\textquotesingle{} as absolute, only embedded \textquotesingle{}/./\textquotesingle{} and \textquotesingle{}/../\textquotesingle{} as well as \textquotesingle{}/.\textquotesingle{} and \textquotesingle{}/..\textquotesingle{} at the end will be resolved (like in any key\+Set\+Name call)
\end{DoxyItemize}


\begin{DoxyParams}{Parameters}
{\em reference} & The reference to resolve \\
\hline
{\em base\+Key} & The key identified by the reference \char`\"{}./\char`\"{} \\
\hline
{\em parent\+Key} & The key identified by the reference \char`\"{}@/\char`\"{}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a newly allocated string, containing the full keyname; has to be disposed with \mbox{\hyperlink{internal_8c_a7f572149d2e0bfe18023a6ac969f195c}{elektra\+Free()}} 
\end{DoxyReturn}
