\hypertarget{kdbplugin_8h}{}\doxysection{kdbplugin.\+h File Reference}
\label{kdbplugin_8h}\index{kdbplugin.h@{kdbplugin.h}}


Methods for plugin programing.  


{\ttfamily \#include $<$kdb.\+h$>$}\newline
{\ttfamily \#include $<$errno.\+h$>$}\newline
{\ttfamily \#include $<$kdbmacros.\+h$>$}\newline
{\ttfamily \#include $<$string.\+h$>$}\newline
Include dependency graph for kdbplugin.\+h\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{kdbplugin_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]{kdbplugin_8h__dep__incl}
\end{center}
\end{figure}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \mbox{\hyperlink{group__plugin_gacb05c902e4014535589db4193da87460}{ELEKTRA\+\_\+\+PLUGIN\+\_\+\+FUNCTION}}(function)~ELEKTRA\+\_\+\+PLUGIN\+\_\+\+FUNCTION2 (ELEKTRA\+\_\+\+PLUGIN\+\_\+\+NAME\+\_\+C, function)
\begin{DoxyCompactList}\small\item\em Declare a plugin\textquotesingle{}s function name suitable for compilation variants (see doc/tutorials). \end{DoxyCompactList}\item 
\#define \mbox{\hyperlink{group__plugin_gabdcb97b05a83130c32bbde75db80fc50}{ELEKTRA\+\_\+\+README}}~ELEKTRA\+\_\+\+README2 (ELEKTRA\+\_\+\+PLUGIN\+\_\+\+NAME\+\_\+C)
\begin{DoxyCompactList}\small\item\em The filename for inclusion of the readme for compilation variants (see doc/tutorials). \end{DoxyCompactList}\item 
\mbox{\Hypertarget{kdbplugin_8h_a0a5d59c7d1a2ce87a1d060c7be0261a4}\label{kdbplugin_8h_a0a5d59c7d1a2ce87a1d060c7be0261a4}} 
\#define \mbox{\hyperlink{kdbplugin_8h_a0a5d59c7d1a2ce87a1d060c7be0261a4}{ELEKTRA\+\_\+\+PLUGIN\+\_\+\+STATUS\+\_\+\+ERROR}}~-\/1
\begin{DoxyCompactList}\small\item\em An error occurred inside the plugin function. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{kdbplugin_8h_a7ae271ada880a1447179094ce6f66821}\label{kdbplugin_8h_a7ae271ada880a1447179094ce6f66821}} 
\#define \mbox{\hyperlink{kdbplugin_8h_a7ae271ada880a1447179094ce6f66821}{ELEKTRA\+\_\+\+PLUGIN\+\_\+\+STATUS\+\_\+\+SUCCESS}}~1
\begin{DoxyCompactList}\small\item\em Everything went fine. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{kdbplugin_8h_abcb047a0a65b91821f414770c662ed8e}\label{kdbplugin_8h_abcb047a0a65b91821f414770c662ed8e}} 
\#define \mbox{\hyperlink{kdbplugin_8h_abcb047a0a65b91821f414770c662ed8e}{ELEKTRA\+\_\+\+PLUGIN\+\_\+\+STATUS\+\_\+\+NO\+\_\+\+UPDATE}}~0
\begin{DoxyCompactList}\small\item\em Everything went fine and the function {\bfseries{did not}} update the given keyset/configuration. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{kdbplugin_8h_ae2c3f868f0d01bf6e2ce8f9d7e764ceb}\label{kdbplugin_8h_ae2c3f868f0d01bf6e2ce8f9d7e764ceb}} 
\#define \mbox{\hyperlink{kdbplugin_8h_ae2c3f868f0d01bf6e2ce8f9d7e764ceb}{ELEKTRA\+\_\+\+PLUGIN\+\_\+\+STATUS\+\_\+\+CACHE\+\_\+\+HIT}}~2
\begin{DoxyCompactList}\small\item\em Everything went fine and we have a cache hit. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \mbox{\hyperlink{kdbplugin_8h_afed89ef026fb0622918a5de020de7814}{plugin\+\_\+t}} \{ \newline
\mbox{\hyperlink{kdbplugin_8h_afed89ef026fb0622918a5de020de7814ab7e2dcc6e79af21dd90d2bb62920551d}{ELEKTRA\+\_\+\+PLUGIN\+\_\+\+OPEN}} =1
, \mbox{\hyperlink{kdbplugin_8h_afed89ef026fb0622918a5de020de7814a449e166b322550b3ad26efd4c46e49e3}{ELEKTRA\+\_\+\+PLUGIN\+\_\+\+CLOSE}} =1$<$$<$1
, \mbox{\hyperlink{kdbplugin_8h_afed89ef026fb0622918a5de020de7814a3d5f4a887e68878f1cc3a75985194204}{ELEKTRA\+\_\+\+PLUGIN\+\_\+\+GET}} =1$<$$<$2
, \mbox{\hyperlink{kdbplugin_8h_afed89ef026fb0622918a5de020de7814a85c9545261cf0bcc932616e67ea3b70a}{ELEKTRA\+\_\+\+PLUGIN\+\_\+\+SET}} =1$<$$<$3
, \newline
\mbox{\hyperlink{kdbplugin_8h_afed89ef026fb0622918a5de020de7814a89e027283d949dd78bb9c1fce1b19a10}{ELEKTRA\+\_\+\+PLUGIN\+\_\+\+ERROR}} =1$<$$<$4
, \mbox{\hyperlink{kdbplugin_8h_afed89ef026fb0622918a5de020de7814ad8ebee0e9b492518a042e5203336eca9}{ELEKTRA\+\_\+\+PLUGIN\+\_\+\+COMMIT}} =1$<$$<$5
, \mbox{\hyperlink{kdbplugin_8h_afed89ef026fb0622918a5de020de7814a6965870cebc57645080f49b2db7f68bb}{ELEKTRA\+\_\+\+PLUGIN\+\_\+\+INIT}} =1$<$$<$6
, \mbox{\hyperlink{kdbplugin_8h_afed89ef026fb0622918a5de020de7814a64a0bc789482284d9fd27ce974e0959a}{ELEKTRA\+\_\+\+PLUGIN\+\_\+\+END}} =0
 \}
\begin{DoxyCompactList}\small\item\em Switches to denote the backend methods. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
Plugin $\ast$ \mbox{\hyperlink{group__plugin_ga8dd092048e972a3f0c9c9f54eb41576e}{elektra\+Plugin\+Export}} (const char $\ast$plugin\+Name,...)
\begin{DoxyCompactList}\small\item\em Allows one to Export Methods for a Plugin. \end{DoxyCompactList}\item 
Key\+Set $\ast$ \mbox{\hyperlink{group__plugin_ga644bead796506c172817724051c977c9}{elektra\+Plugin\+Get\+Config}} (Plugin $\ast$handle)
\begin{DoxyCompactList}\small\item\em Returns the configuration of that plugin. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__plugin_gaf4b941a52ff55d0ca2a9158d90208ef2}{elektra\+Plugin\+Set\+Data}} (Plugin $\ast$plugin, void $\ast$handle)
\begin{DoxyCompactList}\small\item\em Store a pointer to plugin specific data. \end{DoxyCompactList}\item 
void $\ast$ \mbox{\hyperlink{group__plugin_gaafcf3216b46292f222b8cc7828b4dd20}{elektra\+Plugin\+Get\+Data}} (Plugin $\ast$plugin)
\begin{DoxyCompactList}\small\item\em Get a pointer to the plugin specific data stored before. \end{DoxyCompactList}\item 
Key\+Set $\ast$ \mbox{\hyperlink{group__plugin_ga436cda13ed70c0face08661a90620bf6}{elektra\+Plugin\+Get\+Global\+Key\+Set}} (Plugin $\ast$plugin)
\begin{DoxyCompactList}\small\item\em Get a pointer to the global keyset. \end{DoxyCompactList}\item 
Elektra\+Kdb\+Phase \mbox{\hyperlink{kdbplugin_8h_a106648a1b249c4fd7bedded220b4f928}{elektra\+Plugin\+Get\+Phase}} (Plugin $\ast$plugin)
\begin{DoxyCompactList}\small\item\em Returns the current phase of the current KDB operation. \end{DoxyCompactList}\item 
Plugin $\ast$ \mbox{\hyperlink{kdbplugin_8h_a4c62dbd6b89b65ec734ead32ec358680}{elektra\+Plugin\+From\+Mountpoint}} (Plugin $\ast$plugin, const char $\ast$ref)
\begin{DoxyCompactList}\small\item\em Retrieves the handle for another plugin in the same mountpoint based on a reference. \end{DoxyCompactList}\item 
const char $\ast$ \mbox{\hyperlink{kdbplugin_8h_aea301339da46627a08ed46cbfd3d2815}{elektra\+Plugin\+Phase\+Name}} (Elektra\+Kdb\+Phase phase)
\begin{DoxyCompactList}\small\item\em Gets a string with the name of the given constant for a plugin phase. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Methods for plugin programing. 

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


