mweber1488 avatar mweber1488 committed 7cea6cb

Initial repository setup

Comments (0)

Files changed (5)

+dmd -H -c derelict\lua\lua derelict\lua\luafuncs derelict\lua\luatypes derelict\lua\luad -I..\import
+copy /Y lua.di ..\import\derelict\lua\
+copy /Y luatypes.di ..\import\derelict\lua
+copy /Y luafuncs.di ..\import\derelict\lua
+copy /Y luad.di ..\import\derelict\lua
+del /Q obj lua.di luatypes.di luafuncs.di luad.di lua.obj luatypes.obj luafuncs.obj luad.obj

derelict/lua/lua.d

+/*
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+*/
+
+module derelict.lua.lua;
+
+public
+{
+    import derelict.lua.luatypes;
+    import derelict.lua.luafuncs;
+}
+
+private
+{
+    import derelict.util.sharedlib;
+    import derelict.util.loader;
+}
+
+class DerelictLuaLoader : SharedLibLoader
+{
+public:
+    this()
+    {
+        super(
+            "lua52.dll",
+            "",
+            ""
+        );
+    }
+
+protected:
+    override void loadSymbols()
+    {
+    	// lua.h
+        bindFunc(cast(void**)&lua_newstate, "lua_newstate");
+        bindFunc(cast(void**)&lua_close, "lua_close");
+        bindFunc(cast(void**)&lua_newthread, "lua_newthread");
+        bindFunc(cast(void**)&lua_atpanic, "lua_atpanic");
+        bindFunc(cast(void**)&lua_version, "lua_version");
+        bindFunc(cast(void**)&lua_absindex, "lua_absindex");
+        bindFunc(cast(void**)&lua_gettop, "lua_gettop");
+        bindFunc(cast(void**)&lua_settop, "lua_settop");
+        bindFunc(cast(void**)&lua_pushvalue, "lua_pushvalue");
+        bindFunc(cast(void**)&lua_remove, "lua_remove");
+        bindFunc(cast(void**)&lua_insert, "lua_insert");
+        bindFunc(cast(void**)&lua_replace, "lua_replace");
+        bindFunc(cast(void**)&lua_copy, "lua_copy");
+        bindFunc(cast(void**)&lua_checkstack, "lua_checkstack");
+        bindFunc(cast(void**)&lua_xmove, "lua_xmove");
+        bindFunc(cast(void**)&lua_isnumber, "lua_isnumber");
+        bindFunc(cast(void**)&lua_isstring, "lua_isstring");
+        bindFunc(cast(void**)&lua_iscfunction, "lua_iscfunction");
+        bindFunc(cast(void**)&lua_isuserdata, "lua_isuserdata");
+        bindFunc(cast(void**)&lua_type, "lua_type");
+        bindFunc(cast(void**)&lua_typename, "lua_typename");
+        bindFunc(cast(void**)&lua_tonumberx, "lua_tonumberx");
+        bindFunc(cast(void**)&lua_tointegerx, "lua_tointegerx");
+        bindFunc(cast(void**)&lua_tounsignedx, "lua_tounsignedx");
+        bindFunc(cast(void**)&lua_toboolean, "lua_toboolean");
+        bindFunc(cast(void**)&lua_tolstring, "lua_tolstring");
+        bindFunc(cast(void**)&lua_rawlen, "lua_rawlen");
+        bindFunc(cast(void**)&lua_tocfunction, "lua_tocfunction");
+        bindFunc(cast(void**)&lua_touserdata, "lua_touserdata");
+        bindFunc(cast(void**)&lua_tothread, "lua_tothread");
+        bindFunc(cast(void**)&lua_topointer, "lua_topointer");
+        bindFunc(cast(void**)&lua_arith, "lua_arith");
+        bindFunc(cast(void**)&lua_rawequal, "lua_rawequal");
+        bindFunc(cast(void**)&lua_compare, "lua_compare");
+        bindFunc(cast(void**)&lua_pushnil, "lua_pushnil");
+        bindFunc(cast(void**)&lua_pushnumber, "lua_pushnumber");
+        bindFunc(cast(void**)&lua_pushinteger, "lua_pushinteger");
+        bindFunc(cast(void**)&lua_pushunsigned, "lua_pushunsigned");
+        bindFunc(cast(void**)&lua_pushlstring, "lua_pushlstring");
+        bindFunc(cast(void**)&lua_pushstring, "lua_pushstring");
+        bindFunc(cast(void**)&lua_pushvfstring, "lua_pushvfstring");
+        bindFunc(cast(void**)&lua_pushfstring, "lua_pushfstring");
+        bindFunc(cast(void**)&lua_pushcclosure, "lua_pushcclosure");
+        bindFunc(cast(void**)&lua_pushboolean, "lua_pushboolean");
+        bindFunc(cast(void**)&lua_pushlightuserdata, "lua_pushlightuserdata");
+        bindFunc(cast(void**)&lua_pushthread, "lua_pushthread");
+        bindFunc(cast(void**)&lua_getglobal, "lua_getglobal");
+        bindFunc(cast(void**)&lua_gettable, "lua_gettable");
+        bindFunc(cast(void**)&lua_getfield, "lua_getfield");
+        bindFunc(cast(void**)&lua_rawget, "lua_rawget");
+        bindFunc(cast(void**)&lua_rawgeti, "lua_rawgeti");
+        bindFunc(cast(void**)&lua_rawgetp, "lua_rawgetp");
+        bindFunc(cast(void**)&lua_createtable, "lua_createtable");
+        bindFunc(cast(void**)&lua_newuserdata, "lua_newuserdata");
+        bindFunc(cast(void**)&lua_getmetatable, "lua_getmetatable");
+        bindFunc(cast(void**)&lua_getuservalue, "lua_getuservalue");
+        bindFunc(cast(void**)&lua_setglobal, "lua_setglobal");
+        bindFunc(cast(void**)&lua_settable, "lua_settable");
+        bindFunc(cast(void**)&lua_setfield, "lua_setfield");
+        bindFunc(cast(void**)&lua_rawset, "lua_rawset");
+        bindFunc(cast(void**)&lua_rawseti, "lua_rawseti");
+        bindFunc(cast(void**)&lua_rawsetp, "lua_rawsetp");
+        bindFunc(cast(void**)&lua_setmetatable, "lua_setmetatable");
+        //bindFunc(cast(void**)&lua_setuserdata, "lua_setuserdata");
+        bindFunc(cast(void**)&lua_callk, "lua_callk");
+        bindFunc(cast(void**)&lua_getctx, "lua_getctx");
+        bindFunc(cast(void**)&lua_pcallk, "lua_pcallk");
+        bindFunc(cast(void**)&lua_load, "lua_load");
+        bindFunc(cast(void**)&lua_dump, "lua_dump");
+        bindFunc(cast(void**)&lua_yieldk, "lua_yieldk");
+        bindFunc(cast(void**)&lua_resume, "lua_resume");
+        bindFunc(cast(void**)&lua_status, "lua_status");
+        bindFunc(cast(void**)&lua_gc, "lua_gc");
+        bindFunc(cast(void**)&lua_error, "lua_error");
+        bindFunc(cast(void**)&lua_next, "lua_next");
+        bindFunc(cast(void**)&lua_concat, "lua_concat");
+        bindFunc(cast(void**)&lua_len, "lua_len");
+        bindFunc(cast(void**)&lua_getallocf, "lua_getallocf");
+        bindFunc(cast(void**)&lua_setallocf, "lua_setallocf");
+        // luaxlib.h
+       bindFunc(cast(void**)&luaL_checkversion_, "luaL_checkversion_");
+       bindFunc(cast(void**)&luaL_getmetafield, "luaL_getmetafield");
+       bindFunc(cast(void**)&luaL_callmeta, "luaL_callmeta");
+       bindFunc(cast(void**)&luaL_tolstring, "luaL_tolstring");
+       bindFunc(cast(void**)&luaL_argerror, "luaL_argerror");
+       bindFunc(cast(void**)&luaL_checklstring, "luaL_checklstring");
+       bindFunc(cast(void**)&luaL_optlstring, "luaL_optlstring");
+       bindFunc(cast(void**)&luaL_checknumber, "luaL_checknumber");
+       bindFunc(cast(void**)&luaL_optnumber, "luaL_optnumber");
+	   bindFunc(cast(void**)&luaL_checkinteger, "luaL_checkinteger");
+       bindFunc(cast(void**)&luaL_optinteger, "luaL_optinteger");
+       //bindFunc(cast(void**)&luaL_checkunsigned, "lauL_checkunsigned");
+       bindFunc(cast(void**)&luaL_optunsigned, "luaL_optunsigned");
+       bindFunc(cast(void**)&luaL_checkstack, "luaL_checkstack");
+       bindFunc(cast(void**)&luaL_checktype, "luaL_checktype");
+       bindFunc(cast(void**)&luaL_checkany, "luaL_checkany");
+       bindFunc(cast(void**)&luaL_newmetatable, "luaL_newmetatable");
+       bindFunc(cast(void**)&luaL_setmetatable, "luaL_setmetatable");
+       bindFunc(cast(void**)&luaL_testudata, "luaL_testudata");
+       bindFunc(cast(void**)&luaL_checkudata, "luaL_checkudata");
+       bindFunc(cast(void**)&luaL_where, "luaL_where");
+       bindFunc(cast(void**)&luaL_error, "luaL_error");
+       bindFunc(cast(void**)&luaL_checkoption, "luaL_checkoption");
+       bindFunc(cast(void**)&luaL_fileresult, "luaL_fileresult");
+       bindFunc(cast(void**)&luaL_execresult, "luaL_execresult");
+       bindFunc(cast(void**)&luaL_ref, "luaL_ref");
+       bindFunc(cast(void**)&luaL_unref, "luaL_unref");
+       bindFunc(cast(void**)&luaL_loadfilex, "luaL_loadfilex");
+       bindFunc(cast(void**)&luaL_loadbufferx, "luaL_loadbufferx");
+       bindFunc(cast(void**)&luaL_loadstring, "luaL_loadstring");
+       bindFunc(cast(void**)&luaL_newstate, "luaL_newstate");
+       bindFunc(cast(void**)&luaL_len, "luaL_len");
+       bindFunc(cast(void**)&luaL_gsub, "luaL_gsub");
+       bindFunc(cast(void**)&luaL_setfuncs, "luaL_setfuncs");
+       bindFunc(cast(void**)&luaL_getsubtable, "luaL_getsubtable");
+       bindFunc(cast(void**)&luaL_traceback, "luaL_traceback");
+       bindFunc(cast(void**)&luaL_requiref, "luaL_requiref");
+       bindFunc(cast(void**)&luaL_buffinit, "luaL_buffinit");
+       bindFunc(cast(void**)&luaL_prepbuffsize, "luaL_prepbuffsize");
+       bindFunc(cast(void**)&luaL_addlstring, "luaL_addlstring");
+       bindFunc(cast(void**)&luaL_addstring, "luaL_addstring");
+       bindFunc(cast(void**)&luaL_addvalue, "luaL_addvalue");
+       bindFunc(cast(void**)&luaL_pushresult, "luaL_pushresult");
+       bindFunc(cast(void**)&luaL_pushresultsize, "luaL_pushresultsize");
+       bindFunc(cast(void**)&luaL_buffinitsize, "luaL_buffinitsize");
+       // lualib.h
+       bindFunc(cast(void**)&luaopen_base, "luaopen_base");
+       bindFunc(cast(void**)&luaopen_coroutine, "luaopen_coroutine");
+       bindFunc(cast(void**)&luaopen_table, "luaopen_table");
+       bindFunc(cast(void**)&luaopen_io, "luaopen_io");
+       bindFunc(cast(void**)&luaopen_os, "luaopen_os");
+       bindFunc(cast(void**)&luaopen_string, "luaopen_string");
+       bindFunc(cast(void**)&luaopen_bit32, "luaopen_bit32");
+       bindFunc(cast(void**)&luaopen_math, "luaopen_math");
+       bindFunc(cast(void**)&luaopen_debug, "luaopen_debug");
+       bindFunc(cast(void**)&luaopen_package, "luaopen_package");
+       bindFunc(cast(void**)&luaL_openlibs, "luaL_openlibs");
+    }
+}
+
+DerelictLuaLoader DerelictLua;
+
+static this()
+{
+    DerelictLua = new DerelictLuaLoader();
+}
+
+static ~this()
+{
+    if(SharedLibLoader.isAutoUnloadEnabled())
+        DerelictLua.unload();
+}

