signature.c 767 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (C) 2024 Midokura Japan KK. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7. #include "wasm_export.h"
  8. static int
  9. dummy(wasm_exec_env_t exec_env)
  10. {
  11. return 0;
  12. }
  13. /* clang-format off */
  14. #define REG_NATIVE_FUNC(func_name, signature) \
  15. { #func_name, dummy, signature, NULL }
  16. static NativeSymbol native_symbols[] = {
  17. REG_NATIVE_FUNC(host_consume_stack_and_call_indirect, "(iii)i"),
  18. REG_NATIVE_FUNC(host_consume_stack, "(i)i"),
  19. };
  20. /* clang-format on */
  21. uint32_t
  22. get_native_lib(char **p_module_name, NativeSymbol **p_native_symbols)
  23. {
  24. *p_module_name = "env";
  25. *p_native_symbols = native_symbols;
  26. return sizeof(native_symbols) / sizeof(NativeSymbol);
  27. }