@@ -208,6 +208,14 @@ WASMTIME_CONFIG_PROP(void, wasm_bulk_memory, bool)
208
208
*/
209
209
WASMTIME_CONFIG_PROP (void , wasm_multi_value , bool )
210
210
211
+ /**
212
+ * \brief Configures whether the WebAssembly module linking proposal is
213
+ * enabled.
214
+ *
215
+ * This setting is `false` by default.
216
+ */
217
+ WASMTIME_CONFIG_PROP (void , wasm_module_linking , bool )
218
+
211
219
/**
212
220
* \brief Configures how JIT code will be compiled.
213
221
*
@@ -961,6 +969,284 @@ WASM_API_EXTERN own wasmtime_error_t *wasmtime_module_deserialize(
961
969
own wasm_module_t * * ret
962
970
);
963
971
972
+ /**
973
+ * \struct wasm_instancetype_t
974
+ * \brief An opaque object representing the type of a function.
975
+ *
976
+ * \typedef wasm_instancetype_t
977
+ * \brief Convenience alias for #wasm_instancetype_t
978
+ *
979
+ * \struct wasm_instancetype_vec_t
980
+ * \brief A list of #wasm_instancetype_t values.
981
+ *
982
+ * \var wasm_instancetype_vec_t::size
983
+ * \brief Length of this vector.
984
+ *
985
+ * \var wasm_instancetype_vec_t::data
986
+ * \brief Pointer to the base of this vector
987
+ *
988
+ * \typedef wasm_instancetype_vec_t
989
+ * \brief Convenience alias for #wasm_instancetype_vec_t
990
+ *
991
+ * \fn void wasm_instancetype_delete(own wasm_instancetype_t *);
992
+ * \brief Deletes a type.
993
+ *
994
+ * \fn void wasm_instancetype_vec_new_empty(own wasm_instancetype_vec_t *out);
995
+ * \brief Creates an empty vector.
996
+ *
997
+ * See #wasm_byte_vec_new_empty for more information.
998
+ *
999
+ * \fn void wasm_instancetype_vec_new_uninitialized(own wasm_instancetype_vec_t *out, size_t);
1000
+ * \brief Creates a vector with the given capacity.
1001
+ *
1002
+ * See #wasm_byte_vec_new_uninitialized for more information.
1003
+ *
1004
+ * \fn void wasm_instancetype_vec_new(own wasm_instancetype_vec_t *out, size_t, own wasm_instancetype_t *const[]);
1005
+ * \brief Creates a vector with the provided contents.
1006
+ *
1007
+ * See #wasm_byte_vec_new for more information.
1008
+ *
1009
+ * \fn void wasm_instancetype_vec_copy(own wasm_instancetype_vec_t *out, const wasm_instancetype_vec_t *)
1010
+ * \brief Copies one vector to another
1011
+ *
1012
+ * See #wasm_byte_vec_copy for more information.
1013
+ *
1014
+ * \fn void wasm_instancetype_vec_delete(own wasm_instancetype_vec_t *out)
1015
+ * \brief Deallocates memory for a vector.
1016
+ *
1017
+ * See #wasm_byte_vec_delete for more information.
1018
+ *
1019
+ * \fn own wasm_instancetype_t* wasm_instancetype_copy(wasm_instancetype_t *)
1020
+ * \brief Creates a new value which matches the provided one.
1021
+ *
1022
+ * The caller is responsible for deleting the returned value.
1023
+ */
1024
+ WASM_DECLARE_TYPE (instancetype )
1025
+
1026
+ /**
1027
+ * \brief Returns the list of exports that this instance type provides.
1028
+ *
1029
+ * This function does not take ownership of the provided instance type but
1030
+ * ownership of `out` is passed to the caller. Note that `out` is treated as
1031
+ * uninitialized when passed to this function.
1032
+ */
1033
+ WASM_API_EXTERN void wasm_instancetype_exports (const wasm_instancetype_t * , own wasm_exporttype_vec_t * out );
1034
+
1035
+ /**
1036
+ * \brief Converts a #wasm_instancetype_t to a #wasm_externtype_t
1037
+ *
1038
+ * The returned value is owned by the #wasm_instancetype_t argument and should not
1039
+ * be deleted.
1040
+ */
1041
+ WASM_API_EXTERN wasm_externtype_t * wasm_instancetype_as_externtype (wasm_instancetype_t * );
1042
+
1043
+ /**
1044
+ * \brief Attempts to convert a #wasm_externtype_t to a #wasm_instancetype_t
1045
+ *
1046
+ * The returned value is owned by the #wasm_instancetype_t argument and should not
1047
+ * be deleted. Returns `NULL` if the provided argument is not a
1048
+ * #wasm_instancetype_t.
1049
+ */
1050
+ WASM_API_EXTERN wasm_instancetype_t * wasm_externtype_as_instancetype (wasm_externtype_t * );
1051
+
1052
+ /**
1053
+ * \brief Converts a #wasm_instancetype_t to a #wasm_externtype_t
1054
+ *
1055
+ * The returned value is owned by the #wasm_instancetype_t argument and should not
1056
+ * be deleted.
1057
+ */
1058
+ WASM_API_EXTERN const wasm_externtype_t * wasm_instancetype_as_externtype_const (const wasm_instancetype_t * );
1059
+
1060
+ /**
1061
+ * \brief Attempts to convert a #wasm_externtype_t to a #wasm_instancetype_t
1062
+ *
1063
+ * The returned value is owned by the #wasm_instancetype_t argument and should not
1064
+ * be deleted. Returns `NULL` if the provided argument is not a
1065
+ * #wasm_instancetype_t.
1066
+ */
1067
+ WASM_API_EXTERN const wasm_instancetype_t * wasm_externtype_as_instancetype_const (const wasm_externtype_t * );
1068
+
1069
+ /**
1070
+ * \struct wasm_moduletype_t
1071
+ * \brief An opaque object representing the type of a function.
1072
+ *
1073
+ * \typedef wasm_moduletype_t
1074
+ * \brief Convenience alias for #wasm_moduletype_t
1075
+ *
1076
+ * \struct wasm_moduletype_vec_t
1077
+ * \brief A list of #wasm_moduletype_t values.
1078
+ *
1079
+ * \var wasm_moduletype_vec_t::size
1080
+ * \brief Length of this vector.
1081
+ *
1082
+ * \var wasm_moduletype_vec_t::data
1083
+ * \brief Pointer to the base of this vector
1084
+ *
1085
+ * \typedef wasm_moduletype_vec_t
1086
+ * \brief Convenience alias for #wasm_moduletype_vec_t
1087
+ *
1088
+ * \fn void wasm_moduletype_delete(own wasm_moduletype_t *);
1089
+ * \brief Deletes a type.
1090
+ *
1091
+ * \fn void wasm_moduletype_vec_new_empty(own wasm_moduletype_vec_t *out);
1092
+ * \brief Creates an empty vector.
1093
+ *
1094
+ * See #wasm_byte_vec_new_empty for more information.
1095
+ *
1096
+ * \fn void wasm_moduletype_vec_new_uninitialized(own wasm_moduletype_vec_t *out, size_t);
1097
+ * \brief Creates a vector with the given capacity.
1098
+ *
1099
+ * See #wasm_byte_vec_new_uninitialized for more information.
1100
+ *
1101
+ * \fn void wasm_moduletype_vec_new(own wasm_moduletype_vec_t *out, size_t, own wasm_moduletype_t *const[]);
1102
+ * \brief Creates a vector with the provided contents.
1103
+ *
1104
+ * See #wasm_byte_vec_new for more information.
1105
+ *
1106
+ * \fn void wasm_moduletype_vec_copy(own wasm_moduletype_vec_t *out, const wasm_moduletype_vec_t *)
1107
+ * \brief Copies one vector to another
1108
+ *
1109
+ * See #wasm_byte_vec_copy for more information.
1110
+ *
1111
+ * \fn void wasm_moduletype_vec_delete(own wasm_moduletype_vec_t *out)
1112
+ * \brief Deallocates memory for a vector.
1113
+ *
1114
+ * See #wasm_byte_vec_delete for more information.
1115
+ *
1116
+ * \fn own wasm_moduletype_t* wasm_moduletype_copy(wasm_moduletype_t *)
1117
+ * \brief Creates a new value which matches the provided one.
1118
+ *
1119
+ * The caller is responsible for deleting the returned value.
1120
+ */
1121
+ WASM_DECLARE_TYPE (moduletype )
1122
+
1123
+ /**
1124
+ * \brief Returns the list of imports that this module type requires.
1125
+ *
1126
+ * This function does not take ownership of the provided module type but
1127
+ * ownership of `out` is passed to the caller. Note that `out` is treated as
1128
+ * uninitialized when passed to this function.
1129
+ */
1130
+ WASM_API_EXTERN void wasm_moduletype_imports (const wasm_moduletype_t * , own wasm_importtype_vec_t * out );
1131
+
1132
+ /**
1133
+ * \brief Returns the list of exports that this module type provides.
1134
+ *
1135
+ * This function does not take ownership of the provided module type but
1136
+ * ownership of `out` is passed to the caller. Note that `out` is treated as
1137
+ * uninitialized when passed to this function.
1138
+ */
1139
+ WASM_API_EXTERN void wasm_moduletype_exports (const wasm_moduletype_t * , own wasm_exporttype_vec_t * out );
1140
+
1141
+ /**
1142
+ * \brief Converts a #wasm_moduletype_t to a #wasm_externtype_t
1143
+ *
1144
+ * The returned value is owned by the #wasm_moduletype_t argument and should not
1145
+ * be deleted.
1146
+ */
1147
+ WASM_API_EXTERN wasm_externtype_t * wasm_moduletype_as_externtype (wasm_moduletype_t * );
1148
+
1149
+ /**
1150
+ * \brief Attempts to convert a #wasm_externtype_t to a #wasm_moduletype_t
1151
+ *
1152
+ * The returned value is owned by the #wasm_moduletype_t argument and should not
1153
+ * be deleted. Returns `NULL` if the provided argument is not a
1154
+ * #wasm_moduletype_t.
1155
+ */
1156
+ WASM_API_EXTERN wasm_moduletype_t * wasm_externtype_as_moduletype (wasm_externtype_t * );
1157
+
1158
+ /**
1159
+ * \brief Converts a #wasm_moduletype_t to a #wasm_externtype_t
1160
+ *
1161
+ * The returned value is owned by the #wasm_moduletype_t argument and should not
1162
+ * be deleted.
1163
+ */
1164
+ WASM_API_EXTERN const wasm_externtype_t * wasm_moduletype_as_externtype_const (const wasm_moduletype_t * );
1165
+
1166
+ /**
1167
+ * \brief Attempts to convert a #wasm_externtype_t to a #wasm_moduletype_t
1168
+ *
1169
+ * The returned value is owned by the #wasm_moduletype_t argument and should not
1170
+ * be deleted. Returns `NULL` if the provided argument is not a
1171
+ * #wasm_moduletype_t.
1172
+ */
1173
+ WASM_API_EXTERN const wasm_moduletype_t * wasm_externtype_as_moduletype_const (const wasm_externtype_t * );
1174
+
1175
+ /**
1176
+ * \brief Converts a #wasm_module_t to #wasm_extern_t.
1177
+ *
1178
+ * The returned #wasm_extern_t is owned by the #wasm_module_t argument. Callers
1179
+ * should not delete the returned value, and it only lives as long as the
1180
+ * #wasm_module_t argument.
1181
+ */
1182
+ WASM_API_EXTERN wasm_extern_t * wasm_module_as_extern (wasm_module_t * );
1183
+
1184
+ /**
1185
+ * \brief Converts a #wasm_extern_t to #wasm_module_t.
1186
+ *
1187
+ * The returned #wasm_module_t is owned by the #wasm_extern_t argument. Callers
1188
+ * should not delete the returned value, and it only lives as long as the
1189
+ * #wasm_extern_t argument.
1190
+ *
1191
+ * If the #wasm_extern_t argument isn't a #wasm_module_t then `NULL` is returned.
1192
+ */
1193
+ WASM_API_EXTERN wasm_module_t * wasm_extern_as_module (wasm_extern_t * );
1194
+
1195
+ /**
1196
+ * \brief Converts a #wasm_extern_t to #wasm_instance_t.
1197
+ *
1198
+ * The returned #wasm_instance_t is owned by the #wasm_extern_t argument. Callers
1199
+ * should not delete the returned value, and it only lives as long as the
1200
+ * #wasm_extern_t argument.
1201
+ */
1202
+ WASM_API_EXTERN const wasm_module_t * wasm_extern_as_module_const (const wasm_extern_t * );
1203
+
1204
+ /**
1205
+ * \brief Converts a #wasm_instance_t to #wasm_extern_t.
1206
+ *
1207
+ * The returned #wasm_extern_t is owned by the #wasm_instance_t argument. Callers
1208
+ * should not delete the returned value, and it only lives as long as the
1209
+ * #wasm_instance_t argument.
1210
+ */
1211
+ WASM_API_EXTERN wasm_extern_t * wasm_instance_as_extern (wasm_instance_t * );
1212
+
1213
+ /**
1214
+ * \brief Converts a #wasm_extern_t to #wasm_instance_t.
1215
+ *
1216
+ * The returned #wasm_instance_t is owned by the #wasm_extern_t argument. Callers
1217
+ * should not delete the returned value, and it only lives as long as the
1218
+ * #wasm_extern_t argument.
1219
+ *
1220
+ * If the #wasm_extern_t argument isn't a #wasm_instance_t then `NULL` is returned.
1221
+ */
1222
+ WASM_API_EXTERN wasm_instance_t * wasm_extern_as_instance (wasm_extern_t * );
1223
+
1224
+ /**
1225
+ * \brief Converts a #wasm_extern_t to #wasm_instance_t.
1226
+ *
1227
+ * The returned #wasm_instance_t is owned by the #wasm_extern_t argument. Callers
1228
+ * should not delete the returned value, and it only lives as long as the
1229
+ * #wasm_extern_t argument.
1230
+ */
1231
+ WASM_API_EXTERN const wasm_instance_t * wasm_extern_as_instance_const (const wasm_extern_t * );
1232
+
1233
+ /**
1234
+ * \brief Returns the type of this instance.
1235
+ *
1236
+ * The returned #wasm_instancetype_t is expected to be deallocated by the caller.
1237
+ */
1238
+ WASM_API_EXTERN own wasm_instancetype_t * wasm_instance_type (const wasm_instance_t * );
1239
+
1240
+ /**
1241
+ * \brief Returns the type of this module.
1242
+ *
1243
+ * The returned #wasm_moduletype_t is expected to be deallocated by the caller.
1244
+ */
1245
+ WASM_API_EXTERN own wasm_moduletype_t * wasm_module_type (const wasm_module_t * );
1246
+
1247
+ #define WASM_EXTERN_MODULE 4
1248
+ #define WASM_EXTERN_INSTANCE 5
1249
+
964
1250
#undef own
965
1251
966
1252
#ifdef __cplusplus
0 commit comments