|
whiskers 0.4.0
RP2350 BadUSB Tool
|
Basic functions to setup the lua functionality.
These functions only initialize and start lua as a whole on the device. All functionality that is built in is within wlua.c, wlua_fops.c, and wlua_usb.c.
To find the list of all the exposed lua functions see lua_functions.h
#include "../../hal/file.h"#include "../../hal/standard.h"#include "../../lua/lua.h"#include "../../lua/lualib.h"#include "../../lua/lauxlib.h"#include "wlua_fops.h"#include "wlua_usb.h"#include "../usb/wusb.h"#include <string.h>#include <stdio.h>Go to the source code of this file.
Macros | |
| #define | WLUA_MAX_LINESIZE 1024 |
| Max line length to parse from a file into the lua interpreter. | |
Functions | |
| void | start_lua (lua_State **lua) |
| Sets up the initial lua state and registers all the exposed functions for user use in lua code. | |
| bool | run_lua_from_file (const char *path, lua_State *lua) |
| Runs lua from a file. | |
| void | stop_lua (lua_State *lua) |
| Stops the lua interpreter and frees it's resources. | |
| bool run_lua_from_file | ( | const char * | path, |
| lua_State * | lua ) |
Runs lua from a file.
| *path | Path to file. |
| *lua | lua_State that has been initialized by start_lua(); |
| void start_lua | ( | lua_State ** | lua | ) |
Sets up the initial lua state and registers all the exposed functions for user use in lua code.
| **lua | Pointer to an empty lua_State struct pointer. This function initializes this and this must be kept and re-used in all the functions. |
| void stop_lua | ( | lua_State * | lua | ) |
Stops the lua interpreter and frees it's resources.
| *lua | Active lua instance to be stopped and freed. |