[FL-3579, FL-3601, FL-3714] JavaScript runner (#3286)
* FBT: cdefines to env, libs order
* API: strtod, modf, itoa, calloc
* Apps: elk js
* Apps: mjs
* JS: scripts as assets
* mjs: composite resolver
* mjs: stack trace
* ELK JS example removed
* MJS thread, MJS lib modified to support script interruption
* JS console UI
* Module system, BadUSB bindings rework
* JS notifications, simple dialog, BadUSB demo
* Custom dialogs, dialog demo
* MJS as system library, some dirty hacks to make it compile
* Plugin-based js modules
* js_uart(BadUART) module
* js_uart: support for byte array arguments
* Script icon and various fixes
* File browser: multiple extensions filter, running js scripts from app loader
* Running js scripts from archive browser
* JS Runner as system app
* Example scripts moved to /ext/apps/Scripts
* JS bytecode listing generation
* MJS builtin printf cleanup
* JS examples cleanup
* mbedtls version fix
* Unused lib cleanup
* Making PVS happy & TODOs cleanup
* TODOs cleanup #2
* MJS: initial typed arrays support
* JS: fix mem leak in uart destructor
Co-authored-by: SG <who.just.the.doctor@gmail.com>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2024-02-12 11:54:32 +03:00
|
|
|
#include <flipper_application/api_hashtable/api_hashtable.h>
|
|
|
|
#include <flipper_application/api_hashtable/compilesort.hpp>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file contains an implementation of a symbol table
|
|
|
|
* with private app's symbols. It is used by composite API resolver
|
|
|
|
* to load plugins that use internal application's APIs.
|
|
|
|
*/
|
|
|
|
#include "app_api_table_i.h"
|
|
|
|
|
|
|
|
static_assert(!has_hash_collisions(app_api_table), "Detected API method hash collision!");
|
|
|
|
|
|
|
|
constexpr HashtableApiInterface applicaton_hashtable_api_interface{
|
|
|
|
{
|
|
|
|
.api_version_major = 0,
|
|
|
|
.api_version_minor = 0,
|
|
|
|
/* generic resolver using pre-sorted array */
|
|
|
|
.resolver_callback = &elf_resolve_from_hashtable,
|
|
|
|
},
|
|
|
|
/* pointers to application's API table boundaries */
|
2024-02-26 15:16:19 +03:00
|
|
|
app_api_table.cbegin(),
|
|
|
|
app_api_table.cend(),
|
[FL-3579, FL-3601, FL-3714] JavaScript runner (#3286)
* FBT: cdefines to env, libs order
* API: strtod, modf, itoa, calloc
* Apps: elk js
* Apps: mjs
* JS: scripts as assets
* mjs: composite resolver
* mjs: stack trace
* ELK JS example removed
* MJS thread, MJS lib modified to support script interruption
* JS console UI
* Module system, BadUSB bindings rework
* JS notifications, simple dialog, BadUSB demo
* Custom dialogs, dialog demo
* MJS as system library, some dirty hacks to make it compile
* Plugin-based js modules
* js_uart(BadUART) module
* js_uart: support for byte array arguments
* Script icon and various fixes
* File browser: multiple extensions filter, running js scripts from app loader
* Running js scripts from archive browser
* JS Runner as system app
* Example scripts moved to /ext/apps/Scripts
* JS bytecode listing generation
* MJS builtin printf cleanup
* JS examples cleanup
* mbedtls version fix
* Unused lib cleanup
* Making PVS happy & TODOs cleanup
* TODOs cleanup #2
* MJS: initial typed arrays support
* JS: fix mem leak in uart destructor
Co-authored-by: SG <who.just.the.doctor@gmail.com>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2024-02-12 11:54:32 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Casting to generic resolver to use in Composite API resolver */
|
|
|
|
extern "C" const ElfApiInterface* const application_api_interface =
|
|
|
|
&applicaton_hashtable_api_interface;
|