diff options
author | scuri <scuri> | 2008-10-17 06:10:33 +0000 |
---|---|---|
committer | scuri <scuri> | 2008-10-17 06:10:33 +0000 |
commit | 7b52cc13af4e85f1ca2deb6b6c77de9c95ea0dcf (patch) | |
tree | d0857278bde2eff784227c57dcaf930346ceb7ac /src/lua5/cdluacontextplus5.c |
First commit - moving from LuaForge to SourceForge
Diffstat (limited to 'src/lua5/cdluacontextplus5.c')
-rw-r--r-- | src/lua5/cdluacontextplus5.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/lua5/cdluacontextplus5.c b/src/lua5/cdluacontextplus5.c new file mode 100644 index 0000000..de69167 --- /dev/null +++ b/src/lua5/cdluacontextplus5.c @@ -0,0 +1,44 @@ +/** \file + * \brief Context Plus Lua 5 Binding + * + * See Copyright Notice in cd.h + */ + +#include <stdlib.h> +#include <stdio.h> + +#include "cd.h" + +#include <lua.h> +#include <lauxlib.h> + + +static int cdlua5_initcontextplus(lua_State *L) +{ + (void)L; + cdInitContextPlus(); + return 0; +} + +static const struct luaL_reg cdlib[] = { + {"InitContextPlus", cdlua5_initcontextplus}, + {NULL, NULL}, +}; + + +static int cdluacontextplus_open (lua_State *L) +{ + cdInitContextPlus(); + luaL_register(L, "cd", cdlib); /* leave "cd" table at the top of the stack */ + return 1; +} + +int luaopen_cdluacontextplus(lua_State* L) +{ + return cdluacontextplus_open(L); +} + +int luaopen_cdluacontextplus51(lua_State* L) +{ + return cdluacontextplus_open(L); +} |