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. --- im/src/lua5/imlua_jp2.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 im/src/lua5/imlua_jp2.c (limited to 'im/src/lua5/imlua_jp2.c') diff --git a/im/src/lua5/imlua_jp2.c b/im/src/lua5/imlua_jp2.c new file mode 100755 index 0000000..d69ba7e --- /dev/null +++ b/im/src/lua5/imlua_jp2.c @@ -0,0 +1,44 @@ +/** \file + * \brief jp2 format Lua 5 Binding + * + * See Copyright Notice in cd.h + */ + +#include +#include + +#include "im_format_jp2.h" + +#include +#include + + +static int imlua_FormatRegisterJP2(lua_State *L) +{ + (void)L; + imFormatRegisterJP2(); + return 0; +} + +static const struct luaL_reg imlib[] = { + {"FormatRegisterJP2", imlua_FormatRegisterJP2}, + {NULL, NULL}, +}; + + +static int imlua_jp2_open (lua_State *L) +{ + imFormatRegisterJP2(); + luaL_register(L, "im", imlib); /* leave "im" table at the top of the stack */ + return 1; +} + +int luaopen_imlua_jp2(lua_State* L) +{ + return imlua_jp2_open(L); +} + +int luaopen_imlua_jp251(lua_State* L) +{ + return imlua_jp2_open(L); +} -- cgit v1.2.3