\hypertarget{group__functions}{}\doxysection{SVM functions}
\label{group__functions}\index{SVM functions@{SVM functions}}


This module contains API functions to handle SVM functions.  


\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} \mbox{\hyperlink{group__api__types_gad01adf1b14e8f8309ff0c059b2a51196}{SVM\+\_\+\+Variable}} \mbox{\hyperlink{group__functions_gaf9cf14d9f6cadd9f5374bf0de7e4580b}{svm\+\_\+function\+\_\+call}} (const void $\ast$svm, const \mbox{\hyperlink{group__api__types_ga90c57554e1d1ea2967e133696d0cf2cd}{SVM\+\_\+\+Value\+\_\+\+Plugin\+Entry\+Point}} name, const \mbox{\hyperlink{group__api__types_gaab347fe7005c87722bd7d80cfe94333c}{SVM\+\_\+\+Size}} argc, \mbox{\hyperlink{group__api__types_gab05a82304ba262cf3ae97b0c5f8ab707}{SVM\+\_\+\+Parameter}} argv\mbox{[}$\,$\mbox{]})
\begin{DoxyCompactList}\small\item\em This function calls a plugin defined function. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} \mbox{\hyperlink{struct_s_v_m___string}{SVM\+\_\+\+String}} \mbox{\hyperlink{group__functions_ga43039c7ce7f1e70e9dcbf883b51aa430}{svm\+\_\+function\+\_\+get\+\_\+prototype}} (const void $\ast$svm, const \mbox{\hyperlink{group__api__types_ga90c57554e1d1ea2967e133696d0cf2cd}{SVM\+\_\+\+Value\+\_\+\+Plugin\+Entry\+Point}} name)
\begin{DoxyCompactList}\small\item\em This function returns a string representing the prototype of a plugin defined function. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
This module contains API functions to handle SVM functions. 

Functions are a generic mechanism to allow plugin cooperation\+:
\begin{DoxyItemize}
\item A plugin can trigger a call to another plugin callback function,
\item Type checking is done like for instruction calls,
\item The caller plugin callback function can use the name and parameters from its own parameters to allow genericity. 
\end{DoxyItemize}

\doxysubsection{Function Documentation}
\mbox{\Hypertarget{group__functions_gaf9cf14d9f6cadd9f5374bf0de7e4580b}\label{group__functions_gaf9cf14d9f6cadd9f5374bf0de7e4580b}} 
\index{SVM functions@{SVM functions}!svm\_function\_call@{svm\_function\_call}}
\index{svm\_function\_call@{svm\_function\_call}!SVM functions@{SVM functions}}
\doxysubsubsection{\texorpdfstring{svm\_function\_call()}{svm\_function\_call()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} \mbox{\hyperlink{group__api__types_gad01adf1b14e8f8309ff0c059b2a51196}{SVM\+\_\+\+Variable}} svm\+\_\+function\+\_\+call (\begin{DoxyParamCaption}\item[{const void $\ast$}]{svm,  }\item[{const \mbox{\hyperlink{group__api__types_ga90c57554e1d1ea2967e133696d0cf2cd}{SVM\+\_\+\+Value\+\_\+\+Plugin\+Entry\+Point}}}]{name,  }\item[{const \mbox{\hyperlink{group__api__types_gaab347fe7005c87722bd7d80cfe94333c}{SVM\+\_\+\+Size}}}]{argc,  }\item[{\mbox{\hyperlink{group__api__types_gab05a82304ba262cf3ae97b0c5f8ab707}{SVM\+\_\+\+Parameter}}}]{argv\mbox{[}$\,$\mbox{]} }\end{DoxyParamCaption})}



This function calls a plugin defined function. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em svm} & The SVM pointer passed as first argument of the callback function. \\
\hline
\mbox{\texttt{ in}}  & {\em name} & The plugin function name to call. \\
\hline
\mbox{\texttt{ in}}  & {\em argc} & The number of parameters. \\
\hline
\mbox{\texttt{ in}}  & {\em argv} & The function parameters. These parameters can be\+:
\begin{DoxyItemize}
\item values,
\item markers,
\item keywords,
\item structures.
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
The called function is not a raw plugin callback function. Callable functions are objects defined as FUNCTION in plugins.

The called function will not share the caller SVM first pointer. The current kernel, process or scheduler remain the same in the called function when the call is done within a kernel. But all local variables are not accessible to the function, and the global variables are the ones of the plugin of the called function.

If a call to an instruction callback has to performed from a plugin, a function can be created in the plugin code containing the instruction callback to delegate the call\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{\mbox{\hyperlink{group__api__types_gad01adf1b14e8f8309ff0c059b2a51196}{SVM\_Variable}} function\_<instruction name>(\textcolor{keyword}{const} \textcolor{keywordtype}{void} *svm, \textcolor{keyword}{const} \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} \textcolor{keywordtype}{int} argc, \textcolor{keyword}{const} \mbox{\hyperlink{group__api__types_gab05a82304ba262cf3ae97b0c5f8ab707}{SVM\_Parameter}} argv[])}
\DoxyCodeLine{\{}
\DoxyCodeLine{    \textcolor{keywordflow}{return} instruction\_<instruction name>(svm, argc, argv);}
\DoxyCodeLine{\}}

