Skip to content

Commit a8f5e8f

Browse files
author
Le Yao
committed
Add type convert for WAMR
Types for webassembly micro runtime Signed-off-by: Le Yao <[email protected]>
1 parent 6769e24 commit a8f5e8f

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

src/wamr/types.h

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright 2020 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#include "src/common/types.h"
16+
#include "wasm_c_api.h"
17+
18+
namespace proxy_wasm {
19+
namespace wamr {
20+
21+
using WasmEnginePtr = common::CSmartPtr<wasm_engine_t, wasm_engine_delete>;
22+
using WasmFuncPtr = common::CSmartPtr<wasm_func_t, wasm_func_delete>;
23+
using WasmStorePtr = common::CSmartPtr<wasm_store_t, wasm_store_delete>;
24+
using WasmModulePtr = common::CSmartPtr<wasm_module_t, wasm_module_delete>;
25+
using WasmMemoryPtr = common::CSmartPtr<wasm_memory_t, wasm_memory_delete>;
26+
using WasmTablePtr = common::CSmartPtr<wasm_table_t, wasm_table_delete>;
27+
using WasmInstancePtr = common::CSmartPtr<wasm_instance_t, wasm_instance_delete>;
28+
using WasmFunctypePtr = common::CSmartPtr<wasm_functype_t, wasm_functype_delete>;
29+
using WasmTrapPtr = common::CSmartPtr<wasm_trap_t, wasm_trap_delete>;
30+
using WasmExternPtr = common::CSmartPtr<wasm_extern_t, wasm_extern_delete>;
31+
32+
using WasmByteVec =
33+
common::CSmartType<wasm_byte_vec_t, wasm_byte_vec_new_empty, wasm_byte_vec_delete>;
34+
using WasmImporttypeVec = common::CSmartType<wasm_importtype_vec_t, wasm_importtype_vec_new_empty,
35+
wasm_importtype_vec_delete>;
36+
using WasmExportTypeVec = common::CSmartType<wasm_exporttype_vec_t, wasm_exporttype_vec_new_empty,
37+
wasm_exporttype_vec_delete>;
38+
using WasmExternVec =
39+
common::CSmartType<wasm_extern_vec_t, wasm_extern_vec_new_empty, wasm_extern_vec_delete>;
40+
using WasmValtypeVec =
41+
common::CSmartType<wasm_valtype_vec_t, wasm_valtype_vec_new_empty, wasm_valtype_vec_delete>;
42+
43+
} // namespace WAMR (webassembly micro runtime)
44+
45+
} // namespace proxy_wasm

0 commit comments

Comments
 (0)