\doxysubsection{Enumeration Type Documentation}
\mbox{\Hypertarget{kdbplugin_8h_afed89ef026fb0622918a5de020de7814}\label{kdbplugin_8h_afed89ef026fb0622918a5de020de7814}} 
\index{kdbplugin.h@{kdbplugin.h}!plugin\_t@{plugin\_t}}
\index{plugin\_t@{plugin\_t}!kdbplugin.h@{kdbplugin.h}}
\doxysubsubsection{\texorpdfstring{plugin\_t}{plugin\_t}}
{\footnotesize\ttfamily enum \mbox{\hyperlink{kdbplugin_8h_afed89ef026fb0622918a5de020de7814}{plugin\+\_\+t}}}



Switches to denote the backend methods. 

Used in calls to \mbox{\hyperlink{group__plugin_ga8dd092048e972a3f0c9c9f54eb41576e}{elektra\+Plugin\+Export()}}. \begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{ELEKTRA\_PLUGIN\_OPEN@{ELEKTRA\_PLUGIN\_OPEN}!kdbplugin.h@{kdbplugin.h}}\index{kdbplugin.h@{kdbplugin.h}!ELEKTRA\_PLUGIN\_OPEN@{ELEKTRA\_PLUGIN\_OPEN}}}\mbox{\Hypertarget{kdbplugin_8h_afed89ef026fb0622918a5de020de7814ab7e2dcc6e79af21dd90d2bb62920551d}\label{kdbplugin_8h_afed89ef026fb0622918a5de020de7814ab7e2dcc6e79af21dd90d2bb62920551d}} 
ELEKTRA\+\_\+\+PLUGIN\+\_\+\+OPEN&Next arg is backend for \mbox{\hyperlink{group__kdb_ga844e1299a84c3fbf1d3a905c5c893ba5}{kdb\+Open()}} \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{ELEKTRA\_PLUGIN\_CLOSE@{ELEKTRA\_PLUGIN\_CLOSE}!kdbplugin.h@{kdbplugin.h}}\index{kdbplugin.h@{kdbplugin.h}!ELEKTRA\_PLUGIN\_CLOSE@{ELEKTRA\_PLUGIN\_CLOSE}}}\mbox{\Hypertarget{kdbplugin_8h_afed89ef026fb0622918a5de020de7814a449e166b322550b3ad26efd4c46e49e3}\label{kdbplugin_8h_afed89ef026fb0622918a5de020de7814a449e166b322550b3ad26efd4c46e49e3}} 
ELEKTRA\+\_\+\+PLUGIN\+\_\+\+CLOSE&Next arg is backend for \mbox{\hyperlink{group__kdb_gadb54dc9fda17ee07deb9444df745c96f}{kdb\+Close()}} \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{ELEKTRA\_PLUGIN\_GET@{ELEKTRA\_PLUGIN\_GET}!kdbplugin.h@{kdbplugin.h}}\index{kdbplugin.h@{kdbplugin.h}!ELEKTRA\_PLUGIN\_GET@{ELEKTRA\_PLUGIN\_GET}}}\mbox{\Hypertarget{kdbplugin_8h_afed89ef026fb0622918a5de020de7814a3d5f4a887e68878f1cc3a75985194204}\label{kdbplugin_8h_afed89ef026fb0622918a5de020de7814a3d5f4a887e68878f1cc3a75985194204}} 
ELEKTRA\+\_\+\+PLUGIN\+\_\+\+GET&Next arg is backend for \mbox{\hyperlink{group__kdb_ga28e385fd9cb7ccfe0b2f1ed2f62453a1}{kdb\+Get()}} \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{ELEKTRA\_PLUGIN\_SET@{ELEKTRA\_PLUGIN\_SET}!kdbplugin.h@{kdbplugin.h}}\index{kdbplugin.h@{kdbplugin.h}!ELEKTRA\_PLUGIN\_SET@{ELEKTRA\_PLUGIN\_SET}}}\mbox{\Hypertarget{kdbplugin_8h_afed89ef026fb0622918a5de020de7814a85c9545261cf0bcc932616e67ea3b70a}\label{kdbplugin_8h_afed89ef026fb0622918a5de020de7814a85c9545261cf0bcc932616e67ea3b70a}} 
ELEKTRA\+\_\+\+PLUGIN\+\_\+\+SET&Next arg is backend for \mbox{\hyperlink{group__kdb_ga11436b058408f83d303ca5e996832bcf}{kdb\+Set()}} \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{ELEKTRA\_PLUGIN\_ERROR@{ELEKTRA\_PLUGIN\_ERROR}!kdbplugin.h@{kdbplugin.h}}\index{kdbplugin.h@{kdbplugin.h}!ELEKTRA\_PLUGIN\_ERROR@{ELEKTRA\_PLUGIN\_ERROR}}}\mbox{\Hypertarget{kdbplugin_8h_afed89ef026fb0622918a5de020de7814a89e027283d949dd78bb9c1fce1b19a10}\label{kdbplugin_8h_afed89ef026fb0622918a5de020de7814a89e027283d949dd78bb9c1fce1b19a10}} 
ELEKTRA\+\_\+\+PLUGIN\+\_\+\+ERROR&Next arg is backend for kdb\+Error() \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{ELEKTRA\_PLUGIN\_COMMIT@{ELEKTRA\_PLUGIN\_COMMIT}!kdbplugin.h@{kdbplugin.h}}\index{kdbplugin.h@{kdbplugin.h}!ELEKTRA\_PLUGIN\_COMMIT@{ELEKTRA\_PLUGIN\_COMMIT}}}\mbox{\Hypertarget{kdbplugin_8h_afed89ef026fb0622918a5de020de7814ad8ebee0e9b492518a042e5203336eca9}\label{kdbplugin_8h_afed89ef026fb0622918a5de020de7814ad8ebee0e9b492518a042e5203336eca9}} 
ELEKTRA\+\_\+\+PLUGIN\+\_\+\+COMMIT&Next arg is backend for kdb\+Commit() \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{ELEKTRA\_PLUGIN\_INIT@{ELEKTRA\_PLUGIN\_INIT}!kdbplugin.h@{kdbplugin.h}}\index{kdbplugin.h@{kdbplugin.h}!ELEKTRA\_PLUGIN\_INIT@{ELEKTRA\_PLUGIN\_INIT}}}\mbox{\Hypertarget{kdbplugin_8h_afed89ef026fb0622918a5de020de7814a6965870cebc57645080f49b2db7f68bb}\label{kdbplugin_8h_afed89ef026fb0622918a5de020de7814a6965870cebc57645080f49b2db7f68bb}} 
ELEKTRA\+\_\+\+PLUGIN\+\_\+\+INIT&Next arg is backend for kdb\+Init() \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{ELEKTRA\_PLUGIN\_END@{ELEKTRA\_PLUGIN\_END}!kdbplugin.h@{kdbplugin.h}}\index{kdbplugin.h@{kdbplugin.h}!ELEKTRA\_PLUGIN\_END@{ELEKTRA\_PLUGIN\_END}}}\mbox{\Hypertarget{kdbplugin_8h_afed89ef026fb0622918a5de020de7814a64a0bc789482284d9fd27ce974e0959a}\label{kdbplugin_8h_afed89ef026fb0622918a5de020de7814a64a0bc789482284d9fd27ce974e0959a}} 
ELEKTRA\+\_\+\+PLUGIN\+\_\+\+END&End of arguments \\
\hline

