metroflip_api_table.cpp 1007 B

123456789101112131415161718192021222324252627
  1. #include <flipper_application/api_hashtable/api_hashtable.h>
  2. #include <flipper_application/api_hashtable/compilesort.hpp>
  3. /*
  4. * This file contains an implementation of a symbol table
  5. * with private app's symbols. It is used by composite API resolver
  6. * to load plugins that use internal application's APIs.
  7. */
  8. #include "metroflip_api_table_i.h"
  9. static_assert(!has_hash_collisions(metroflip_api_table), "Detected API method hash collision!");
  10. constexpr HashtableApiInterface applicaton_hashtable_api_interface{
  11. {
  12. .api_version_major = 0,
  13. .api_version_minor = 0,
  14. /* generic resolver using pre-sorted array */
  15. .resolver_callback = &elf_resolve_from_hashtable,
  16. },
  17. /* pointers to application's API table boundaries */
  18. metroflip_api_table.cbegin(),
  19. metroflip_api_table.cend(),
  20. };
  21. /* Casting to generic resolver to use in Composite API resolver */
  22. extern "C" const ElfApiInterface* const metroflip_api_interface =
  23. &applicaton_hashtable_api_interface;