lua_builtin.h

Definitions for including built-in modules.

The modules must be placed in the tables lua_riot_builtin_lua_table (for lua source code) and lua_riot_builtin_c_table (for C extensions) and the lengths of these tables must be in lua_riot_builtin_lua_table_len and lua_riot_builtin_c_table_len.

These symbols are defined as weak, so there if they are not defined elsewhere they will default to zero (or NULL), that is, empty tables.

WEAK

Attribute to make symbols weak.

1
__attribute__((weak))

This should be made part of RIOT.

LUAR_MAX_MODULE_NAME

Only the first LUAR_MAX_MODULE_NAME characters of a module name will be considered when performing a lookup.

1
64
lua_builtin.h::WEAK const struct lua_riot_builtin_lua *const lua_riot_builtin_lua_table

Table containing all built in pure lua modules.

lua_builtin.h::WEAK const msp430_types.h::size_t lua_riot_builtin_lua_table_len

Number of elements of lua_riot_builtin_lua_table.

lua_builtin.h::WEAK const struct lua_riot_builtin_c *const lua_riot_builtin_c_table

Table containing all built in c lua modules.

lua_builtin.h::WEAK const msp430_types.h::size_t lua_riot_builtin_c_table_len

Number of elements of lua_riot_builtin_c_table.

struct lua_riot_builtin_lua

Entry describing a pure lua module whose source is built into the application binary.

const char * name

Name of the module

const uint8_t * code

Lua source code buffer

msp430_types.h::size_t code_size

Size of the source code buffer.

struct lua_riot_builtin_c

Entry describing a c lua module built into the application binary.

const char * name

Name of the module

int(* luaopen()

Loader function. It must place the module table at the top of the lua stack.

Add better docs.