\end{DoxyEnumFields}


\doxysubsection{Function Documentation}
\mbox{\Hypertarget{kdbplugin_8h_a4c62dbd6b89b65ec734ead32ec358680}\label{kdbplugin_8h_a4c62dbd6b89b65ec734ead32ec358680}} 
\index{kdbplugin.h@{kdbplugin.h}!elektraPluginFromMountpoint@{elektraPluginFromMountpoint}}
\index{elektraPluginFromMountpoint@{elektraPluginFromMountpoint}!kdbplugin.h@{kdbplugin.h}}
\doxysubsubsection{\texorpdfstring{elektraPluginFromMountpoint()}{elektraPluginFromMountpoint()}}
{\footnotesize\ttfamily Plugin$\ast$ elektra\+Plugin\+From\+Mountpoint (\begin{DoxyParamCaption}\item[{Plugin $\ast$}]{plugin,  }\item[{const char $\ast$}]{ref }\end{DoxyParamCaption})}



Retrieves the handle for another plugin in the same mountpoint based on a reference. 

The plugins of a mountpoint are defined via {\ttfamily system\+:/elektra/mountpoint/$<$mp$>$/pluigns/$<$ref$>$} keys in the declaration of the mountpoint. To use this function, you must provide the {\ttfamily $<$ref$>$} part as {\ttfamily ref}.


