From d577d991b97ae2b5ee1af23641bcffc3f83af5b2 Mon Sep 17 00:00:00 2001 From: Pixel Date: Wed, 4 Nov 2009 11:56:41 -0800 Subject: Initial import. Contains the im, cd and iup librairies, and a "working" Makefile for them under linux. --- iup/srclua3/iuplua_im.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 iup/srclua3/iuplua_im.c (limited to 'iup/srclua3/iuplua_im.c') diff --git a/iup/srclua3/iuplua_im.c b/iup/srclua3/iuplua_im.c new file mode 100755 index 0000000..2104e0d --- /dev/null +++ b/iup/srclua3/iuplua_im.c @@ -0,0 +1,39 @@ +/** \file + * \brief IULUA core - Bindig of iup to Lua 3. + * + * See Copyright Notice in "iup.h" + */ + +#include +#include +#include + +#include "iup.h" +#include "iupim.h" + +#include +#include + +#include "iuplua.h" +#include "iupluaim.h" +#include "il.h" + +static void SaveImage(void) +{ + Ihandle* image = iuplua_checkihandle(1); + char *filename = luaL_check_string(2); + char *format = luaL_check_string(3); + lua_pushnumber(IupSaveImage(image, filename, format)); +} + +static void LoadImage(void) +{ + char *filename = luaL_check_string(1); + iuplua_pushihandle(IupLoadImage(filename)); +} + +void iupimlua_open(void) +{ + iuplua_register("IupLoadImage", LoadImage); + iuplua_register("IupSaveImage", SaveImage); +} -- cgit v1.2.3