1 #ifndef WASMTIME_COMPONENT_FUNC_H
2 #define WASMTIME_COMPONENT_FUNC_H
3 
4 #include <wasmtime/conf.h>
5 
6 #ifdef WASMTIME_FEATURE_COMPONENT_MODEL
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 /// \brief Representation of a function in Wasmtime.
13 ///
14 /// Functions in Wasmtime are represented as an index into a store and don't
15 /// have any data or destructor associated with the value. Functions cannot
16 /// interoperate between #wasmtime_store_t instances and if the wrong function
17 /// is passed to the wrong store then it may trigger an assertion to abort the
18 /// process.
19 typedef struct wasmtime_component_func {
20   /// Internal identifier of what store this belongs to, never zero.
21   uint64_t store_id;
22   /// Internal index within the store.
23   size_t index;
24 } wasmtime_component_func_t;
25 
26 #ifdef __cplusplus
27 } // extern "C"
28 #endif
29 
30 #endif // WASMTIME_FEATURE_COMPONENT_MODEL
31 
32 #endif // WASMTIME_COMPONENT_FUNC_H
33