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 
WEAK const struct lua_riot_builtin_lua *const lua_riot_builtin_lua_table
Table containing all built in pure lua modules.
WEAK const size_t lua_riot_builtin_lua_table_len
Number of elements of lua_riot_builtin_lua_table.
const uint8_t * code
Definition: lua_builtin.h:52
const char * name
Definition: lua_builtin.h:61
WEAK const size_t lua_riot_builtin_c_table_len
Number of elements of lua_riot_builtin_c_table.
Entry describing a pure lua module whose source is built into the application binary.
Definition: lua_builtin.h:50
const char * name
Definition: lua_builtin.h:51
WEAK const struct lua_riot_builtin_c *const lua_riot_builtin_c_table
Table containing all built in c lua modules.
Entry describing a c lua module built into the application binary.
Definition: lua_builtin.h:60
#define WEAK
Attribute to make symbols weak.
Definition: lua_builtin.h:38