@@ -1715,6 +1715,82 @@ wasm_runtime_instantiation_args_set_max_memory_pages(
17151715 p -> v1 .max_memory_pages = v ;
17161716}
17171717
1718+ void
1719+ wasm_runtime_instantiation_args_set_wasi_arg (struct InstantiationArgs2 * p ,
1720+ char * argv [], int argc )
1721+ {
1722+ WASIArguments * wasi_args = & p -> wasi ;
1723+
1724+ wasi_args -> argv = argv ;
1725+ wasi_args -> argc = (uint32 )argc ;
1726+ wasi_args -> set_by_user = true;
1727+ }
1728+
1729+ void
1730+ wasm_runtime_instantiation_args_set_wasi_env (struct InstantiationArgs2 * p ,
1731+ const char * env [],
1732+ uint32 env_count )
1733+ {
1734+ WASIArguments * wasi_args = & p -> wasi ;
1735+
1736+ wasi_args -> env = env ;
1737+ wasi_args -> env_count = env_count ;
1738+ wasi_args -> set_by_user = true;
1739+ }
1740+
1741+ void
1742+ wasm_runtime_instantiation_args_set_wasi_dir (struct InstantiationArgs2 * p ,
1743+ const char * dir_list [],
1744+ uint32 dir_count ,
1745+ const char * map_dir_list [],
1746+ uint32 map_dir_count )
1747+ {
1748+ WASIArguments * wasi_args = & p -> wasi ;
1749+
1750+ wasi_args -> dir_list = dir_list ;
1751+ wasi_args -> dir_count = dir_count ;
1752+ wasi_args -> map_dir_list = map_dir_list ;
1753+ wasi_args -> map_dir_count = map_dir_count ;
1754+ wasi_args -> set_by_user = true;
1755+ }
1756+
1757+ void
1758+ wasm_runtime_instantiation_args_set_wasi_stdio (struct InstantiationArgs2 * p ,
1759+ int64 stdinfd , int64 stdoutfd ,
1760+ int64 stderrfd )
1761+ {
1762+ WASIArguments * wasi_args = & p -> wasi ;
1763+
1764+ wasi_args -> stdio [0 ] = (os_raw_file_handle )stdinfd ;
1765+ wasi_args -> stdio [1 ] = (os_raw_file_handle )stdoutfd ;
1766+ wasi_args -> stdio [2 ] = (os_raw_file_handle )stderrfd ;
1767+ wasi_args -> set_by_user = true;
1768+ }
1769+
1770+ void
1771+ wasm_runtime_instantiation_args_set_wasi_addr_pool (struct InstantiationArgs2 * p ,
1772+ const char * addr_pool [],
1773+ uint32 addr_pool_size )
1774+ {
1775+ WASIArguments * wasi_args = & p -> wasi ;
1776+
1777+ wasi_args -> addr_pool = addr_pool ;
1778+ wasi_args -> addr_count = addr_pool_size ;
1779+ wasi_args -> set_by_user = true;
1780+ }
1781+
1782+ void
1783+ wasm_runtime_instantiation_args_set_wasi_ns_lookup_pool (
1784+ struct InstantiationArgs2 * p , const char * ns_lookup_pool [],
1785+ uint32 ns_lookup_pool_size )
1786+ {
1787+ WASIArguments * wasi_args = & p -> wasi ;
1788+
1789+ wasi_args -> ns_lookup_pool = ns_lookup_pool ;
1790+ wasi_args -> ns_lookup_count = ns_lookup_pool_size ;
1791+ wasi_args -> set_by_user = true;
1792+ }
1793+
17181794WASMModuleInstanceCommon *
17191795wasm_runtime_instantiate_ex2 (WASMModuleCommon * module ,
17201796 const struct InstantiationArgs2 * args ,
0 commit comments