diff options
author | Thijs Schreijer <thijs@thijsschreijer.nl> | 2023-11-15 19:28:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-15 19:28:06 +0100 |
commit | 90997893cc568c86805afa95db28439c28e32980 (patch) | |
tree | 4a692fcc91a811e18023ba1896aeee23fe2ee2c5 /src/core.c | |
parent | f868c16514be69b20a4e771cc347a80c9c439db6 (diff) | |
parent | 048f3cec7a18e7a28146f03c3c9e5d89d9613028 (diff) | |
download | luasystem-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.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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 | ||
12 | void time_open(lua_State *L); | 15 | void time_open(lua_State *L); |
16 | void environment_open(lua_State *L); | ||
17 | void random_open(lua_State *L); | ||
18 | void 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 | } |