summaryrefslogtreecommitdiff
path: root/src/interp/binary-reader-metadata.h
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2020-01-16 14:53:11 -0800
committerGitHub <noreply@github.com>2020-01-16 14:53:11 -0800
commit7c80d05e37dc02870c680869ae3f04ac6d9637ee (patch)
tree57645c67379d4e6ec49773b3494dc752ffcb5e68 /src/interp/binary-reader-metadata.h
parentd663c80dcb627fed3e21cfa2b47465452a83a894 (diff)
downloadwabt-7c80d05e37dc02870c680869ae3f04ac6d9637ee.tar.gz
wabt-7c80d05e37dc02870c680869ae3f04ac6d9637ee.tar.bz2
wabt-7c80d05e37dc02870c680869ae3f04ac6d9637ee.zip
Initial WASM C API implementation. (#1250)
All tests except `threads` pass.
Diffstat (limited to 'src/interp/binary-reader-metadata.h')
-rw-r--r--src/interp/binary-reader-metadata.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/interp/binary-reader-metadata.h b/src/interp/binary-reader-metadata.h
new file mode 100644
index 00000000..13834560
--- /dev/null
+++ b/src/interp/binary-reader-metadata.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2020 WebAssembly Community Group participants
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WABT_BINARY_READER_METADATA_H_
+#define WABT_BINARY_READER_METADATA_H_
+
+#include "src/common.h"
+#include "src/error.h"
+
+namespace wabt {
+
+namespace interp {
+
+struct ModuleMetadata;
+
+} // namespace interp
+
+struct ReadBinaryOptions;
+
+// Reads just the binary metadata, used by C-API to get module imports names
+// (and potentially other metadata) before instantiation time.
+Result ReadBinaryMetadata(const void* data,
+ size_t size,
+ const ReadBinaryOptions& options,
+ Errors*,
+ interp::ModuleMetadata** out_metadata);
+
+} // namespace wabt
+
+#endif /* WABT_BINARY_READER_METADATA_H_ */