@@ -81,8 +81,11 @@ typedef struct WASMTableType *wasm_table_type_t;
8181struct WASMGlobalType ;
8282typedef struct WASMGlobalType * wasm_global_type_t ;
8383
84+ #ifndef WASM_MEMORY_T_DEFINED
85+ #define WASM_MEMORY_T_DEFINED
8486struct WASMMemory ;
8587typedef struct WASMMemory WASMMemoryType ;
88+ #endif
8689typedef WASMMemoryType * wasm_memory_type_t ;
8790
8891typedef struct wasm_import_t {
@@ -419,6 +422,28 @@ wasm_runtime_get_mem_alloc_info(mem_alloc_info_t *mem_alloc_info);
419422WASM_RUNTIME_API_EXTERN package_type_t
420423get_package_type (const uint8_t * buf , uint32_t size );
421424
425+ /**
426+ * Get the package type of a buffer (same as get_package_type).
427+ *
428+ * @param buf the package buffer
429+ * @param size the package buffer size
430+ *
431+ * @return the package type, return Package_Type_Unknown if the type is unknown
432+ */
433+ WASM_RUNTIME_API_EXTERN package_type_t
434+ wasm_runtime_get_file_package_type (const uint8_t * buf , uint32_t size );
435+
436+ /**
437+ * Get the package type of a module.
438+ *
439+ * @param module the module
440+ *
441+ * @return the package type, return Package_Type_Unknown if the type is
442+ * unknown
443+ */
444+ WASM_RUNTIME_API_EXTERN package_type_t
445+ wasm_runtime_get_module_package_type (wasm_module_t module );
446+
422447/**
423448 * Check whether a file is an AOT XIP (Execution In Place) file
424449 *
@@ -1202,7 +1227,7 @@ wasm_runtime_validate_native_addr(wasm_module_inst_t module_inst,
12021227 void * native_ptr , uint64_t size );
12031228
12041229/**
1205- * Convert app address(relative address) to native address(absolute address)
1230+ * Convert app address (relative address) to native address (absolute address)
12061231 *
12071232 * Note that native addresses to module instance memory can be invalidated
12081233 * on a memory growth. (Except shared memory, whose native addresses are
@@ -1218,7 +1243,7 @@ wasm_runtime_addr_app_to_native(wasm_module_inst_t module_inst,
12181243 uint64_t app_offset );
12191244
12201245/**
1221- * Convert native address(absolute address) to app address(relative address)
1246+ * Convert native address (absolute address) to app address (relative address)
12221247 *
12231248 * @param module_inst the WASM module instance
12241249 * @param native_ptr the native address
@@ -1842,9 +1867,17 @@ WASM_RUNTIME_API_EXTERN bool
18421867wasm_runtime_is_import_global_linked (const char * module_name ,
18431868 const char * global_name );
18441869
1870+ /**
1871+ * Enlarge the memory region for a module instance
1872+ *
1873+ * @param module_inst the module instance
1874+ * @param inc_page_count the number of pages to add
1875+ *
1876+ * @return true if success, false otherwise
1877+ */
18451878WASM_RUNTIME_API_EXTERN bool
18461879wasm_runtime_enlarge_memory (wasm_module_inst_t module_inst ,
1847- uint32_t inc_page_count );
1880+ uint64_t inc_page_count );
18481881
18491882typedef enum {
18501883 INTERNAL_ERROR ,
0 commit comments