\begin{DoxyParams}{Parameters}
{\em plugin} & active plugin handle \\
\hline
{\em ref} & reference to another plugin \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the plugin referenced by {\ttfamily ref} 
\end{DoxyReturn}

\begin{DoxyRetVals}{Return values}
{\em NULL} & if {\ttfamily plugin}, or {\ttfamily ref} are {\ttfamily NULL}, or no plugin was found for {\ttfamily ref} \\
\hline
\end{DoxyRetVals}
\mbox{\Hypertarget{kdbplugin_8h_a106648a1b249c4fd7bedded220b4f928}\label{kdbplugin_8h_a106648a1b249c4fd7bedded220b4f928}} 
\index{kdbplugin.h@{kdbplugin.h}!elektraPluginGetPhase@{elektraPluginGetPhase}}
\index{elektraPluginGetPhase@{elektraPluginGetPhase}!kdbplugin.h@{kdbplugin.h}}
\doxysubsubsection{\texorpdfstring{elektraPluginGetPhase()}{elektraPluginGetPhase()}}
{\footnotesize\ttfamily Elektra\+Kdb\+Phase elektra\+Plugin\+Get\+Phase (\begin{DoxyParamCaption}\item[{Plugin $\ast$}]{plugin }\end{DoxyParamCaption})}



