custom_section.c 525 B

12345678910111213141516171819
  1. __attribute__((import_module("env"),
  2. import_name("get_custom_section_handle"))) int
  3. get_custom_section_handle(const char *section_name);
  4. __attribute__((import_module("env"), import_name("print_custom_section"))) void
  5. print_custom_section(int handle);
  6. __attribute__((export_name("run_demo"))) int
  7. run_demo(void)
  8. {
  9. static const char section_name[] = "demo";
  10. int handle = get_custom_section_handle(section_name);
  11. if (handle >= 0) {
  12. print_custom_section(handle);
  13. }
  14. return handle;
  15. }