\hypertarget{kdbgopts_8h}{}\doxysection{kdbgopts.\+h File Reference}
\label{kdbgopts_8h}\index{kdbgopts.h@{kdbgopts.h}}


Gopts contract.  


{\ttfamily \#include $<$kdb.\+h$>$}\newline
Include dependency graph for kdbgopts.\+h\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=151pt]{kdbgopts_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]{kdbgopts_8h__dep__incl}
\end{center}
\end{figure}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \mbox{\hyperlink{kdbgopts_8h_af4f606fc2179e917a10c77dab576d648}{elektra\+GOpts\+Contract}} (Key\+Set $\ast$contract, int argc, const char $\ast$const $\ast$argv, const char $\ast$const $\ast$envp, const Key $\ast$parent\+Key, Key\+Set $\ast$gopts\+Config)
\begin{DoxyCompactList}\small\item\em Sets up a contract for use with \mbox{\hyperlink{group__kdb_ga844e1299a84c3fbf1d3a905c5c893ba5}{kdb\+Open()}} that configures the gopts plugin. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{kdbgopts_8h_ade81f23438c00b284247955e8b4b207d}{elektra\+GOpts\+Contract\+From\+Strings}} (Key\+Set $\ast$contract, size\+\_\+t args\+Size, const char $\ast$args, size\+\_\+t env\+Size, const char $\ast$env, const Key $\ast$parent\+Key, Key\+Set $\ast$gopts\+Config)
\begin{DoxyCompactList}\small\item\em Sets up a contract for use with \mbox{\hyperlink{group__kdb_ga844e1299a84c3fbf1d3a905c5c893ba5}{kdb\+Open()}} that configures the gopts plugin. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Gopts contract. 

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


\doxysubsection{Function Documentation}
\mbox{\Hypertarget{kdbgopts_8h_af4f606fc2179e917a10c77dab576d648}\label{kdbgopts_8h_af4f606fc2179e917a10c77dab576d648}} 
\index{kdbgopts.h@{kdbgopts.h}!elektraGOptsContract@{elektraGOptsContract}}
\index{elektraGOptsContract@{elektraGOptsContract}!kdbgopts.h@{kdbgopts.h}}
\doxysubsubsection{\texorpdfstring{elektraGOptsContract()}{elektraGOptsContract()}}
{\footnotesize\ttfamily int elektra\+GOpts\+Contract (\begin{DoxyParamCaption}\item[{Key\+Set $\ast$}]{contract,  }\item[{int}]{argc,  }\item[{const char $\ast$const $\ast$}]{argv,  }\item[{const char $\ast$const $\ast$}]{envp,  }\item[{const Key $\ast$}]{parent\+Key,  }\item[{Key\+Set $\ast$}]{gopts\+Config }\end{DoxyParamCaption})}



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

You can pass 0 for {\ttfamily argc} {\bfseries{and}} {\ttfamily NULL} for {\ttfamily argv} to let gopts lookup command line options internally. You can also pass {\ttfamily NULL} for {\ttfamily envp} to do the same for environment variables.


\begin{DoxyParams}{Parameters}
{\em contract} & The Key\+Set into which the contract will be written. \\
\hline
{\em argc} & The argc value that should be used by gopts. \\
\hline
{\em argv} & The argv value that should be used by gopts. IMPORTANT\+: The pointer and data behind must be valid until after \mbox{\hyperlink{group__kdb_gadb54dc9fda17ee07deb9444df745c96f}{kdb\+Close()}} is called. \\
\hline
{\em envp} & The envp value that should be used by gopts. IMPORTANT\+: The pointer and data behind must be valid until after \mbox{\hyperlink{group__kdb_gadb54dc9fda17ee07deb9444df745c96f}{kdb\+Close()}} is called. \\
\hline
{\em parent\+Key} & The parent key that should be used by gopts. Only the key name is copied. The key can be deleted immediately after calling this function. \\
\hline
{\em gopts\+Config} & The config that used to mount the gopts plugin. This value can be NULL. Only keys in the user\+:/ namespace will be used.\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em -\/1} & if {\ttfamily contract} or {\ttfamily parent\+Key} is NULL \\
\hline
{\em -\/1} & if {\ttfamily argc} is 0 and {\ttfamily argv} is not NULL or if {\ttfamily argc} is not 0 and {\ttfamily argv} is NULL \\
\hline
{\em 0} & on success \\
\hline
\end{DoxyRetVals}
\mbox{\Hypertarget{kdbgopts_8h_ade81f23438c00b284247955e8b4b207d}\label{kdbgopts_8h_ade81f23438c00b284247955e8b4b207d}} 
\index{kdbgopts.h@{kdbgopts.h}!elektraGOptsContractFromStrings@{elektraGOptsContractFromStrings}}
\index{elektraGOptsContractFromStrings@{elektraGOptsContractFromStrings}!kdbgopts.h@{kdbgopts.h}}
\doxysubsubsection{\texorpdfstring{elektraGOptsContractFromStrings()}{elektraGOptsContractFromStrings()}}
{\footnotesize\ttfamily int elektra\+GOpts\+Contract\+From\+Strings (\begin{DoxyParamCaption}\item[{Key\+Set $\ast$}]{contract,  }\item[{size\+\_\+t}]{args\+Size,  }\item[{const char $\ast$}]{args,  }\item[{size\+\_\+t}]{env\+Size,  }\item[{const char $\ast$}]{env,  }\item[{const Key $\ast$}]{parent\+Key,  }\item[{Key\+Set $\ast$}]{gopts\+Config }\end{DoxyParamCaption})}



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

NOTE\+: prefer to use \mbox{\hyperlink{contracts_8c_af4f606fc2179e917a10c77dab576d648}{elektra\+GOpts\+Contract()}} if possible

You can pass {\ttfamily NULL} for {\ttfamily args} to let gopts lookup command line options internally. You can also pass {\ttfamily NULL} for {\ttfamily env} to do the same for environment variables.


\begin{DoxyParams}{Parameters}
{\em contract} & The Key\+Set into which the contract will be written. \\
\hline
{\em args\+Size} & The size of the {\ttfamily args} data \\
\hline
{\em args} & Continuous buffer containing all argv 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} & The size of the {\ttfamily env} 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 gopts. Only the key name is copied. The key can be deleted immediately after calling this function. \\
\hline
{\em gopts\+Config} & The config that used to mount the gopts plugin. This value can be NULL. Only keys in the user\+:/ namespace will be used.\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em -\/1} & if any of {\ttfamily contract} or {\ttfamily parent\+Key} is NULL \\
\hline
{\em 0} & on success \\
\hline
\end{DoxyRetVals}
