aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOscar Lim <olim@ucla.edu>2016-02-11 00:08:22 -0800
committerOscar Lim <olim@ucla.edu>2016-02-11 00:45:50 -0800
commit43d16e123da847a371f8fafb1b795ba9405127cf (patch)
tree821f7bc43778cc0a13d5424e6aaab8a8937b889a
parent7499b422e3f07bf25704cbf7989e845f89697fa8 (diff)
downloadluasystem-43d16e123da847a371f8fafb1b795ba9405127cf.tar.gz
luasystem-43d16e123da847a371f8fafb1b795ba9405127cf.tar.bz2
luasystem-43d16e123da847a371f8fafb1b795ba9405127cf.zip
Release v0.1.0v0.1.0
-rw-r--r--luasystem-0.1.0-0.rockspec47
-rw-r--r--src/core.c5
2 files changed, 52 insertions, 0 deletions
diff --git a/luasystem-0.1.0-0.rockspec b/luasystem-0.1.0-0.rockspec
new file mode 100644
index 0000000..a1a322f
--- /dev/null
+++ b/luasystem-0.1.0-0.rockspec
@@ -0,0 +1,47 @@
1package = 'luasystem'
2version = '0.1.0-0'
3source = {
4 url = "https://github.com/o-lim/luasystem/archive/v0.1.0.tar.gz",
5 dir = "luasystem-0.1.0"
6}
7description = {
8 summary = 'Platform independent system calls for Lua.',
9 detailed = [[
10 Adds a Lua API for making platform independent system calls.
11 ]],
12 homepage = 'http://olivinelabs.com/luasystem/',
13 license = 'MIT <http://opensource.org/licenses/MIT>'
14}
15dependencies = {
16 'lua >= 5.1',
17}
18
19local function make_platform(plat)
20 local defines = {
21 unix = { },
22 macosx = { },
23 win32 = { },
24 mingw32 = { "WINVER=0x0501" },
25 }
26 return {
27 modules = {
28 ['system.core'] = {
29 sources = { 'src/core.c', 'src/compat.c', 'src/time.c', },
30 defines = defines[plat],
31 },
32 },
33 }
34end
35
36build = {
37 type = 'builtin',
38 platforms = {
39 unix = make_platform('unix'),
40 macosx = make_platform('macosx'),
41 win32 = make_platform('win32'),
42 mingw32 = make_platform('mingw32'),
43 },
44 modules = {
45 ['system.init'] = 'system/init.lua',
46 },
47}
diff --git a/src/core.c b/src/core.c
index d2acb95..31e768b 100644
--- a/src/core.c
+++ b/src/core.c
@@ -1,6 +1,8 @@
1#include <lua.h> 1#include <lua.h>
2#include <lauxlib.h> 2#include <lauxlib.h>
3 3
4#define LUASYSTEM_VERSION "LuaSystem 0.1.0"
5
4#ifdef _WIN32 6#ifdef _WIN32
5#define LUAEXPORT __declspec(dllexport) 7#define LUAEXPORT __declspec(dllexport)
6#else 8#else
@@ -14,6 +16,9 @@ void time_open(lua_State *L);
14 *-------------------------------------------------------------------------*/ 16 *-------------------------------------------------------------------------*/
15LUAEXPORT int luaopen_system_core(lua_State *L) { 17LUAEXPORT int luaopen_system_core(lua_State *L) {
16 lua_newtable(L); 18 lua_newtable(L);
19 lua_pushstring(L, "_VERSION");
20 lua_pushstring(L, LUASYSTEM_VERSION);
21 lua_rawset(L, -3);
17 time_open(L); 22 time_open(L);
18 return 1; 23 return 1;
19} 24}