aboutsummaryrefslogtreecommitdiff
path: root/src/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core.c b/src/core.c
index 6c46981..87fd105 100644
--- a/src/core.c
+++ b/src/core.c
@@ -1,3 +1,6 @@
1/// Platform independent system calls for Lua.
2// @module system
3
1#include <lua.h> 4#include <lua.h>
2#include <lauxlib.h> 5#include <lauxlib.h>
3 6
@@ -10,6 +13,9 @@
10#endif 13#endif
11 14
12void time_open(lua_State *L); 15void time_open(lua_State *L);
16void environment_open(lua_State *L);
17void random_open(lua_State *L);
18void term_open(lua_State *L);
13 19
14/*------------------------------------------------------------------------- 20/*-------------------------------------------------------------------------
15 * Initializes all library modules. 21 * Initializes all library modules.
@@ -19,6 +25,16 @@ LUAEXPORT int luaopen_system_core(lua_State *L) {
19 lua_pushstring(L, "_VERSION"); 25 lua_pushstring(L, "_VERSION");
20 lua_pushstring(L, LUASYSTEM_VERSION); 26 lua_pushstring(L, LUASYSTEM_VERSION);
21 lua_rawset(L, -3); 27 lua_rawset(L, -3);
28 lua_pushstring(L, "windows");
29#ifdef _WIN32
30 lua_pushboolean(L, 1);
31#else
32 lua_pushboolean(L, 0);
33#endif
34 lua_rawset(L, -3);
22 time_open(L); 35 time_open(L);
36 random_open(L);
37 term_open(L);
38 environment_open(L);
23 return 1; 39 return 1;
24} 40}