\end{DoxyCode}
 This allows the plugin developper to allow only a subset of instructions to be called from other plugins.
\end{DoxyNote}
\begin{DoxyWarning}{Warning}
If the argv size is smaller than argc, it will result in an undefined behavior.
\end{DoxyWarning}
Usage example\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{\mbox{\hyperlink{group__api__types_gab05a82304ba262cf3ae97b0c5f8ab707}{SVM\_Parameter}} *parameters = \mbox{\hyperlink{group__parameters_ga969cd98d3dec30c44f1bb00169d2ac95}{svm\_parameter\_array\_new}}(svm,3);}
\DoxyCodeLine{parameters[0] = \mbox{\hyperlink{group__valueparameters_ga2952b30a5c4b0f76e445fcec8aefd96a}{svm\_parameter\_value\_new}}(svm,\mbox{\hyperlink{group__valueparameters_ga76f0714d764a8f9c52b2aabc7ab32a4f}{svm\_parameter\_value\_get}}(svm,argv[0]));}
\DoxyCodeLine{parameters[1] = \mbox{\hyperlink{group__markerparameters_gad8ddeb3249277097b5f0c2e49f79f6e6}{svm\_parameter\_marker\_new\_\_raw}}(svm,\textcolor{stringliteral}{"{}>"{}});}
\DoxyCodeLine{parameters[2] = \mbox{\hyperlink{group__valueparameters_ga2952b30a5c4b0f76e445fcec8aefd96a}{svm\_parameter\_value\_new}}(svm,\mbox{\hyperlink{group__integervalues_ga691c691125300b70574540ee4ef8aba8}{svm\_value\_integer\_new}}(svm,42));}
\DoxyCodeLine{\textcolor{comment}{// call to FUNCTION remote.compare . ( [ < > = ] INT | 'IN' \{ INT , INT \} ) -\/> BLN}}
\DoxyCodeLine{\mbox{\hyperlink{group__api__types_gadb4e3d3f8c78ef0d286510ef9361bd56}{SVM\_Value\_Boolean}} result = \mbox{\hyperlink{group__functions_gaf9cf14d9f6cadd9f5374bf0de7e4580b}{svm\_function\_call}}(svm,\mbox{\hyperlink{group__pluginentrypointvalues_gafdc3fc527db3cb49272d26abaa11f835}{svm\_value\_pluginentrypoint\_new\_\_raw}}(svm,\textcolor{stringliteral}{"{}remote"{}},\textcolor{stringliteral}{"{}compare"{}}),3,parameters);}
\DoxyCodeLine{\textcolor{keywordflow}{if}(\mbox{\hyperlink{group__booleanvalues_ga4b6099d2a90f14508184087515afcc68}{svm\_value\_boolean\_get}}(svm,result))}
\DoxyCodeLine{\{}
\DoxyCodeLine{    \textcolor{comment}{// ...}}
\DoxyCodeLine{\}}

\end{DoxyCode}


\begin{DoxyReturn}{Returns}
The function result. This result can be\+:
\begin{DoxyItemize}
\item a value,
\item a null value,
\item a structure,
\item a variable,
\item the NULL pointer when no result is returned.
\end{DoxyItemize}
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em FAILURE} & interruption when a parameter is incorrect. (Please refer to the main description page of this API.) \\
\hline
{\em FAILURE} & interruption when the function does not exist. \\
\hline
{\em FAILURE} & interruption when the parameters function are not compatible with the function definition. \\
\hline
{\em FAILURE} & interruption when the return value of the function is not compatible with the function definition.\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__parameters_ga969cd98d3dec30c44f1bb00169d2ac95}{svm\+\_\+parameter\+\_\+array\+\_\+new}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{group__functions_ga43039c7ce7f1e70e9dcbf883b51aa430}\label{group__functions_ga43039c7ce7f1e70e9dcbf883b51aa430}} 
\index{SVM functions@{SVM functions}!svm\_function\_get\_prototype@{svm\_function\_get\_prototype}}
\index{svm\_function\_get\_prototype@{svm\_function\_get\_prototype}!SVM functions@{SVM functions}}
\doxysubsubsection{\texorpdfstring{svm\_function\_get\_prototype()}{svm\_function\_get\_prototype()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} \mbox{\hyperlink{struct_s_v_m___string}{SVM\+\_\+\+String}} svm\+\_\+function\+\_\+get\+\_\+prototype (\begin{DoxyParamCaption}\item[{const void $\ast$}]{svm,  }\item[{const \mbox{\hyperlink{group__api__types_ga90c57554e1d1ea2967e133696d0cf2cd}{SVM\+\_\+\+Value\+\_\+\+Plugin\+Entry\+Point}}}]{name }\end{DoxyParamCaption})}



This function returns a string representing the prototype of a plugin defined function. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em svm} & The SVM pointer passed as first argument of the callback function. \\
\hline
\mbox{\texttt{ in}}  & {\em name} & The plugin function name.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The function prototype as a string.
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em FAILURE} & interruption when a parameter is incorrect. (Please refer to the main description page of this API.) \\
\hline
{\em FAILURE} & interruption when the function does not exist. \\
\hline
\end{DoxyExceptions}
