base-lib-export.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #include <stdio.h>
  17. #include <stdlib.h>
  18. #include <string.h>
  19. #include "lib-export.h"
  20. #ifdef WASM_ENABLE_BASE_LIB
  21. #include "base-lib-export.h"
  22. #endif
  23. static NativeSymbol extended_native_symbol_defs[] = {
  24. /* TODO: use macro EXPORT_WASM_API() or EXPORT_WASM_API2() to
  25. add functions to register. */
  26. #ifdef WASM_ENABLE_BASE_LIB
  27. EXPORT_WASM_API(wasm_register_resource),
  28. EXPORT_WASM_API(wasm_response_send),
  29. EXPORT_WASM_API(wasm_post_request),
  30. EXPORT_WASM_API(wasm_sub_event),
  31. EXPORT_WASM_API(wasm_create_timer),
  32. EXPORT_WASM_API(wasm_timer_destory),
  33. EXPORT_WASM_API(wasm_timer_cancel),
  34. EXPORT_WASM_API(wasm_timer_restart),
  35. EXPORT_WASM_API(wasm_get_sys_tick_ms),
  36. #endif
  37. };
  38. int get_base_lib_export_apis(NativeSymbol **p_base_lib_apis)
  39. {
  40. *p_base_lib_apis = extended_native_symbol_defs;
  41. return sizeof(extended_native_symbol_defs) / sizeof(NativeSymbol);
  42. }