\doxysection{SVM plugin configuration}
\hypertarget{group__configuration}{}\label{group__configuration}\index{SVM plugin configuration@{SVM plugin configuration}}


This module contains API functions used to configure a SVM plugin.  


\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} const char \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{group__configuration_gad76da49635a7ea7c1058b4f833e50dd6}{svm\+\_\+api\+\_\+get\+\_\+signature}} ()
\begin{DoxyCompactList}\small\item\em This function helps the SVM to check the compatibility of a given plugin to its own API. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} void \mbox{\hyperlink{group__configuration_gaf47636f87a36be01d18957d544eacd14}{svm\+\_\+plugin\+\_\+configure}} (void \texorpdfstring{$\ast$}{*}plugin\+\_\+handler, const char \texorpdfstring{$\ast$}{*}plugin\+\_\+configuration, const char api\+\_\+signature\mbox{[}$\,$\mbox{]}, const char svm\+\_\+version\mbox{[}$\,$\mbox{]})
\begin{DoxyCompactList}\small\item\em This function configures a plugin to the virtual machine. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
This module contains API functions used to configure a SVM plugin. 

The configuration of a plugin is done through a dedicated C callback function\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordtype}{void}\ plugin\_configure(\textcolor{keywordtype}{void}\ *plugin);}

\end{DoxyCode}


This function can perform some initialisations, but has to call the API function\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordtype}{void}\ \mbox{\hyperlink{group__configuration_gaf47636f87a36be01d18957d544eacd14}{svm\_plugin\_configure}}(\textcolor{keywordtype}{void}\ *plugin\_handler,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *plugin\_configuration,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ api\_signature[],\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ svm\_version[]);}

\end{DoxyCode}
 to register all defined objects into the virtual machine.

\begin{DoxySeeAlso}{See also}
\doxylink{group__configuration_gaf47636f87a36be01d18957d544eacd14}{svm\+\_\+plugin\+\_\+configure} 
\end{DoxySeeAlso}


\doxysubsection{Function Documentation}
\Hypertarget{group__configuration_gad76da49635a7ea7c1058b4f833e50dd6}\label{group__configuration_gad76da49635a7ea7c1058b4f833e50dd6} 
\index{SVM plugin configuration@{SVM plugin configuration}!svm\_api\_get\_signature@{svm\_api\_get\_signature}}
\index{svm\_api\_get\_signature@{svm\_api\_get\_signature}!SVM plugin configuration@{SVM plugin configuration}}
\doxysubsubsection{\texorpdfstring{svm\_api\_get\_signature()}{svm\_api\_get\_signature()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} const char \texorpdfstring{$\ast$}{*} svm\+\_\+api\+\_\+get\+\_\+signature (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



This function helps the SVM to check the compatibility of a given plugin to its own API. 

Any detected incompatibility aborts the boot of the SVM to prevent issues at run time.

\begin{DoxyReturn}{Returns}
A string containing a hash of the API, computed with the SVM\+\_\+\+TYPE\texorpdfstring{$\ast$}{*} and SVM\+\_\+\+FUNCTION macros. 
\end{DoxyReturn}
\Hypertarget{group__configuration_gaf47636f87a36be01d18957d544eacd14}\label{group__configuration_gaf47636f87a36be01d18957d544eacd14} 
\index{SVM plugin configuration@{SVM plugin configuration}!svm\_plugin\_configure@{svm\_plugin\_configure}}
\index{svm\_plugin\_configure@{svm\_plugin\_configure}!SVM plugin configuration@{SVM plugin configuration}}
\doxysubsubsection{\texorpdfstring{svm\_plugin\_configure()}{svm\_plugin\_configure()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} void svm\+\_\+plugin\+\_\+configure (\begin{DoxyParamCaption}\item[{void \texorpdfstring{$\ast$}{*}}]{plugin\+\_\+handler,  }\item[{const char \texorpdfstring{$\ast$}{*}}]{plugin\+\_\+configuration,  }\item[{const char}]{api\+\_\+signature\mbox{[}$\,$\mbox{]},  }\item[{const char}]{svm\+\_\+version\mbox{[}$\,$\mbox{]} }\end{DoxyParamCaption})}



This function configures a plugin to the virtual machine. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em plugin\+\_\+handler} & An opaque pointer representing a plugin. This pointer is given by the SVM as the first parameter of the plugin\+\_\+configure function. \\
\hline
\mbox{\texttt{ in}}  & {\em plugin\+\_\+configuration} & A string representing the dependencies and the definitions of the plugin. Please refer to the SVM man page to have more details about this string syntax. \\
\hline
\mbox{\texttt{ in}}  & {\em api\+\_\+signature} & A string representing the SVM API hash used at plugin compilation time. The macro SVM\+\_\+\+API\+\_\+\+SIGNATURE defined in the \texorpdfstring{$<$}{<}svm/svm\+\_\+compatibility.\+h\texorpdfstring{$>$}{>} header should be used here. \\
\hline
\mbox{\texttt{ in}}  & {\em svm\+\_\+version} & A string representing the SVM version used at plugin compilation time. The macro SVM\+\_\+\+VERSION defined in the \texorpdfstring{$<$}{<}svm/svm\+\_\+compatibility.\+h\texorpdfstring{$>$}{>} header should be used here.\\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
This function SHALL be called from the function 
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordtype}{void}\ plugin\_configure(\textcolor{keywordtype}{void}\ *plugin);}

\end{DoxyCode}
 defined once in each plugin to declare the plugin content to the SVM. This specific plugin callback will be called at the virtual machine boot time to setup the full virtual machine architecture.
\end{DoxyNote}
A typical example of a plugin configuration function\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <svm/svm\_compatibility.h>}}
\DoxyCodeLine{}
\DoxyCodeLine{...}
\DoxyCodeLine{}
\DoxyCodeLine{void\ plugin\_configure(\textcolor{keywordtype}{void}\ *plugin)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{group__configuration_gaf47636f87a36be01d18957d544eacd14}{svm\_plugin\_configure}}(plugin,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}PLUGIN\ //\ put\ here\ the\ plugin\ name\ \(\backslash\)n"{}}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}USE\ \(\backslash\)n"{}}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ ...\ \textcolor{comment}{//\ put\ here\ the\ plugin\ objects\ dependencies}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}DEFINE\ \(\backslash\)n"{}}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ ...\ \textcolor{comment}{//\ put\ here\ the\ objects\ the\ plugin\ promotes}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}"{}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{svm__compatibility_8h_a6f9cdc25c96bb10ceaa895867b4b4301}{SVM\_API\_SIGNATURE}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{svm__compatibility_8h_ae2883df1958a4d06eca535dd64933d4c}{SVM\_VERSION}}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ );}
\DoxyCodeLine{\}}

\end{DoxyCode}
 