lua_builtin.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Freie Universität Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
25 #ifndef LUA_BUILTIN_H
26 #define LUA_BUILTIN_H
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 /* Avoid compilation errors where there are no external modules defined */
38 #define WEAK __attribute__((weak))
39 
44 #define LUAR_MAX_MODULE_NAME 64
45 
51  const char *name;
52  const uint8_t *code;
53  size_t code_size;
54 };
55 
61  const char *name;
62  int (*luaopen)(lua_State *);
66 };
67 
69 extern WEAK const struct lua_riot_builtin_lua *const lua_riot_builtin_lua_table;
71 extern WEAK const size_t lua_riot_builtin_lua_table_len;
72 
74 extern WEAK const struct lua_riot_builtin_c *const lua_riot_builtin_c_table;
76 extern WEAK const size_t lua_riot_builtin_c_table_len;
77 
78 #ifdef __cplusplus
79 extern "C" }
80 #endif
81 
82 #endif /* LUA_BUILTIN_H */
83 
lua_riot_builtin_lua_table
WEAK const struct lua_riot_builtin_lua *const lua_riot_builtin_lua_table
Table containing all built in pure lua modules.
lua_riot_builtin_c::name
const char * name
Definition: lua_builtin.h:61
lua_riot_builtin_lua::code_size
size_t code_size
Definition: lua_builtin.h:53
lua_riot_builtin_lua::name
const char * name
Definition: lua_builtin.h:51
WEAK
#define WEAK
Attribute to make symbols weak.
Definition: lua_builtin.h:38
lua_riot_builtin_c
Entry describing a c lua module built into the application binary.
Definition: lua_builtin.h:60
lua_riot_builtin_lua::code
const uint8_t * code
Definition: lua_builtin.h:52
lua_riot_builtin_lua_table_len
const WEAK size_t lua_riot_builtin_lua_table_len
Number of elements of lua_riot_builtin_lua_table.
lua_riot_builtin_c_table_len
const WEAK size_t lua_riot_builtin_c_table_len
Number of elements of lua_riot_builtin_c_table.
lua_riot_builtin_c_table
WEAK const struct lua_riot_builtin_c *const lua_riot_builtin_c_table
Table containing all built in c lua modules.
lua_riot_builtin_lua
Entry describing a pure lua module whose source is built into the application binary.
Definition: lua_builtin.h:50
lua_riot_builtin_c::luaopen
int(* luaopen)(lua_State *)
Definition: lua_builtin.h:62