aboutsummaryrefslogtreecommitdiff
path: root/src/core.c
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2023-11-15 19:28:06 +0100
committerGitHub <noreply@github.com>2023-11-15 19:28:06 +0100
commit90997893cc568c86805afa95db28439c28e32980 (patch)
tree4a692fcc91a811e18023ba1896aeee23fe2ee2c5 /src/core.c
parentf868c16514be69b20a4e771cc347a80c9c439db6 (diff)
parent048f3cec7a18e7a28146f03c3c9e5d89d9613028 (diff)
downloadluasystem-90997893cc568c86805afa95db28439c28e32980.tar.gz
luasystem-90997893cc568c86805afa95db28439c28e32980.tar.bz2
luasystem-90997893cc568c86805afa95db28439c28e32980.zip
Merge pull request #6 from lunarmodules/time
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}