derelict/lua/luad.d

+/*
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+*/
+
+// Most modules do not have D wrappers over the C functions but lua implements a number of functions
+// that all have the same basic operation but opperate on different types. This file provides templates
+// that make such operations simpler. They mostly should evaluate at compile time to remove any overhead.
+
+module derelict.lua.luad;
+
+import derelict.lua.luatypes;
+import derelict.lua.luafuncs;
+
+alias lua_State* lua_Thread;
+alias void* lua_Function;
+alias void* lua_Table;
+alias void* lua_Userdata;
+alias void* lua_LightUserdata;
+alias void  lua_Nil;
+
+bool lua_is(T)(lua_State* L, int i)
+{
+	static if(is(T == lua_Number) || is(T == int)) return cast(bool)lua_isnumber(L, i);
+	else static if(is(T == bool)) return cast(bool)lua_isboolean(L, i);
+	else static if(is(T == string)) return cast(bool)lua_isstring(L, i);
+	else static if(is(T == lua_CFunction)) return cast(bool)lua_iscfunction(L, i);
+	else static if(is(T == lua_Thread)) return cast(bool)lua_isthread(L, i);
+	else static if(is(T == lua_Function)) return cast(bool)lua_isfunction(L, i);
+	else static if(is(T == lua_Table)) return cast(bool)lua_istable(L, i);
+	else static if(is(T == lua_Userdata)) return cast(bool)lua_isuserdata(L, i);
+	else static if(is(T == lua_LightUserdata)) return cast(bool)lua_islightuserdata(L, i);
+	else static if(is(T == lua_Nil)) return cast(bool)lua_isnil(L, i);
+	else static assert(false, "Type, " ~ T.stringof ~ ", is not a valid lua type to \'lua_is\'");
+}
+
+T lua_to(T)(lua_State* L, int i)
+{
+	static if(is(T == lua_Number)) return lua_tonumber(L, i);
+	else static if(is(T == int)) return lua_tointeger(L, i);
+	else static if(is(T == bool)) return cast(bool)lua_toboolean(L, i);
+	else static if(is(T == string)) 
+	{
+		// Ugly but i cannot find a nice way to convert a char* to a string
+		char* cp = lua_tostring(L, i);
+		string s;
+		while(*cp) s ~= *cp++;
+		return s;
+	}	
+	else static if(is(T == lua_CFunction)) return lua_tocfunction(L, i);
+	else static if(is(T == lua_Thread)) return lua_tothread(L, i);
+	else static if(is(T == void*)) return lua_topointer(L, i);
+	else static if(is(T == lua_Userdata)) return lua_touserdata(L, i);
+	else static assert(false, "Type, " ~ T.stringof ~ ", is not a valid lua type to \'lua_to\'");
+}
+
+// We do not save the pointer returned from lua in lua_pushstring
+void lua_push(T)(lua_State* L, T t)
+{
+	static if(is(T == lua_Number)) lua_pushnumber(L, t);
+	else static if(is(T == int)) lua_pushinteger(L, t);
+	else static if(is(T == bool)) lua_pushboolean(L, t);
+	else static if(is(T == string)) 
+	{
+		// For some dumb reason lua_pushstring(L, (t~'\0').ptr); does not work
+		// I suspect it may be a gc issure
+		immutable(char)* c = (t~'\0').ptr;
+		lua_pushstring(L, c);
+	}	
+	else static if(is(T == lua_CFunction)) lua_pushcfunction(L, t);
+	else static if(is(T == lua_Thread)) lua_tothread(L, i);
+	else static if(is(T == void*)) lua_topointer(L, i);
+	else static if(is(T == lua_Userdata)) lua_pushlightuserdata(L, t);
+	else static assert(false, "Type, " ~ T.stringof ~ ", is not a valid lua type to \'lua_push\'");
+}
+	
+// We do not save the thread state from lua in lua_pushthread
+void lua_push(T)(lua_State *L)
+{
+	static if(is(T == lua_Nil)) lua_pushnil(L);
+	else static if(is(T == lua_Thread)) lua_pushthread(L);
+	else static assert(false, "Type, " ~ T.stringof ~ ", is not a valid lua type to \'lua_push\'");
+}
+	
+void lua_push(T)(lua_State *L, T t, int up)
+{
+	static if(is(T == lua_CFunction)) lua_pushcclosure(L, t, up);
+	else static assert(false, "Type, " ~ T.stringof ~ ", is not a valid lua type to \'lua_push\'");
+}
+
+/+ 
+ 	I am not gonna support these from the template, use it directly if you need it
+    alias char* function(lua_State*, const char*, uint) mw_lua_pushlstring;
+    alias char* function(lua_State*, const char*, void* /+va_list+/) mw_lua_pushvfstring;
+    alias char* function(lua_State*, const char*, ...) mw_lua_pushfstring;
++/