Returns the current phase of the current KDB operation. 

During \mbox{\hyperlink{group__kdb_ga28e385fd9cb7ccfe0b2f1ed2f62453a1}{kdb\+Get()}} this will be one of the {\ttfamily ELEKTRA\+\_\+\+KDB\+\_\+\+GET\+\_\+\+PHASE\+\_\+$\ast$} constants and during \mbox{\hyperlink{group__kdb_ga11436b058408f83d303ca5e996832bcf}{kdb\+Set()}} it will be one of the {\ttfamily ELEKTRA\+\_\+\+KDB\+\_\+\+SET\+\_\+\+PHASE\+\_\+$\ast$} constants.


\begin{DoxyParams}{Parameters}
{\em plugin} & plugin handle \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
current phase 
\end{DoxyReturn}

\begin{DoxyRetVals}{Return values}
{\em 0} & if {\ttfamily plugin} is {\ttfamily NULL} \\
\hline
\end{DoxyRetVals}
\mbox{\Hypertarget{kdbplugin_8h_aea301339da46627a08ed46cbfd3d2815}\label{kdbplugin_8h_aea301339da46627a08ed46cbfd3d2815}} 
\index{kdbplugin.h@{kdbplugin.h}!elektraPluginPhaseName@{elektraPluginPhaseName}}
\index{elektraPluginPhaseName@{elektraPluginPhaseName}!kdbplugin.h@{kdbplugin.h}}
\doxysubsubsection{\texorpdfstring{elektraPluginPhaseName()}{elektraPluginPhaseName()}}
{\footnotesize\ttfamily const char$\ast$ elektra\+Plugin\+Phase\+Name (\begin{DoxyParamCaption}\item[{Elektra\+Kdb\+Phase}]{phase }\end{DoxyParamCaption})}



Gets a string with the name of the given constant for a plugin phase. 


\begin{DoxyParams}{Parameters}
{\em phase} & The Elektra\+Kdb\+Phase value for which a string representation should be returned\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A string with the name of the given phase. The returned string is a constant value and must never be freed! 
\end{DoxyReturn}

\begin{DoxyRetVals}{Return values}
{\em ???} & if an unknown value for the phase was given \\
\hline
\end{DoxyRetVals}
