summaryrefslogtreecommitdiff
path: root/iup/srclua5/iuplua_cd.c
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2009-11-04 11:56:41 -0800
committerPixel <pixel@nobis-crew.org>2009-11-04 11:59:33 -0800
commitd577d991b97ae2b5ee1af23641bcffc3f83af5b2 (patch)
tree590639d50205d1bcfaff2a7d2dc6ebf3f373c7ed /iup/srclua5/iuplua_cd.c
Initial import. Contains the im, cd and iup librairies, and a "working" Makefile for them under linux.
Diffstat (limited to 'iup/srclua5/iuplua_cd.c')
-rwxr-xr-xiup/srclua5/iuplua_cd.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/iup/srclua5/iuplua_cd.c b/iup/srclua5/iuplua_cd.c
new file mode 100755
index 0000000..c14932a
--- /dev/null
+++ b/iup/srclua5/iuplua_cd.c
@@ -0,0 +1,56 @@
+/** \file
+ * \brief IUP Canvas Lua 5 Binding
+ *
+ * See Copyright Notice in cd.h
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include <cd.h>
+#include <cdiup.h>
+
+#include <lua.h>
+#include <lauxlib.h>
+
+#include "iup.h"
+#include "iuplua.h"
+
+#include <cdlua.h>
+#include <cdluaiup.h>
+#include <cdlua5_private.h>
+
+
+static void *cdiup_checkdata(lua_State *L, int param)
+{
+ return iuplua_checkihandle(L, param);
+}
+
+static cdluaContext cdluaiupctx =
+{
+ 0,
+ "IUP",
+ cdContextIup,
+ cdiup_checkdata,
+ NULL,
+ 0
+};
+
+int cdluaiup_open (lua_State *L)
+{
+ cdluaLuaState* cdL = cdlua_getstate(L);
+ lua_pushstring(L, "cd");
+ lua_gettable(L, LUA_GLOBALSINDEX); /* leave "cd" table at the top of the stack */
+ cdlua_addcontext(L, cdL, &cdluaiupctx);
+ return 1;
+}
+
+int luaopen_iupluacd(lua_State* L)
+{
+ return cdluaiup_open(L);
+}
+
+int luaopen_iupluacd51(lua_State* L)
+{
+ return cdluaiup_open(L);
+}