public static int CheckOption(LuaStatePtr l, int narg, string def, string[] lst) { sbyte *[] lst_ = new sbyte*[lst.Length]; for (int i = 0; i < lst.Length; ++i) { fixed(char * c = &lst[i].ToCharArray()[0]) { sbyte * b = (sbyte *)c; lst_[i] = b; } } return LuaLDelegates.luaL_checkoption(l, narg, def, lst_); }
internal static extern IntPtr lua_touserdata(LuaStatePtr l, int idx);
internal static extern int lua_rawlen(LuaStatePtr l, int idx);
internal static extern int lua_toboolean(LuaStatePtr l, int idx);
// public static bool ArgCheck(LuaStatePtr l, bool cond, int numarg, string extramsg) { // // WHAT DO I PUT HERE? // } public static string CheckString(LuaStatePtr l, int n) { return(new string(LuaLDelegates.luaL_checklstring(l, n, null))); }
internal static extern void lua_pushlightuserdata(LuaStatePtr l, IntPtr p);
internal static extern sbyte * lua_pushstring(LuaStatePtr l, [MarshalAs(UnmanagedType.LPStr)] string s);
internal static extern void lua_pushnil(LuaStatePtr l);
public static int Opt(LuaStatePtr l, Delegate f, int n, int d) { return(Lua.IsNoneOrNil(l, n) ? d : (int)f.DynamicInvoke(l, n)); }
public static void GetMetaTable(LuaStatePtr l, string n) { Lua.GetField(l, Lua.RegistryIndex, n); }
public static void DoString(LuaStatePtr l, string s) { LuaL.LoadString(l, s); Lua.PCall(l, 0, Lua.MultRet, 0); }
public static int LoadFile(LuaStatePtr l, string f) { return(LuaL.LoadFilex(l, f, null)); }
public static void DoFile(LuaStatePtr l, string fn) { LuaL.LoadFile(l, fn); Lua.PCall(l, 0, Lua.MultRet, 0); }
// Skipped unneeded methods luaL_checkint etc. public static string TypeName(LuaStatePtr l, int i) { return(Lua.TypeName(l, Lua.Type(l, i))); }
public static string OptString(LuaStatePtr l, int n, string d) { return(new string(LuaLDelegates.luaL_optlstring(l, n, d, null))); }
internal static extern IntPtr lua_topointer(LuaStatePtr l, int idx);
internal static extern int lua_rawequal(LuaStatePtr l, int idx1, int idx2);
public static LuaBufferPtr LoadBuffer(LuaStatePtr l, string s, int sz, string n) { return(LuaL.LoadBufferx(l, s, sz, n, null)); }
internal static extern void lua_pushinteger(LuaStatePtr l, int n);
internal extern static sbyte *luaL_gsub(LuaStatePtr l, [MarshalAs(UnmanagedType.LPStr)] string s, [MarshalAs(UnmanagedType.LPStr)] string p, [MarshalAs(UnmanagedType.LPStr)] string r);
internal static extern void lua_close(LuaStatePtr l);
internal extern static void luaL_setfuncs(LuaStatePtr l, IntPtr l_, int nup);
internal static extern void lua_getglobal(LuaStatePtr l, [MarshalAs(UnmanagedType.LPStr)] string var);
internal extern static int luaL_getsubtable(LuaStatePtr l, int idx, [MarshalAs(UnmanagedType.LPStr)] string fname);
internal static extern uint lua_tounsignedx(LuaStatePtr l, int idx, int * isnum);
internal extern static void luaL_traceback(LuaStatePtr l, LuaStatePtr l1, [MarshalAs(UnmanagedType.LPStr)] string msg, int level);
internal static extern sbyte * lua_tolstring(LuaStatePtr l, int idx, int * len);
internal extern static void luaL_requiref(LuaStatePtr l, [MarshalAs(UnmanagedType.LPStr)] string modname, LuaCFunction openf, int glb);
internal static extern LuaCFunction lua_tocfunction(LuaStatePtr l, int idx);
internal extern static void luaL_buffinit(LuaStatePtr l, LuaBufferPtr B);
internal static extern LuaStatePtr lua_tothread(LuaStatePtr l, int idx);
internal extern static int luaL_callmeta(LuaStatePtr l, int obj, [MarshalAs(UnmanagedType.LPStr)] string e);
internal static extern void lua_arith(LuaStatePtr l, int op);
internal extern static sbyte *luaL_buffinitsize(LuaStatePtr l, LuaBufferPtr B, int sz);
internal static extern int lua_compare(LuaStatePtr l, int idx1, int idx2, int op);
internal static extern int lua_iscfunction(LuaStatePtr l, int idx);
internal static extern void lua_pushnumber(LuaStatePtr l, double n);
internal static extern int lua_isuserdata(LuaStatePtr l, int idx);
internal static extern void lua_pushunsigned(LuaStatePtr l, uint n);
internal static extern int lua_type(LuaStatePtr l, int idx);
internal static extern void lua_pushcclosure(LuaStatePtr l, LuaCFunction fn, int n);
internal static extern string lua_typename(LuaStatePtr l, int tp);
internal static extern void lua_pushboolean(LuaStatePtr l, int b);
internal static extern double lua_tonumberx(LuaStatePtr l, int idx, int * isnum);
internal static extern int lua_pushthread(LuaStatePtr l);
internal static extern int lua_tointegerx(LuaStatePtr l, int idx, int * isnum);
internal static extern void lua_gettable(LuaStatePtr l, int idx);
public static void NewLibTable(LuaStatePtr l, string l_) { Lua.CreateTable(l, 0, l_.Length); }