summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2012-07-21 11:26:54 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2012-07-21 11:26:54 +0100
commitb4d2d633cd88308487aa6e2b689a4328ce6023c1 (patch)
tree7d20facb39d11255c43271251ee6d278028a09d9 /lib
downloadsupple-b4d2d633cd88308487aa6e2b689a4328ce6023c1.tar.gz
Initial framework for Supple
Diffstat (limited to 'lib')
-rw-r--r--lib/supple.lua23
-rw-r--r--lib/supple/capi.c35
2 files changed, 58 insertions, 0 deletions
diff --git a/lib/supple.lua b/lib/supple.lua
new file mode 100644
index 0000000..5fc405b
--- /dev/null
+++ b/lib/supple.lua
@@ -0,0 +1,23 @@
+-- lib/supple.lua
+--
+-- Sandbox (for) Untrusted Procedure Partitioning (in) Lua Engine
+--
+-- Copyright 2012 Daniel Silverstone <dsilvers@digital-scurf.org>
+--
+-- For licence terms, see COPYING
+--
+
+local capi = require 'supple.capi'
+
+local _VERSION = 1
+local _ABI = 1
+
+local VERSION = "Supple Version " .. tostring(_VERSION)
+
+return {
+ capi = capi,
+ _VERSION = _VERSION,
+ VERSION = VERSION,
+ _ABI = _ABI,
+ ABI = ABI,
+}
diff --git a/lib/supple/capi.c b/lib/supple/capi.c
new file mode 100644
index 0000000..139cfe6
--- /dev/null
+++ b/lib/supple/capi.c
@@ -0,0 +1,35 @@
+/* supple/lib/supple/capi.c
+ *
+ * Sandbox (for) Untrusted Procedure Partitioning (in) Lua Engine - Supple
+ *
+ * Useful C methods for Supple including the userdata partitioning.
+ *
+ * Copyright 2012 Daniel Silverstone <dsilvers@digital-scurf.org>
+ *
+ * For licence terms, see COPYING
+ *
+ */
+
+#include <lua.h>
+#include <lauxlib.h>
+
+/* The API exposed, increment on backward-compatible changes */
+#define CAPI_API 1
+/* The ABI exposed, increment on backward-incompatible changes */
+#define CAPI_ABI 1
+
+static const struct luaL_Reg
+supple_capi_functions[] = {
+ { NULL, NULL }
+};
+
+int
+luaopen_supple_capi(lua_State *L)
+{
+ luaL_register(L, "supple.capi", supple_capi_functions);
+ lua_pushnumber(L, CAPI_API);
+ lua_setfield(L, -2, "_API");
+ lua_pushnumber(L, CAPI_ABI);
+ lua_setfield(L, -2, "_ABI");
+ return 1;
+}