evmc/group__loader.html
Documentation Bot 9b3a656372 Update docs
2020-01-07 15:35:10 +00:00

355 lines
30 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>EVMC: EVMC Loader</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">EVMC
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__loader.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">EVMC Loader</div> </div>
</div><!--header-->
<div class="contents">
<p>EVMC Loader Library.
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga6f2571d256d3a78cd57b57b9db4a3d22"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structevmc__vm.html">evmc_vm</a> *(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__loader.html#ga6f2571d256d3a78cd57b57b9db4a3d22">evmc_create_fn</a>) (void)</td></tr>
<tr class="memdesc:ga6f2571d256d3a78cd57b57b9db4a3d22"><td class="mdescLeft">&#160;</td><td class="mdescRight">The function pointer type for EVMC create functions. <a href="#ga6f2571d256d3a78cd57b57b9db4a3d22">More...</a><br /></td></tr>
<tr class="separator:ga6f2571d256d3a78cd57b57b9db4a3d22"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:gadf193ed1d2d7e9053e9c592fc201bd7d"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__loader.html#gadf193ed1d2d7e9053e9c592fc201bd7d">evmc_loader_error_code</a> { <br />
&#160;&#160;<a class="el" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da0cead101d164fef2ac74efd4d6e1ae6d">EVMC_LOADER_SUCCESS</a> = 0,
<a class="el" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da199bb0c460fa6263b26badcc6f6e65fb">EVMC_LOADER_CANNOT_OPEN</a> = 1,
<a class="el" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da397b783d11709ec470bf5782c377deb2">EVMC_LOADER_SYMBOL_NOT_FOUND</a> = 2,
<a class="el" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da36c6ba4f96cdd1b5407aa0f26a9aa379">EVMC_LOADER_INVALID_ARGUMENT</a> = 3,
<br />
&#160;&#160;<a class="el" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da504de7833560037be4d2c620345767f5">EVMC_LOADER_VM_CREATION_FAILURE</a> = 4,
<a class="el" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da0d4eb3a48d3f8c500b96f43e1aa7c458">EVMC_LOADER_ABI_VERSION_MISMATCH</a> = 5,
<a class="el" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da53b3d46623f93646389aaf65d977aff2">EVMC_LOADER_INVALID_OPTION_NAME</a> = 6,
<a class="el" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7dad2625a5c71f0c585cf0493c47c805e1b">EVMC_LOADER_INVALID_OPTION_VALUE</a> = 7
<br />
}<tr class="memdesc:gadf193ed1d2d7e9053e9c592fc201bd7d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Error codes for the EVMC loader. <a href="group__loader.html#gadf193ed1d2d7e9053e9c592fc201bd7d">More...</a><br /></td></tr>
</td></tr>
<tr class="separator:gadf193ed1d2d7e9053e9c592fc201bd7d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gabcf5733eb4dd80c1ce060aec9ed60600"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__loader.html#ga6f2571d256d3a78cd57b57b9db4a3d22">evmc_create_fn</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__loader.html#gabcf5733eb4dd80c1ce060aec9ed60600">evmc_load</a> (const char *filename, enum <a class="el" href="group__loader.html#gadf193ed1d2d7e9053e9c592fc201bd7d">evmc_loader_error_code</a> *error_code)</td></tr>
<tr class="memdesc:gabcf5733eb4dd80c1ce060aec9ed60600"><td class="mdescLeft">&#160;</td><td class="mdescRight">Dynamically loads the EVMC module with a VM implementation. <a href="#gabcf5733eb4dd80c1ce060aec9ed60600">More...</a><br /></td></tr>
<tr class="separator:gabcf5733eb4dd80c1ce060aec9ed60600"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa74216a5d639e886fd1f1142e893acf6"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structevmc__vm.html">evmc_vm</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__loader.html#gaa74216a5d639e886fd1f1142e893acf6">evmc_load_and_create</a> (const char *filename, enum <a class="el" href="group__loader.html#gadf193ed1d2d7e9053e9c592fc201bd7d">evmc_loader_error_code</a> *error_code)</td></tr>
<tr class="memdesc:gaa74216a5d639e886fd1f1142e893acf6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Dynamically loads the EVMC module and creates the VM instance. <a href="#gaa74216a5d639e886fd1f1142e893acf6">More...</a><br /></td></tr>
<tr class="separator:gaa74216a5d639e886fd1f1142e893acf6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabd3a005d5ac0ca5230e71df1b1940f9c"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structevmc__vm.html">evmc_vm</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__loader.html#gabd3a005d5ac0ca5230e71df1b1940f9c">evmc_load_and_configure</a> (const char *config, enum <a class="el" href="group__loader.html#gadf193ed1d2d7e9053e9c592fc201bd7d">evmc_loader_error_code</a> *error_code)</td></tr>
<tr class="memdesc:gabd3a005d5ac0ca5230e71df1b1940f9c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Dynamically loads the EVMC module, then creates and configures the VM instance. <a href="#gabd3a005d5ac0ca5230e71df1b1940f9c">More...</a><br /></td></tr>
<tr class="separator:gabd3a005d5ac0ca5230e71df1b1940f9c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1b36106eb4b0d1c06580071a85225cf0"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__loader.html#ga1b36106eb4b0d1c06580071a85225cf0">evmc_last_error_msg</a> ()</td></tr>
<tr class="memdesc:ga1b36106eb4b0d1c06580071a85225cf0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the human-readable message describing the most recent error that occurred in EVMC loading since the last call to this function. <a href="#ga1b36106eb4b0d1c06580071a85225cf0">More...</a><br /></td></tr>
<tr class="separator:ga1b36106eb4b0d1c06580071a85225cf0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>EVMC Loader Library. </p>
<p>The EVMC Loader Library supports loading VMs implemented as Dynamically Loaded Libraries (DLLs, shared objects). </p>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga6f2571d256d3a78cd57b57b9db4a3d22"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6f2571d256d3a78cd57b57b9db4a3d22">&#9670;&nbsp;</a></span>evmc_create_fn</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef struct <a class="el" href="structevmc__vm.html">evmc_vm</a>*(* evmc_create_fn) (void)</td>
</tr>
</table>
</div><div class="memdoc">
<p>The function pointer type for EVMC create functions. </p>
<p class="definition">Definition at line <a class="el" href="loader_8h_source.html#l00022">22</a> of file <a class="el" href="loader_8h_source.html">loader.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="gadf193ed1d2d7e9053e9c592fc201bd7d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadf193ed1d2d7e9053e9c592fc201bd7d">&#9670;&nbsp;</a></span>evmc_loader_error_code</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="group__loader.html#gadf193ed1d2d7e9053e9c592fc201bd7d">evmc_loader_error_code</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Error codes for the EVMC loader. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggadf193ed1d2d7e9053e9c592fc201bd7da0cead101d164fef2ac74efd4d6e1ae6d"></a>EVMC_LOADER_SUCCESS&#160;</td><td class="fielddoc"><p>The loader succeeded. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggadf193ed1d2d7e9053e9c592fc201bd7da199bb0c460fa6263b26badcc6f6e65fb"></a>EVMC_LOADER_CANNOT_OPEN&#160;</td><td class="fielddoc"><p>The loader cannot open the given file name. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggadf193ed1d2d7e9053e9c592fc201bd7da397b783d11709ec470bf5782c377deb2"></a>EVMC_LOADER_SYMBOL_NOT_FOUND&#160;</td><td class="fielddoc"><p>The VM create function not found. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggadf193ed1d2d7e9053e9c592fc201bd7da36c6ba4f96cdd1b5407aa0f26a9aa379"></a>EVMC_LOADER_INVALID_ARGUMENT&#160;</td><td class="fielddoc"><p>The invalid argument value provided. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggadf193ed1d2d7e9053e9c592fc201bd7da504de7833560037be4d2c620345767f5"></a>EVMC_LOADER_VM_CREATION_FAILURE&#160;</td><td class="fielddoc"><p>The creation of a VM instance has failed. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggadf193ed1d2d7e9053e9c592fc201bd7da0d4eb3a48d3f8c500b96f43e1aa7c458"></a>EVMC_LOADER_ABI_VERSION_MISMATCH&#160;</td><td class="fielddoc"><p>The ABI version of the VM instance has mismatched. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggadf193ed1d2d7e9053e9c592fc201bd7da53b3d46623f93646389aaf65d977aff2"></a>EVMC_LOADER_INVALID_OPTION_NAME&#160;</td><td class="fielddoc"><p>The VM option is invalid. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggadf193ed1d2d7e9053e9c592fc201bd7dad2625a5c71f0c585cf0493c47c805e1b"></a>EVMC_LOADER_INVALID_OPTION_VALUE&#160;</td><td class="fielddoc"><p>The VM option value is invalid. </p>
</td></tr>
</table>
<p class="definition">Definition at line <a class="el" href="loader_8h_source.html#l00025">25</a> of file <a class="el" href="loader_8h_source.html">loader.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;{</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; <a class="code" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da0cead101d164fef2ac74efd4d6e1ae6d">EVMC_LOADER_SUCCESS</a> = 0,</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; <a class="code" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da199bb0c460fa6263b26badcc6f6e65fb">EVMC_LOADER_CANNOT_OPEN</a> = 1,</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; <a class="code" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da397b783d11709ec470bf5782c377deb2">EVMC_LOADER_SYMBOL_NOT_FOUND</a> = 2,</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; <a class="code" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da36c6ba4f96cdd1b5407aa0f26a9aa379">EVMC_LOADER_INVALID_ARGUMENT</a> = 3,</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; <a class="code" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da504de7833560037be4d2c620345767f5">EVMC_LOADER_VM_CREATION_FAILURE</a> = 4,</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <a class="code" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da0d4eb3a48d3f8c500b96f43e1aa7c458">EVMC_LOADER_ABI_VERSION_MISMATCH</a> = 5,</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <a class="code" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da53b3d46623f93646389aaf65d977aff2">EVMC_LOADER_INVALID_OPTION_NAME</a> = 6,</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; <a class="code" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7dad2625a5c71f0c585cf0493c47c805e1b">EVMC_LOADER_INVALID_OPTION_VALUE</a> = 7</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;};</div><div class="ttc" id="group__loader_html_ggadf193ed1d2d7e9053e9c592fc201bd7da53b3d46623f93646389aaf65d977aff2"><div class="ttname"><a href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da53b3d46623f93646389aaf65d977aff2">EVMC_LOADER_INVALID_OPTION_NAME</a></div><div class="ttdoc">The VM option is invalid. </div><div class="ttdef"><b>Definition:</b> <a href="loader_8h_source.html#l00046">loader.h:46</a></div></div>
<div class="ttc" id="group__loader_html_ggadf193ed1d2d7e9053e9c592fc201bd7da0cead101d164fef2ac74efd4d6e1ae6d"><div class="ttname"><a href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da0cead101d164fef2ac74efd4d6e1ae6d">EVMC_LOADER_SUCCESS</a></div><div class="ttdoc">The loader succeeded. </div><div class="ttdef"><b>Definition:</b> <a href="loader_8h_source.html#l00028">loader.h:28</a></div></div>
<div class="ttc" id="group__loader_html_ggadf193ed1d2d7e9053e9c592fc201bd7dad2625a5c71f0c585cf0493c47c805e1b"><div class="ttname"><a href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7dad2625a5c71f0c585cf0493c47c805e1b">EVMC_LOADER_INVALID_OPTION_VALUE</a></div><div class="ttdoc">The VM option value is invalid. </div><div class="ttdef"><b>Definition:</b> <a href="loader_8h_source.html#l00049">loader.h:49</a></div></div>
<div class="ttc" id="group__loader_html_ggadf193ed1d2d7e9053e9c592fc201bd7da36c6ba4f96cdd1b5407aa0f26a9aa379"><div class="ttname"><a href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da36c6ba4f96cdd1b5407aa0f26a9aa379">EVMC_LOADER_INVALID_ARGUMENT</a></div><div class="ttdoc">The invalid argument value provided. </div><div class="ttdef"><b>Definition:</b> <a href="loader_8h_source.html#l00037">loader.h:37</a></div></div>
<div class="ttc" id="group__loader_html_ggadf193ed1d2d7e9053e9c592fc201bd7da504de7833560037be4d2c620345767f5"><div class="ttname"><a href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da504de7833560037be4d2c620345767f5">EVMC_LOADER_VM_CREATION_FAILURE</a></div><div class="ttdoc">The creation of a VM instance has failed. </div><div class="ttdef"><b>Definition:</b> <a href="loader_8h_source.html#l00040">loader.h:40</a></div></div>
<div class="ttc" id="group__loader_html_ggadf193ed1d2d7e9053e9c592fc201bd7da199bb0c460fa6263b26badcc6f6e65fb"><div class="ttname"><a href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da199bb0c460fa6263b26badcc6f6e65fb">EVMC_LOADER_CANNOT_OPEN</a></div><div class="ttdoc">The loader cannot open the given file name. </div><div class="ttdef"><b>Definition:</b> <a href="loader_8h_source.html#l00031">loader.h:31</a></div></div>
<div class="ttc" id="group__loader_html_ggadf193ed1d2d7e9053e9c592fc201bd7da397b783d11709ec470bf5782c377deb2"><div class="ttname"><a href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da397b783d11709ec470bf5782c377deb2">EVMC_LOADER_SYMBOL_NOT_FOUND</a></div><div class="ttdoc">The VM create function not found. </div><div class="ttdef"><b>Definition:</b> <a href="loader_8h_source.html#l00034">loader.h:34</a></div></div>
<div class="ttc" id="group__loader_html_ggadf193ed1d2d7e9053e9c592fc201bd7da0d4eb3a48d3f8c500b96f43e1aa7c458"><div class="ttname"><a href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da0d4eb3a48d3f8c500b96f43e1aa7c458">EVMC_LOADER_ABI_VERSION_MISMATCH</a></div><div class="ttdoc">The ABI version of the VM instance has mismatched. </div><div class="ttdef"><b>Definition:</b> <a href="loader_8h_source.html#l00043">loader.h:43</a></div></div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga1b36106eb4b0d1c06580071a85225cf0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1b36106eb4b0d1c06580071a85225cf0">&#9670;&nbsp;</a></span>evmc_last_error_msg()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char* evmc_last_error_msg </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the human-readable message describing the most recent error that occurred in EVMC loading since the last call to this function. </p>
<p>In case any loading function returned <a class="el" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da0cead101d164fef2ac74efd4d6e1ae6d" title="The loader succeeded. ">EVMC_LOADER_SUCCESS</a> this function always returns NULL. In case of error code other than success returned, this function MAY return the error message. Calling this function "consumes" the error message and the function will return NULL from subsequent invocations. This function is not thread-safe.</p>
<dl class="section return"><dt>Returns</dt><dd>Error message or NULL if no additional information is available. The returned pointer MUST NOT be freed by the caller. </dd></dl>
</div>
</div>
<a id="gabcf5733eb4dd80c1ce060aec9ed60600"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabcf5733eb4dd80c1ce060aec9ed60600">&#9670;&nbsp;</a></span>evmc_load()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__loader.html#ga6f2571d256d3a78cd57b57b9db4a3d22">evmc_create_fn</a> evmc_load </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>filename</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">enum <a class="el" href="group__loader.html#gadf193ed1d2d7e9053e9c592fc201bd7d">evmc_loader_error_code</a> *&#160;</td>
<td class="paramname"><em>error_code</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Dynamically loads the EVMC module with a VM implementation. </p>
<p>This function tries to open a dynamically loaded library (DLL) at the given <code>filename</code>. On UNIX-like systems dlopen() function is used. On Windows LoadLibrary() function is used.</p>
<p>If the file does not exist or is not a valid shared library the <a class="el" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da199bb0c460fa6263b26badcc6f6e65fb" title="The loader cannot open the given file name. ">EVMC_LOADER_CANNOT_OPEN</a> error code is signaled and NULL is returned.</p>
<p>After the DLL is successfully loaded the function tries to find the EVM create function in the library. The <code>filename</code> is used to guess the EVM name and the name of the create function. The create function name is constructed by the following rules. Consider example path: "/ethereum/libexample-interpreter.so.1.0".</p><ul>
<li>the filename is taken from the path: "libexample-interpreter.so.1.0",</li>
<li>the "lib" prefix and all file extensions are stripped from the name: "example-interpreter"</li>
<li>all "-" are replaced with "_" to construct <em>base name</em>: "example_interpreter",</li>
<li>the function name "evmc_create_" + <em>base name</em> is searched in the library: "evmc_create_example_interpreter",</li>
<li>if the function is not found, the function name "evmc_create" is searched in the library.</li>
</ul>
<p>If the create function is found in the library, the pointer to the function is returned. Otherwise, the <a class="el" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da397b783d11709ec470bf5782c377deb2" title="The VM create function not found. ">EVMC_LOADER_SYMBOL_NOT_FOUND</a> error code is signaled and NULL is returned.</p>
<p>It is safe to call this function with the same filename argument multiple times (the DLL is not going to be loaded multiple times).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">filename</td><td>The null terminated path (absolute or relative) to an EVMC module (dynamically loaded library) containing the VM implementation. If the value is NULL, an empty C-string or longer than the path maximum length the <a class="el" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da36c6ba4f96cdd1b5407aa0f26a9aa379" title="The invalid argument value provided. ">EVMC_LOADER_INVALID_ARGUMENT</a> is signaled. </td></tr>
<tr><td class="paramname">error_code</td><td>The pointer to the error code. If not NULL the value is set to <a class="el" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da0cead101d164fef2ac74efd4d6e1ae6d" title="The loader succeeded. ">EVMC_LOADER_SUCCESS</a> on success or any other error code as described above. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The pointer to the EVM create function or NULL in case of error. </dd></dl>
</div>
</div>
<a id="gabd3a005d5ac0ca5230e71df1b1940f9c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabd3a005d5ac0ca5230e71df1b1940f9c">&#9670;&nbsp;</a></span>evmc_load_and_configure()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct <a class="el" href="structevmc__vm.html">evmc_vm</a>* evmc_load_and_configure </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>config</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">enum <a class="el" href="group__loader.html#gadf193ed1d2d7e9053e9c592fc201bd7d">evmc_loader_error_code</a> *&#160;</td>
<td class="paramname"><em>error_code</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Dynamically loads the EVMC module, then creates and configures the VM instance. </p>
<p>This function performs the following actions atomically:</p><ul>
<li>loads the EVMC module (as <a class="el" href="group__loader.html#gabcf5733eb4dd80c1ce060aec9ed60600" title="Dynamically loads the EVMC module with a VM implementation. ">evmc_load()</a>),</li>
<li>creates the VM instance,</li>
<li>configures the VM instance with options provided in the <code>config</code> parameter.</li>
</ul>
<p>The configuration string (<code>config</code>) has the following syntax: </p><pre class="fragment">&lt;path&gt; ("," &lt;option-name&gt; ["=" &lt;option-value&gt;])*
</pre><p>In this syntax, an option without a value can be specified (<code>,option,</code>) as a shortcut for using empty value (<code>,option=,</code>).</p>
<p>Options are passed to a VM in the order they are specified in the configuration string. It is up to the VM implementation how to handle duplicated options and other conflicts.</p>
<p>Example configuration string: </p><pre class="fragment">./modules/vm.so,engine=compiler,trace,verbosity=2
</pre><p>The function signals the same errors as <a class="el" href="group__loader.html#gaa74216a5d639e886fd1f1142e893acf6" title="Dynamically loads the EVMC module and creates the VM instance. ">evmc_load_and_create()</a> and additionally:</p><ul>
<li><a class="el" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da53b3d46623f93646389aaf65d977aff2" title="The VM option is invalid. ">EVMC_LOADER_INVALID_OPTION_NAME</a> when the provided options list contains an option unknown for the VM,</li>
<li><a class="el" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7dad2625a5c71f0c585cf0493c47c805e1b" title="The VM option value is invalid. ">EVMC_LOADER_INVALID_OPTION_VALUE</a> when there exists unsupported value for a given VM option.</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">config</td><td>The path to the EVMC module with additional configuration options. </td></tr>
<tr><td class="paramname">error_code</td><td>The pointer to the error code. If not NULL the value is set to <a class="el" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da0cead101d164fef2ac74efd4d6e1ae6d" title="The loader succeeded. ">EVMC_LOADER_SUCCESS</a> on success or any other error code as described above. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The pointer to the created VM or NULL in case of error. </dd></dl>
</div>
</div>
<a id="gaa74216a5d639e886fd1f1142e893acf6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa74216a5d639e886fd1f1142e893acf6">&#9670;&nbsp;</a></span>evmc_load_and_create()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct <a class="el" href="structevmc__vm.html">evmc_vm</a>* evmc_load_and_create </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>filename</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">enum <a class="el" href="group__loader.html#gadf193ed1d2d7e9053e9c592fc201bd7d">evmc_loader_error_code</a> *&#160;</td>
<td class="paramname"><em>error_code</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Dynamically loads the EVMC module and creates the VM instance. </p>
<p>This is a macro for creating the VM instance with the function returned from <a class="el" href="group__loader.html#gabcf5733eb4dd80c1ce060aec9ed60600" title="Dynamically loads the EVMC module with a VM implementation. ">evmc_load()</a>. The function signals the same errors as <a class="el" href="group__loader.html#gabcf5733eb4dd80c1ce060aec9ed60600" title="Dynamically loads the EVMC module with a VM implementation. ">evmc_load()</a> and additionally:</p><ul>
<li><a class="el" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da504de7833560037be4d2c620345767f5" title="The creation of a VM instance has failed. ">EVMC_LOADER_VM_CREATION_FAILURE</a> when the create function returns NULL,</li>
<li><a class="el" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da0d4eb3a48d3f8c500b96f43e1aa7c458" title="The ABI version of the VM instance has mismatched. ">EVMC_LOADER_ABI_VERSION_MISMATCH</a> when the created VM instance has ABI version different from the ABI version of this library (<a class="el" href="group__EVMC.html#gga06fc87d81c62e9abb8790b6e5713c55ba1db9144f8af4e62865f0c003c07a02bc" title="The EVMC ABI version number of the interface declared in this file. ">EVMC_ABI_VERSION</a>).</li>
</ul>
<p>It is safe to call this function with the same filename argument multiple times: the DLL is not going to be loaded multiple times, but the function will return new VM instance each time.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">filename</td><td>The null terminated path (absolute or relative) to an EVMC module (dynamically loaded library) containing the VM implementation. If the value is NULL, an empty C-string or longer than the path maximum length the <a class="el" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da36c6ba4f96cdd1b5407aa0f26a9aa379" title="The invalid argument value provided. ">EVMC_LOADER_INVALID_ARGUMENT</a> is signaled. </td></tr>
<tr><td class="paramname">error_code</td><td>The pointer to the error code. If not NULL the value is set to <a class="el" href="group__loader.html#ggadf193ed1d2d7e9053e9c592fc201bd7da0cead101d164fef2ac74efd4d6e1ae6d" title="The loader succeeded. ">EVMC_LOADER_SUCCESS</a> on success or any other error code as described above. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The pointer to the created VM or NULL in case of error. </dd></dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated on Tue Jan 7 2020 15:35:10 for EVMC by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
</ul>
</div>
</body>
</html>