derelict/lua/luafuncs.d

+/*
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+*/
+
+module derelict.lua.luafuncs;
+
+private
+{
+    import derelict.util.compat;
+    import derelict.lua.luatypes;
+}
+
+extern(System)
+{
+	// lua.h
+    alias lua_State* function(lua_Alloc, void*) mw_lua_newstate;
+    alias void function(lua_State*) mw_lua_close;
+    alias lua_State* function(lua_State*) mw_lua_newthread;
+    alias lua_CFunction function(lua_State*, lua_CFunction) mw_lua_atpanic;
+    alias const lua_Number* function(lua_State*) mw_lua_version;
+    alias int function(lua_State*, int) mw_lua_absindex;
+    alias int function(lua_State*) mw_lua_gettop;
+    alias void function(lua_State*, int) mw_lua_settop;
+    alias void function(lua_State*, int) mw_lua_pushvalue;
+    alias void function(lua_State*, int) mw_lua_remove;
+    alias void function(lua_State*, int) mw_lua_insert;
+    alias void function(lua_State*, int) mw_lua_replace;
+    alias void function(lua_State*, int, int) mw_lua_copy;
+    alias int function(lua_State*, int) mw_lua_checkstack;
+    alias void function(lua_State*, lua_State*, int) mw_lua_xmove;
+    alias int function(lua_State*, int) mw_lua_isnumber;
+    alias int function(lua_State*, int) mw_lua_isstring;
+    alias int function(lua_State*, int) mw_lua_iscfunction;
+    alias int function(lua_State*, int) mw_lua_isuserdata;
+    alias int function(lua_State*, int) mw_lua_type;
+    alias char* function(lua_State*, int) mw_lua_typename;
+    alias lua_Number function(lua_State*, int, int*) mw_lua_tonumberx;
+    alias lua_Integer function(lua_State*, int, int*) mw_lua_tointegerx;
+    alias lua_Unsigned function(lua_State*, int, int*) mw_lua_tounsignedx;
+    alias int function(lua_State*, int) mw_lua_toboolean;
+    alias char* function(lua_State*, int, int*) mw_lua_tolstring;
+    alias uint function(lua_State*, int) mw_lua_rawlen;
+    alias lua_CFunction function(lua_State*, int) mw_lua_tocfunction;
+    alias void* function(lua_State*, int) mw_lua_touserdata;
+    alias lua_State* function(lua_State*, int) mw_lua_tothread;
+    alias void* function(lua_State*, int) mw_lua_topointer;
+    alias void function(lua_State*, int) mw_lua_arith;
+    alias int function(lua_State*, int, int) mw_lua_rawequal;
+    alias int function(lua_State*, int, int, int) mw_lua_compare;
+    alias void function(lua_State*) mw_lua_pushnil;
+    alias void function(lua_State*, lua_Number) mw_lua_pushnumber;
+    alias void function(lua_State*, lua_Integer) mw_lua_pushinteger;
+    alias void function(lua_State*, lua_Unsigned) mw_lua_pushunsigned;
+    alias char* function(lua_State*, const char*, uint) mw_lua_pushlstring;
+    alias char* function(lua_State*, const char*) mw_lua_pushstring;
+    alias char* function(lua_State*, const char*, void* /+va_list+/) mw_lua_pushvfstring;
+    alias char* function(lua_State*, const char*, ...) mw_lua_pushfstring;
+    alias void function(lua_State*, lua_CFunction, int) mw_lua_pushcclosure;
+    alias void function(lua_State*, int) mw_lua_pushboolean;
+    alias void function(lua_State*, void*) mw_lua_pushlightuserdata;
+    alias int function(lua_State*) mw_lua_pushthread;
+    alias void function(lua_State*, const char*) mw_lua_getglobal;
+    alias void function(lua_State*, int) mw_lua_gettable;
+    alias void function(lua_State*, int, const char*) mw_lua_getfield;
+    alias void function(lua_State*, int) mw_lua_rawget;
+    alias void function(lua_State*, int, int) mw_lua_rawgeti;
+    alias void function(lua_State*, int, const void*) mw_lua_rawgetp;
+    alias void function(lua_State*, int, int) mw_lua_createtable;
+    alias void* function(lua_State*, uint) mw_lua_newuserdata;
+    alias int function(lua_State*, int) mw_lua_getmetatable;
+    alias void function(lua_State*, int) mw_lua_getuservalue;
+    alias void function(lua_State*, const char*) mw_lua_setglobal;
+    alias void function(lua_State*, int) mw_lua_settable;
+    alias void function(lua_State*, int, const char*) mw_lua_setfield;
+    alias void function(lua_State*, int) mw_lua_rawset;
+    alias void function(lua_State*, int, int) mw_lua_rawseti;
+    alias void function(lua_State*, int, const void*) mw_lua_rawsetp;
+    alias int function(lua_State*, int) mw_lua_setmetatable;
+    alias void function(lua_State*, int) mw_lua_setuserdata;
+    alias void function(lua_State*, int, int, int, lua_CFunction) mw_lua_callk;
+    alias int function(lua_State*, int*) mw_lua_getctx;
+    alias int function(lua_State*, int, int, int, int, lua_CFunction) mw_lua_pcallk;
+    alias int function(lua_State*, lua_Reader, void*, const char*, const char*) mw_lua_load;
+    alias int function(lua_State*, lua_Writer, void*) mw_lua_dump;
+    alias int function(lua_State*, int, int, lua_CFunction) mw_lua_yieldk;
+    alias int function(lua_State*, lua_State*, int) mw_lua_resume;
+    alias int function(lua_State*) mw_lua_status;
+    alias int function(lua_State*, int, int) mw_lua_gc;
+    alias int function(lua_State*) mw_lua_error;
+    alias int function(lua_State*, int) mw_lua_next;
+    alias int function(lua_State*, int) mw_lua_concat;
+    alias int function(lua_State*, int) mw_lua_len;
+    alias lua_Alloc function(lua_State*, void**) mw_lua_getallocf;
+    alias void function(lua_State*, lua_Alloc, void*) mw_lua_setallocf;
+    // luaxlib.h
+    alias void function(lua_State*, lua_Number) mw_luaL_checkversion_;
+    alias int function(lua_State*, int, const char*) mw_luaL_getmetafield;
+    alias int function(lua_State*, int, const char*) mw_luaL_callmeta;
+    alias char* function(lua_State*, int, uint*) mw_luaL_tolstring;
+    alias int function(lua_State*, int, const char*) mw_luaL_argerror;
+    alias char* function(lua_State*, int, uint*) mw_luaL_checklstring;
+    alias char* function(lua_State*, int, const char*, uint*) mw_luaL_optlstring;
+    alias lua_Number function(lua_State*, int) mw_luaL_checknumber;
+    alias lua_Number function(lua_State*, int, lua_Number) mw_luaL_optnumber;
+    alias lua_Integer function(lua_State*, int) mw_luaL_checkinteger;
+    alias lua_Integer function(lua_State*, int, lua_Integer) mw_luaL_optinteger;
+    alias lua_Unsigned function(lua_State*, int) mw_luaL_checkunsigned;
+    alias lua_Unsigned function(lua_State*, int, lua_Unsigned) mw_luaL_optunsigned;
+    alias void function(lua_State*, int, const char*) mw_luaL_checkstack;
+    alias void function(lua_State*, int, int) mw_luaL_checktype;
+    alias void function(lua_State*, int) mw_luaL_checkany;
+    alias int function(lua_State*, const char*) mw_luaL_newmetatable;
+    alias void function(lua_State*, const char*) mw_luaL_setmetatable;
+    alias void* function(lua_State*, int, const char*) mw_luaL_testudata;
+    alias void* function(lua_State*, int, const char*) mw_luaL_checkudata;
+    alias void function(lua_State*, int) mw_luaL_where;
+    alias int function(lua_State*, const char*, ...) mw_luaL_error;
+    alias int function(lua_State*, int, const char*, const char**) mw_luaL_checkoption;
+    alias int function(lua_State*, int, const char*) mw_luaL_fileresult;
+    alias int function(lua_State*, int) mw_luaL_execresult;
+    alias int function(lua_State*, int) mw_luaL_ref;
+    alias void function(lua_State*, int, int) mw_luaL_unref;
+    alias int function(lua_State*, const char*, const char*) mw_luaL_loadfilex;
+    alias int function(lua_State*, const char*, uint, const char*, const char*) mw_luaL_loadbufferx;
+    alias int function(lua_State*, const char*) mw_luaL_loadstring;
+    alias lua_State* function() mw_luaL_newstate;
+    alias int function(lua_State*, int) mw_luaL_len;
+    alias char* function(lua_State*, const char*, const char*, const char*) mw_luaL_gsub;
+    alias void function(lua_State*, const char*, int) mw_luaL_setfuncs;
+    alias int function(lua_State*, int, const char*) mw_luaL_getsubtable;
+    alias void function(lua_State*, lua_State*, const char*, int) mw_luaL_traceback;
+    alias void function(lua_State*, const char*, lua_CFunction, int) mw_luaL_requiref;
+    alias void function(lua_State*, luaL_Buffer*) mw_luaL_buffinit;
+    alias char* function(luaL_Buffer*, uint) mw_luaL_prepbuffsize;
+    alias void function(luaL_Buffer*, const char*, uint) mw_luaL_addlstring;
+    alias void function(luaL_Buffer*, const char*) mw_luaL_addstring;
+    alias void function(luaL_Buffer*) mw_luaL_addvalue;
+    alias void function(luaL_Buffer*) mw_luaL_pushresult;
+    alias void function(luaL_Buffer*, uint) mw_luaL_pushresultsize;
+    alias char* function(lua_State*, luaL_Buffer*, uint) mw_luaL_buffinitsize;
+    // lualib.h
+    alias int function(lua_State*) mw_luaopen_base;
+    alias int function(lua_State*) mw_luaopen_coroutine;
+    alias int function(lua_State*) mw_luaopen_table;
+    alias int function(lua_State*) mw_luaopen_io;
+    alias int function(lua_State*) mw_luaopen_os;
+    alias int function(lua_State*) mw_luaopen_string;
+    alias int function(lua_State*) mw_luaopen_bit32;
+    alias int function(lua_State*) mw_luaopen_math;
+    alias int function(lua_State*) mw_luaopen_debug;
+    alias int function(lua_State*) mw_luaopen_package;
+    alias void function(lua_State*) mw_luaL_openlibs;
+}
+
+void lua_call(lua_State *L, int n, int r)
+{
+	lua_callk(L, n, r, 0, null);
+}
+	
+int lua_pcall(lua_State *L, int n, int r, int f)
+{
+	return lua_pcallk(L, n, r, f, 0, null);
+}
+	
+int lua_yield(lua_State *L, int n)
+{
+	return lua_yieldk(L, n, 0, null);
+}
+	
+lua_Number lua_tonumber(lua_State *L, int i)
+{
+	return lua_tonumberx(L, i, null);
+}	
+	
+int lua_tointeger(lua_State *L, int i)	
+{
+	return lua_tointegerx(L, i, null);
+}
+	
+uint lua_tounsigned(lua_State *L, int i)
+{
+	return lua_tounsignedx(L, i, null);
+}
+
+void lua_pop(lua_State *L, int n)
+{
+	lua_settop(L, -n - 1);
+}
+
+void lua_newtable(lua_State *L)
+{
+	lua_createtable(L, 0, 0);
+}
+
+void lua_register(lua_State *L, const char *n, lua_CFunction f)
+{
+	lua_pushcfunction(L, f);
+	lua_setglobal(L, n);
+}	
+
+void lua_pushcfunction(lua_State *L, lua_CFunction f)
+{
+	lua_pushcclosure(L, f, 0);
+}	
+
+int lua_isfunction(lua_State *L, int n)
+{
+	return lua_type(L, n) == LUA_TFUNCTION;
+}
+	
+int lua_istable(lua_State *L, int n)
+{
+	return lua_type(L, n) == LUA_TTABLE;
+}
+		
+int lua_islightuserdata(lua_State *L, int n)
+{
+	return lua_type(L, n) == LUA_TLIGHTUSERDATA;
+}
+		
+int lua_isnil(lua_State *L, int n)
+{
+	return lua_type(L, n) == LUA_TNIL;
+}
+		
+int lua_isboolean(lua_State *L, int n)
+{
+	return lua_type(L, n) == LUA_TBOOLEAN;
+}
+		
+int lua_isthread(lua_State *L, int n)
+{
+	return lua_type(L, n) == LUA_TTHREAD;
+}	
+	
+int lua_isnone(lua_State *L, int n)	
+{
+	return lua_type(L, n) == LUA_TNONE;
+}
+	
+int lua_isnoneornil(lua_State *L, int n)
+{
+	return lua_type(L, n) <= 0;
+}	
+
+void lua_pushliteral(lua_State *L, immutable(char*) s)
+{
+	lua_pushlstring(L,  s, s.sizeof/char.sizeof-1);
+}
+
+void lua_pushglobaltable(lua_State *L)
+{
+	lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS);
+}
+
+char* lua_tostring(lua_State *L, int i)
+{
+	return lua_tolstring(L, i, null);
+}
+	
+void luaL_checkversion(lua_State* L)
+{
+	luaL_checkversion_(L, LUA_VERSION_NUM);
+}
+	
+int luaL_loadfile(lua_State *L, immutable(char*) f)
+{
+	return luaL_loadfilex(L, f, "r\0");
+}
+	
+void luaL_newlibtable(lua_State *L, immutable(char*) l)
+{
+	lua_createtable(L, 0, l.sizeof/l[0].sizeof - 1);
+}
+	
+void luaL_newlib(lua_State *L, immutable(char*) l)
+{
+	luaL_newlibtable(L, l);
+	luaL_setfuncs(L, l, 0);
+}	
+
+int luaL_argcheck(lua_State *L, int cond, int numarg, immutable(char*) extramsg)
+{
+	return cond || luaL_argerror(L, numarg, extramsg);
+}
+	
+char* luaL_checkstring(lua_State *L, int n)
+{
+	return luaL_checklstring(L, n, null);
+}
+	
+char* luaL_optstring(lua_State* L, int n, immutable(char*) d)
+{
+	return luaL_optlstring(L, n, d, null);
+}
+		
+int luaL_checkint(lua_State *L, int n)
+{
+	return cast(int)luaL_checkinteger(L, n);
+}
+		
+int luaL_optint(lua_State *L, int n, int d)
+{
+	return cast(int)luaL_optinteger(L, n, d);
+}
+		
+int luaL_checklong(lua_State *L, int n)
+{
+	return cast(int)luaL_checkinteger(L, n);
+}
+	
+int luaL_optlong(lua_State *L, int n, int d)
+{
+	return cast(int)luaL_optinteger(L, n, d);
+}	
+
+char* luaL_typename(lua_State *L, int i)
+{
+	return lua_typename(L, lua_type(L,i));
+}	
+
+int luaL_dofile(lua_State *L, immutable(char*) fn)
+{
+	return luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0);
+}	
+	
+import std.stdio;
+
+int luaL_dostring(lua_State *L, immutable(char*) s)
+{
+	return luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0);
+}	
+
+void luaL_getmetatable(lua_State* L, immutable(char*) n)	
+{
+	lua_getfield(L, LUA_REGISTRYINDEX, n);
+}	
+
+/+int luaL_opt(lua_State *L,  f, int n, int d)
+{
+	return lua_isnoneornil(L, n) ? d : f(L, n);
+}+/	
+
+int luaL_loadbuffer(lua_State *L, immutable(char*) s, uint sz, immutable(char*) n)	
+{
+	return luaL_loadbufferx(L, s, sz, n, null);
+}	
+
+void luaL_addchar(luaL_Buffer *B, char c)
+{
+	B.n < B.size || luaL_prepbuffsize(B, 1);
+	B.b[B.n++] = c;
+}
+
+void luaL_addsize(luaL_Buffer *B, int s)
+{
+	B.n += s;
+}
+
+char* luaL_prepbuffer(luaL_Buffer *B)
+{
+	return luaL_prepbuffsize(B, LUAL_BUFFERSIZE);
+}
+
+__gshared
+{
+	// lua.h	
+	mw_lua_newstate lua_newstate;
+	mw_lua_close lua_close;
+	mw_lua_newthread lua_newthread;
+	mw_lua_atpanic lua_atpanic;
+	mw_lua_version lua_version;
+	mw_lua_absindex lua_absindex;
+	mw_lua_gettop lua_gettop;
+	mw_lua_settop lua_settop;
+	mw_lua_pushvalue lua_pushvalue;
+	mw_lua_remove lua_remove;
+	mw_lua_insert lua_insert;
+	mw_lua_replace lua_replace;
+	mw_lua_copy lua_copy;
+	mw_lua_checkstack lua_checkstack;
+	mw_lua_xmove lua_xmove;
+	mw_lua_isnumber lua_isnumber;
+	mw_lua_isstring lua_isstring;
+	mw_lua_iscfunction lua_iscfunction;
+	mw_lua_isuserdata lua_isuserdata;
+	mw_lua_type lua_type;
+	mw_lua_typename lua_typename;
+	mw_lua_tonumberx lua_tonumberx;
+	mw_lua_tointegerx lua_tointegerx;
+	mw_lua_tounsignedx lua_tounsignedx;
+	mw_lua_toboolean lua_toboolean;
+	mw_lua_tolstring lua_tolstring;
+	mw_lua_rawlen lua_rawlen;
+	mw_lua_tocfunction lua_tocfunction;
+	mw_lua_touserdata lua_touserdata;
+	mw_lua_tothread lua_tothread;
+	mw_lua_topointer lua_topointer;
+	mw_lua_arith lua_arith;
+	mw_lua_rawequal lua_rawequal;
+	mw_lua_compare lua_compare;
+	mw_lua_pushnil lua_pushnil;
+	mw_lua_pushnumber lua_pushnumber;
+	mw_lua_pushinteger lua_pushinteger;
+	mw_lua_pushunsigned lua_pushunsigned;
+	mw_lua_pushlstring lua_pushlstring;
+	mw_lua_pushstring lua_pushstring;
+	mw_lua_pushvfstring lua_pushvfstring;
+	mw_lua_pushfstring lua_pushfstring;
+	mw_lua_pushcclosure lua_pushcclosure;
+	mw_lua_pushboolean lua_pushboolean;
+	mw_lua_pushlightuserdata lua_pushlightuserdata;
+	mw_lua_pushthread lua_pushthread;
+	mw_lua_getglobal lua_getglobal;
+	mw_lua_gettable lua_gettable;
+	mw_lua_getfield lua_getfield;
+	mw_lua_rawget lua_rawget;
+	mw_lua_rawgeti lua_rawgeti;
+	mw_lua_rawgetp lua_rawgetp;
+	mw_lua_createtable lua_createtable;
+	mw_lua_newuserdata lua_newuserdata;
+	mw_lua_getmetatable lua_getmetatable;
+	mw_lua_getuservalue lua_getuservalue;
+	mw_lua_setglobal lua_setglobal;
+	mw_lua_settable lua_settable;
+	mw_lua_setfield lua_setfield;
+	mw_lua_rawset lua_rawset;
+	mw_lua_rawseti lua_rawseti;
+	mw_lua_rawsetp lua_rawsetp;
+	mw_lua_setmetatable lua_setmetatable;
+	mw_lua_setuserdata lua_setuserdata;
+	mw_lua_callk lua_callk;
+	mw_lua_getctx lua_getctx;
+	mw_lua_pcallk lua_pcallk;
+	mw_lua_load lua_load;
+	mw_lua_dump lua_dump;
+	mw_lua_yieldk lua_yieldk;
+	mw_lua_resume lua_resume;
+	mw_lua_status lua_status;
+	mw_lua_gc lua_gc;
+	mw_lua_error lua_error;
+	mw_lua_next lua_next;
+	mw_lua_concat lua_concat;
+	mw_lua_len lua_len;
+	mw_lua_getallocf lua_getallocf;
+	mw_lua_setallocf lua_setallocf;
+	// luaxlib.h
+	mw_luaL_checkversion_ luaL_checkversion_;
+	mw_luaL_getmetafield luaL_getmetafield;
+	mw_luaL_callmeta luaL_callmeta;
+	mw_luaL_tolstring luaL_tolstring;
+	mw_luaL_argerror luaL_argerror;
+	mw_luaL_checklstring luaL_checklstring;
+	mw_luaL_optlstring luaL_optlstring;
+	mw_luaL_checknumber luaL_checknumber;
+	mw_luaL_optnumber luaL_optnumber;
+	mw_luaL_checkinteger luaL_checkinteger;
+	mw_luaL_optinteger luaL_optinteger;
+	mw_luaL_checkunsigned luaL_checkunsigned;
+	mw_luaL_optunsigned luaL_optunsigned;
+	mw_luaL_checkstack luaL_checkstack;
+	mw_luaL_checktype luaL_checktype;
+	mw_luaL_checkany luaL_checkany;
+	mw_luaL_newmetatable luaL_newmetatable;
+	mw_luaL_setmetatable luaL_setmetatable;
+	mw_luaL_testudata luaL_testudata;
+	mw_luaL_checkudata luaL_checkudata;
+	mw_luaL_where luaL_where;
+	mw_luaL_error luaL_error;
+	mw_luaL_checkoption luaL_checkoption;
+	mw_luaL_fileresult luaL_fileresult;
+	mw_luaL_execresult luaL_execresult;
+	mw_luaL_ref luaL_ref;
+	mw_luaL_unref luaL_unref;
+	mw_luaL_loadfilex luaL_loadfilex;
+	mw_luaL_loadbufferx luaL_loadbufferx;
+	mw_luaL_loadstring luaL_loadstring;
+	mw_luaL_newstate luaL_newstate;
+	mw_luaL_len luaL_len;
+	mw_luaL_gsub luaL_gsub;
+	mw_luaL_setfuncs luaL_setfuncs;
+	mw_luaL_getsubtable luaL_getsubtable;
+	mw_luaL_traceback luaL_traceback;
+	mw_luaL_requiref luaL_requiref;
+	mw_luaL_buffinit luaL_buffinit;
+	mw_luaL_prepbuffsize luaL_prepbuffsize;
+	mw_luaL_addlstring luaL_addlstring;
+	mw_luaL_addstring luaL_addstring;
+	mw_luaL_addvalue luaL_addvalue;
+	mw_luaL_pushresult luaL_pushresult;
+	mw_luaL_pushresultsize luaL_pushresultsize;
+	mw_luaL_buffinitsize luaL_buffinitsize;
+	// lualib.h
+	mw_luaopen_base luaopen_base;
+	mw_luaopen_coroutine luaopen_coroutine;
+	mw_luaopen_table luaopen_table;
+	mw_luaopen_io luaopen_io;
+	mw_luaopen_os luaopen_os;
+	mw_luaopen_string luaopen_string;
+	mw_luaopen_bit32 luaopen_bit32;
+	mw_luaopen_math luaopen_math;
+	mw_luaopen_debug luaopen_debug;
+	mw_luaopen_package luaopen_package;
+	mw_luaL_openlibs luaL_openlibs;
+}
+
+alias luaL_newstate lua_open;

derelict/lua/luatypes.d

+/*
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+*/
+
+module derelict.lua.luatypes;
+
+// Lua config stuff first
+
+enum LUA_ENV = "_ENV";
+alias int LUA_INT32;
+enum LUAI_MAXSTACK = 1000000;
+enum LUAI_FIRSTPSEUDOIDX = -LUAI_MAXSTACK-1000;
+alias double LUA_NUMBER;
+alias double LUAI_UACNUMBER;
+alias ptrdiff_t LUA_INTEGER;
+alias uint LUA_UNSIGNED;
+
+// start lua.h
+
+enum
+{
+	LUA_VERSION_MAJOR = "5",
+	LUA_VERSION_MINOR = "2",
+	LUA_VERSION_NUM = 502,
+	LUA_VERSION_RELEASE = "0",
+	
+	LUA_VERSION = "Lua " ~ LUA_VERSION_MAJOR ~ "." ~ LUA_VERSION_MINOR,
+	LUA_RELEASE = LUA_VERSION ~ "." ~ LUA_VERSION_RELEASE,
+	LUA_COPYRIGHT = LUA_RELEASE ~ "  Copyright (C) 1994-2011 Lua.org, PUC-Rio",
+	LUA_AUTHORS = "R. Ierusalimschy, L. H. de Figueiredo, W. Celes",
+	
+	LUA_SIGNATURE = "\033Lua",
+	
+	LUA_MULTRET = -1
+}
+
+enum LUA_REGISTRYINDEX = LUAI_FIRSTPSEUDOIDX;
+int lua_upvalueindex(int i) 
+{ 
+	return LUA_REGISTRYINDEX - i; 
+}
+
+//Thread status
+enum
+{
+	LUA_OK = 0,
+	LUA_YIELD,
+	LUA_ERRRUN,
+	LUA_ERRSYNTAX,
+	LUA_ERRMEM,
+	LUA_ERRGCMM,
+	LUA_ERRERR,
+	LUA_ERRFILE // defined in luaxlib.h
+}
+
+extern(System)
+{
+	struct lua_State { }
+	//alias void lua_State;
+	alias int function(lua_State*) lua_CFunction;
+	alias char* function(lua_State*, void*, uint*) lua_Reader;
+    alias int function(lua_State*, const void*, uint, void*) lua_Writer;
+	alias void* function(void*, void*, uint, uint) lua_Alloc;
+}
+
+//basic types
+enum
+{
+	LUA_TNONE = -1,
+	LUA_TNIL = 0,
+	LUA_TBOOLEAN,
+	LUA_TLIGHTUSERDATA,
+	LUA_TNUMBER,
+	LUA_TSTRING,
+	LUA_TTABLE,
+	LUA_TFUNCTION,
+	LUA_TUSERDATA,
+	LUA_TTHREAD,
+
+	LUA_NUMTAGS
+}
+
+//minimum Lua stack available to a C function
+enum LUA_MINSTACK = 20;
+
+//predefined values in the registry
+enum
+{
+	LUA_RIDX_MAINTHREAD	= 1,
+	LUA_RIDX_GLOBALS = 2,
+	LUA_RIDX_LAST = LUA_RIDX_GLOBALS
+}
+
+alias double lua_Number;
+alias int lua_Integer;
+alias uint lua_Unsigned;
+
+enum
+{
+	LUA_OPADD = 0,
+	LUA_OPSUB,
+	LUA_OPMUL,
+	LUA_OPDIV,
+	LUA_OPMOD,
+	LUA_OPPOW,
+	LUA_OPUNM,
+	
+	LUA_OPEQ = 0,
+	LUA_OPLT,
+	LUA_OPLE
+}
+
+enum
+{
+	LUA_GCSTOP = 0,
+	LUA_GCRESTART,
+	LUA_GCCOLLECT,
+	LUA_GCCOUNT,
+	LUA_GCCOUNTB,
+	LUA_GCSTEP,
+	LUA_GCSETPAUSE,
+	LUA_GCSETSTEPMUL,
+	LUA_GCSETMAJORINC,
+	LUA_GCISRUNNING,
+	LUA_GCGEN,
+	LUA_GCINC
+}
+
+// Start luaxlib.h
+
+import std.c.stdio;
+
+extern(System)
+{
+	struct luaL_Reg
+	{
+		char *name;
+		lua_CFunction func;
+	}
+	
+	enum LUAL_BUFFERSIZE = 64;
+	
+	struct luaL_Buffer
+	{
+		char *b;
+		uint size;
+		uint n;
+		lua_State *L;
+		char[LUAL_BUFFERSIZE] initb;
+	}
+	
+	struct luaL_Stream
+	{
+		FILE* f;
+		lua_CFunction closef;
+	}
+}
+
+enum
+{
+	LUA_NOREF = -2,
+	LUA_REFNIL = -1
+}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.