Advertisement
Naohiro19

Lua 5.3 wrapper by CppSharp

Mar 23rd, 2018
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 126.14 KB | None | 0 0
  1. // ----------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This is autogenerated code by CppSharp.
  4. // Do not edit this file or all your changes will be lost after re-generation.
  5. // </auto-generated>
  6. // ----------------------------------------------------------------------------
  7. using System;
  8. using System.Runtime.InteropServices;
  9. using System.Security;
  10.  
  11. namespace Lua53
  12. {
  13.     [SuppressUnmanagedCodeSecurity, UnmanagedFunctionPointer(global::System.Runtime.InteropServices.CallingConvention.Cdecl)]
  14.     public unsafe delegate int LuaCFunction(global::System.IntPtr L);
  15.  
  16.     [SuppressUnmanagedCodeSecurity, UnmanagedFunctionPointer(global::System.Runtime.InteropServices.CallingConvention.Cdecl)]
  17.     public unsafe delegate int LuaKFunction(global::System.IntPtr L, int status, int ctx);
  18.  
  19.     [SuppressUnmanagedCodeSecurity, UnmanagedFunctionPointer(global::System.Runtime.InteropServices.CallingConvention.Cdecl)]
  20.     public unsafe delegate global::System.IntPtr LuaReader(global::System.IntPtr L, global::System.IntPtr ud, uint* sz);
  21.  
  22.     [SuppressUnmanagedCodeSecurity, UnmanagedFunctionPointer(global::System.Runtime.InteropServices.CallingConvention.Cdecl)]
  23.     public unsafe delegate int LuaWriter(global::System.IntPtr L, global::System.IntPtr p, uint sz, global::System.IntPtr ud);
  24.  
  25.     [SuppressUnmanagedCodeSecurity, UnmanagedFunctionPointer(global::System.Runtime.InteropServices.CallingConvention.Cdecl)]
  26.     public unsafe delegate global::System.IntPtr LuaAlloc(global::System.IntPtr ud, global::System.IntPtr ptr, uint osize, uint nsize);
  27.  
  28.     [SuppressUnmanagedCodeSecurity, UnmanagedFunctionPointer(global::System.Runtime.InteropServices.CallingConvention.Cdecl)]
  29.     public unsafe delegate void LuaHook(global::System.IntPtr L, global::System.IntPtr ar);
  30.  
  31.     public unsafe partial class LuaState
  32.     {
  33.         public partial struct __Internal
  34.         {
  35.         }
  36.  
  37.         public global::System.IntPtr __Instance { get; protected set; }
  38.  
  39.         protected int __PointerAdjustment;
  40.         internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Lua53.LuaState> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Lua53.LuaState>();
  41.         protected void*[] __OriginalVTables;
  42.  
  43.         protected bool __ownsNativeInstance;
  44.  
  45.         internal static global::Lua53.LuaState __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
  46.         {
  47.             return new global::Lua53.LuaState(native.ToPointer(), skipVTables);
  48.         }
  49.  
  50.         internal static global::Lua53.LuaState __CreateInstance(global::Lua53.LuaState.__Internal native, bool skipVTables = false)
  51.         {
  52.             return new global::Lua53.LuaState(native, skipVTables);
  53.         }
  54.  
  55.         private static void* __CopyValue(global::Lua53.LuaState.__Internal native)
  56.         {
  57.             var ret = Marshal.AllocHGlobal(sizeof(global::Lua53.LuaState.__Internal));
  58.             *(global::Lua53.LuaState.__Internal*) ret = native;
  59.             return ret.ToPointer();
  60.         }
  61.  
  62.         private LuaState(global::Lua53.LuaState.__Internal native, bool skipVTables = false)
  63.             : this(__CopyValue(native), skipVTables)
  64.         {
  65.             __ownsNativeInstance = true;
  66.             NativeToManagedMap[__Instance] = this;
  67.         }
  68.  
  69.         protected LuaState(void* native, bool skipVTables = false)
  70.         {
  71.             if (native == null)
  72.                 return;
  73.             __Instance = new global::System.IntPtr(native);
  74.         }
  75.  
  76.         ~LuaState()
  77.         {
  78.             Dispose(false);
  79.         }
  80.     }
  81.  
  82.     public unsafe partial class LuaDebug : IDisposable
  83.     {
  84.         public partial struct __Internal
  85.         {
  86.             internal int @event;
  87.  
  88.             internal global::System.IntPtr name;
  89.  
  90.             internal global::System.IntPtr namewhat;
  91.  
  92.             internal global::System.IntPtr what;
  93.  
  94.             internal global::System.IntPtr source;
  95.  
  96.             internal int currentline;
  97.  
  98.             internal int linedefined;
  99.  
  100.             internal int lastlinedefined;
  101.  
  102.             internal byte nups;
  103.  
  104.             internal byte nparams;
  105.  
  106.             internal sbyte isvararg;
  107.  
  108.             internal sbyte istailcall;
  109.  
  110.             internal fixed sbyte short_src[60];
  111.  
  112.             internal global::System.IntPtr i_ci;
  113.  
  114.             [SuppressUnmanagedCodeSecurity]
  115.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
  116.                 EntryPoint="??0lua_Debug@@QAE@ABU0@@Z")]
  117.             internal static extern global::System.IntPtr cctor(global::System.IntPtr instance, global::System.IntPtr _0);
  118.         }
  119.  
  120.         public global::System.IntPtr __Instance { get; protected set; }
  121.  
  122.         protected int __PointerAdjustment;
  123.         internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Lua53.LuaDebug> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Lua53.LuaDebug>();
  124.         protected void*[] __OriginalVTables;
  125.  
  126.         protected bool __ownsNativeInstance;
  127.  
  128.         internal static global::Lua53.LuaDebug __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
  129.         {
  130.             return new global::Lua53.LuaDebug(native.ToPointer(), skipVTables);
  131.         }
  132.  
  133.         internal static global::Lua53.LuaDebug __CreateInstance(global::Lua53.LuaDebug.__Internal native, bool skipVTables = false)
  134.         {
  135.             return new global::Lua53.LuaDebug(native, skipVTables);
  136.         }
  137.  
  138.         private static void* __CopyValue(global::Lua53.LuaDebug.__Internal native)
  139.         {
  140.             var ret = Marshal.AllocHGlobal(sizeof(global::Lua53.LuaDebug.__Internal));
  141.             *(global::Lua53.LuaDebug.__Internal*) ret = native;
  142.             return ret.ToPointer();
  143.         }
  144.  
  145.         private LuaDebug(global::Lua53.LuaDebug.__Internal native, bool skipVTables = false)
  146.             : this(__CopyValue(native), skipVTables)
  147.         {
  148.             __ownsNativeInstance = true;
  149.             NativeToManagedMap[__Instance] = this;
  150.         }
  151.  
  152.         protected LuaDebug(void* native, bool skipVTables = false)
  153.         {
  154.             if (native == null)
  155.                 return;
  156.             __Instance = new global::System.IntPtr(native);
  157.         }
  158.  
  159.         public LuaDebug()
  160.         {
  161.             __Instance = Marshal.AllocHGlobal(sizeof(global::Lua53.LuaDebug.__Internal));
  162.             __ownsNativeInstance = true;
  163.             NativeToManagedMap[__Instance] = this;
  164.         }
  165.  
  166.         public LuaDebug(global::Lua53.LuaDebug _0)
  167.         {
  168.             __Instance = Marshal.AllocHGlobal(sizeof(global::Lua53.LuaDebug.__Internal));
  169.             __ownsNativeInstance = true;
  170.             NativeToManagedMap[__Instance] = this;
  171.             *((global::Lua53.LuaDebug.__Internal*) __Instance) = *((global::Lua53.LuaDebug.__Internal*) _0.__Instance);
  172.         }
  173.  
  174.         ~LuaDebug()
  175.         {
  176.             Dispose(false);
  177.         }
  178.  
  179.         public void Dispose()
  180.         {
  181.             Dispose(disposing: true);
  182.             GC.SuppressFinalize(this);
  183.         }
  184.  
  185.         public virtual void Dispose(bool disposing)
  186.         {
  187.             if (__Instance == IntPtr.Zero)
  188.                 return;
  189.             global::Lua53.LuaDebug __dummy;
  190.             NativeToManagedMap.TryRemove(__Instance, out __dummy);
  191.             if (__ownsNativeInstance)
  192.                 Marshal.FreeHGlobal(__Instance);
  193.             __Instance = IntPtr.Zero;
  194.         }
  195.  
  196.         public int Event
  197.         {
  198.             get
  199.             {
  200.                 return ((global::Lua53.LuaDebug.__Internal*) __Instance)->@event;
  201.             }
  202.  
  203.             set
  204.             {
  205.                 ((global::Lua53.LuaDebug.__Internal*) __Instance)->@event = value;
  206.             }
  207.         }
  208.  
  209.         public string Name
  210.         {
  211.             get
  212.             {
  213.                 return Marshal.PtrToStringAnsi(((global::Lua53.LuaDebug.__Internal*) __Instance)->name);
  214.             }
  215.  
  216.             set
  217.             {
  218.                 ((global::Lua53.LuaDebug.__Internal*) __Instance)->name = Marshal.StringToHGlobalAnsi(value);
  219.             }
  220.         }
  221.  
  222.         public string Namewhat
  223.         {
  224.             get
  225.             {
  226.                 return Marshal.PtrToStringAnsi(((global::Lua53.LuaDebug.__Internal*) __Instance)->namewhat);
  227.             }
  228.  
  229.             set
  230.             {
  231.                 ((global::Lua53.LuaDebug.__Internal*) __Instance)->namewhat = Marshal.StringToHGlobalAnsi(value);
  232.             }
  233.         }
  234.  
  235.         public string What
  236.         {
  237.             get
  238.             {
  239.                 return Marshal.PtrToStringAnsi(((global::Lua53.LuaDebug.__Internal*) __Instance)->what);
  240.             }
  241.  
  242.             set
  243.             {
  244.                 ((global::Lua53.LuaDebug.__Internal*) __Instance)->what = Marshal.StringToHGlobalAnsi(value);
  245.             }
  246.         }
  247.  
  248.         public string Source
  249.         {
  250.             get
  251.             {
  252.                 return Marshal.PtrToStringAnsi(((global::Lua53.LuaDebug.__Internal*) __Instance)->source);
  253.             }
  254.  
  255.             set
  256.             {
  257.                 ((global::Lua53.LuaDebug.__Internal*) __Instance)->source = Marshal.StringToHGlobalAnsi(value);
  258.             }
  259.         }
  260.  
  261.         public int Currentline
  262.         {
  263.             get
  264.             {
  265.                 return ((global::Lua53.LuaDebug.__Internal*) __Instance)->currentline;
  266.             }
  267.  
  268.             set
  269.             {
  270.                 ((global::Lua53.LuaDebug.__Internal*) __Instance)->currentline = value;
  271.             }
  272.         }
  273.  
  274.         public int Linedefined
  275.         {
  276.             get
  277.             {
  278.                 return ((global::Lua53.LuaDebug.__Internal*) __Instance)->linedefined;
  279.             }
  280.  
  281.             set
  282.             {
  283.                 ((global::Lua53.LuaDebug.__Internal*) __Instance)->linedefined = value;
  284.             }
  285.         }
  286.  
  287.         public int Lastlinedefined
  288.         {
  289.             get
  290.             {
  291.                 return ((global::Lua53.LuaDebug.__Internal*) __Instance)->lastlinedefined;
  292.             }
  293.  
  294.             set
  295.             {
  296.                 ((global::Lua53.LuaDebug.__Internal*) __Instance)->lastlinedefined = value;
  297.             }
  298.         }
  299.  
  300.         public byte Nups
  301.         {
  302.             get
  303.             {
  304.                 return ((global::Lua53.LuaDebug.__Internal*) __Instance)->nups;
  305.             }
  306.  
  307.             set
  308.             {
  309.                 ((global::Lua53.LuaDebug.__Internal*) __Instance)->nups = value;
  310.             }
  311.         }
  312.  
  313.         public byte Nparams
  314.         {
  315.             get
  316.             {
  317.                 return ((global::Lua53.LuaDebug.__Internal*) __Instance)->nparams;
  318.             }
  319.  
  320.             set
  321.             {
  322.                 ((global::Lua53.LuaDebug.__Internal*) __Instance)->nparams = value;
  323.             }
  324.         }
  325.  
  326.         public char Isvararg
  327.         {
  328.             get
  329.             {
  330.                 return global::System.Convert.ToChar(((global::Lua53.LuaDebug.__Internal*) __Instance)->isvararg);
  331.             }
  332.  
  333.             set
  334.             {
  335.                 ((global::Lua53.LuaDebug.__Internal*) __Instance)->isvararg = global::System.Convert.ToSByte(value);
  336.             }
  337.         }
  338.  
  339.         public char Istailcall
  340.         {
  341.             get
  342.             {
  343.                 return global::System.Convert.ToChar(((global::Lua53.LuaDebug.__Internal*) __Instance)->istailcall);
  344.             }
  345.  
  346.             set
  347.             {
  348.                 ((global::Lua53.LuaDebug.__Internal*) __Instance)->istailcall = global::System.Convert.ToSByte(value);
  349.             }
  350.         }
  351.  
  352.         public char[] ShortSrc
  353.         {
  354.             get
  355.             {
  356.                 char[] __value = null;
  357.                 if (((global::Lua53.LuaDebug.__Internal*) __Instance)->short_src != null)
  358.                 {
  359.                     __value = new char[60];
  360.                     for (int i = 0; i < 60; i++)
  361.                         __value[i] = global::System.Convert.ToChar(((global::Lua53.LuaDebug.__Internal*) __Instance)->short_src[i]);
  362.                 }
  363.                 return __value;
  364.             }
  365.  
  366.             set
  367.             {
  368.                 if (value != null)
  369.                 {
  370.                     for (int i = 0; i < 60; i++)
  371.                         ((global::Lua53.LuaDebug.__Internal*) __Instance)->short_src[i] = global::System.Convert.ToSByte(value[i]);
  372.                 }
  373.             }
  374.         }
  375.  
  376.         public global::Lua53.CallInfo ICi
  377.         {
  378.             get
  379.             {
  380.                 global::Lua53.CallInfo __result0;
  381.                 if (((global::Lua53.LuaDebug.__Internal*) __Instance)->i_ci == IntPtr.Zero) __result0 = null;
  382.                 else if (global::Lua53.CallInfo.NativeToManagedMap.ContainsKey(((global::Lua53.LuaDebug.__Internal*) __Instance)->i_ci))
  383.                     __result0 = (global::Lua53.CallInfo) global::Lua53.CallInfo.NativeToManagedMap[((global::Lua53.LuaDebug.__Internal*) __Instance)->i_ci];
  384.                 else __result0 = global::Lua53.CallInfo.__CreateInstance(((global::Lua53.LuaDebug.__Internal*) __Instance)->i_ci);
  385.                 return __result0;
  386.             }
  387.  
  388.             set
  389.             {
  390.                 ((global::Lua53.LuaDebug.__Internal*) __Instance)->i_ci = ReferenceEquals(value, null) ? global::System.IntPtr.Zero : value.__Instance;
  391.             }
  392.         }
  393.     }
  394.  
  395.     public unsafe partial class CallInfo
  396.     {
  397.         public partial struct __Internal
  398.         {
  399.         }
  400.  
  401.         public global::System.IntPtr __Instance { get; protected set; }
  402.  
  403.         protected int __PointerAdjustment;
  404.         internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Lua53.CallInfo> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Lua53.CallInfo>();
  405.         protected void*[] __OriginalVTables;
  406.  
  407.         protected bool __ownsNativeInstance;
  408.  
  409.         internal static global::Lua53.CallInfo __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
  410.         {
  411.             return new global::Lua53.CallInfo(native.ToPointer(), skipVTables);
  412.         }
  413.  
  414.         internal static global::Lua53.CallInfo __CreateInstance(global::Lua53.CallInfo.__Internal native, bool skipVTables = false)
  415.         {
  416.             return new global::Lua53.CallInfo(native, skipVTables);
  417.         }
  418.  
  419.         private static void* __CopyValue(global::Lua53.CallInfo.__Internal native)
  420.         {
  421.             var ret = Marshal.AllocHGlobal(sizeof(global::Lua53.CallInfo.__Internal));
  422.             *(global::Lua53.CallInfo.__Internal*) ret = native;
  423.             return ret.ToPointer();
  424.         }
  425.  
  426.         private CallInfo(global::Lua53.CallInfo.__Internal native, bool skipVTables = false)
  427.             : this(__CopyValue(native), skipVTables)
  428.         {
  429.             __ownsNativeInstance = true;
  430.             NativeToManagedMap[__Instance] = this;
  431.         }
  432.  
  433.         protected CallInfo(void* native, bool skipVTables = false)
  434.         {
  435.             if (native == null)
  436.                 return;
  437.             __Instance = new global::System.IntPtr(native);
  438.         }
  439.  
  440.         ~CallInfo()
  441.         {
  442.             Dispose(false);
  443.         }
  444.     }
  445.  
  446.     public unsafe partial class lua
  447.     {
  448.         public partial struct __Internal
  449.         {
  450.             [SuppressUnmanagedCodeSecurity]
  451.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  452.                 EntryPoint="?lua_newstate@@YAPAUlua_State@@P6APAXPAX0II@Z0@Z")]
  453.             internal static extern global::System.IntPtr LuaNewstate(global::System.IntPtr f, global::System.IntPtr ud);
  454.  
  455.             [SuppressUnmanagedCodeSecurity]
  456.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  457.                 EntryPoint="?lua_close@@YAXPAUlua_State@@@Z")]
  458.             internal static extern void LuaClose(global::System.IntPtr L);
  459.  
  460.             [SuppressUnmanagedCodeSecurity]
  461.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  462.                 EntryPoint="?lua_newthread@@YAPAUlua_State@@PAU1@@Z")]
  463.             internal static extern global::System.IntPtr LuaNewthread(global::System.IntPtr L);
  464.  
  465.             [SuppressUnmanagedCodeSecurity]
  466.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  467.                 EntryPoint="?lua_atpanic@@YAP6AHPAUlua_State@@@Z0P6AH0@Z@Z")]
  468.             internal static extern global::System.IntPtr LuaAtpanic(global::System.IntPtr L, global::System.IntPtr panicf);
  469.  
  470.             [SuppressUnmanagedCodeSecurity]
  471.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  472.                 EntryPoint="?lua_version@@YAPBNPAUlua_State@@@Z")]
  473.             internal static extern double* LuaVersion(global::System.IntPtr L);
  474.  
  475.             [SuppressUnmanagedCodeSecurity]
  476.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  477.                 EntryPoint="?lua_absindex@@YAHPAUlua_State@@H@Z")]
  478.             internal static extern int LuaAbsindex(global::System.IntPtr L, int idx);
  479.  
  480.             [SuppressUnmanagedCodeSecurity]
  481.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  482.                 EntryPoint="?lua_gettop@@YAHPAUlua_State@@@Z")]
  483.             internal static extern int LuaGettop(global::System.IntPtr L);
  484.  
  485.             [SuppressUnmanagedCodeSecurity]
  486.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  487.                 EntryPoint="?lua_settop@@YAXPAUlua_State@@H@Z")]
  488.             internal static extern void LuaSettop(global::System.IntPtr L, int idx);
  489.  
  490.             [SuppressUnmanagedCodeSecurity]
  491.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  492.                 EntryPoint="?lua_pushvalue@@YAXPAUlua_State@@H@Z")]
  493.             internal static extern void LuaPushvalue(global::System.IntPtr L, int idx);
  494.  
  495.             [SuppressUnmanagedCodeSecurity]
  496.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  497.                 EntryPoint="?lua_rotate@@YAXPAUlua_State@@HH@Z")]
  498.             internal static extern void LuaRotate(global::System.IntPtr L, int idx, int n);
  499.  
  500.             [SuppressUnmanagedCodeSecurity]
  501.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  502.                 EntryPoint="?lua_copy@@YAXPAUlua_State@@HH@Z")]
  503.             internal static extern void LuaCopy(global::System.IntPtr L, int fromidx, int toidx);
  504.  
  505.             [SuppressUnmanagedCodeSecurity]
  506.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  507.                 EntryPoint="?lua_checkstack@@YAHPAUlua_State@@H@Z")]
  508.             internal static extern int LuaCheckstack(global::System.IntPtr L, int n);
  509.  
  510.             [SuppressUnmanagedCodeSecurity]
  511.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  512.                 EntryPoint="?lua_xmove@@YAXPAUlua_State@@0H@Z")]
  513.             internal static extern void LuaXmove(global::System.IntPtr from, global::System.IntPtr to, int n);
  514.  
  515.             [SuppressUnmanagedCodeSecurity]
  516.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  517.                 EntryPoint="?lua_isnumber@@YAHPAUlua_State@@H@Z")]
  518.             internal static extern int LuaIsnumber(global::System.IntPtr L, int idx);
  519.  
  520.             [SuppressUnmanagedCodeSecurity]
  521.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  522.                 EntryPoint="?lua_isstring@@YAHPAUlua_State@@H@Z")]
  523.             internal static extern int LuaIsstring(global::System.IntPtr L, int idx);
  524.  
  525.             [SuppressUnmanagedCodeSecurity]
  526.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  527.                 EntryPoint="?lua_iscfunction@@YAHPAUlua_State@@H@Z")]
  528.             internal static extern int LuaIscfunction(global::System.IntPtr L, int idx);
  529.  
  530.             [SuppressUnmanagedCodeSecurity]
  531.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  532.                 EntryPoint="?lua_isinteger@@YAHPAUlua_State@@H@Z")]
  533.             internal static extern int LuaIsinteger(global::System.IntPtr L, int idx);
  534.  
  535.             [SuppressUnmanagedCodeSecurity]
  536.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  537.                 EntryPoint="?lua_isuserdata@@YAHPAUlua_State@@H@Z")]
  538.             internal static extern int LuaIsuserdata(global::System.IntPtr L, int idx);
  539.  
  540.             [SuppressUnmanagedCodeSecurity]
  541.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  542.                 EntryPoint="?lua_type@@YAHPAUlua_State@@H@Z")]
  543.             internal static extern int LuaType(global::System.IntPtr L, int idx);
  544.  
  545.             [SuppressUnmanagedCodeSecurity]
  546.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  547.                 EntryPoint="?lua_typename@@YAPBDPAUlua_State@@H@Z")]
  548.             internal static extern global::System.IntPtr LuaTypename(global::System.IntPtr L, int tp);
  549.  
  550.             [SuppressUnmanagedCodeSecurity]
  551.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  552.                 EntryPoint="?lua_tonumberx@@YANPAUlua_State@@HPAH@Z")]
  553.             internal static extern double LuaTonumberx(global::System.IntPtr L, int idx, int* isnum);
  554.  
  555.             [SuppressUnmanagedCodeSecurity]
  556.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  557.                 EntryPoint="?lua_tointegerx@@YA_JPAUlua_State@@HPAH@Z")]
  558.             internal static extern long LuaTointegerx(global::System.IntPtr L, int idx, int* isnum);
  559.  
  560.             [SuppressUnmanagedCodeSecurity]
  561.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  562.                 EntryPoint="?lua_toboolean@@YAHPAUlua_State@@H@Z")]
  563.             internal static extern int LuaToboolean(global::System.IntPtr L, int idx);
  564.  
  565.             [SuppressUnmanagedCodeSecurity]
  566.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  567.                 EntryPoint="?lua_tolstring@@YAPBDPAUlua_State@@HPAI@Z")]
  568.             internal static extern global::System.IntPtr LuaTolstring(global::System.IntPtr L, int idx, uint* len);
  569.  
  570.             [SuppressUnmanagedCodeSecurity]
  571.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  572.                 EntryPoint="?lua_rawlen@@YAIPAUlua_State@@H@Z")]
  573.             internal static extern uint LuaRawlen(global::System.IntPtr L, int idx);
  574.  
  575.             [SuppressUnmanagedCodeSecurity]
  576.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  577.                 EntryPoint="?lua_tocfunction@@YAP6AHPAUlua_State@@@Z0H@Z")]
  578.             internal static extern global::System.IntPtr LuaTocfunction(global::System.IntPtr L, int idx);
  579.  
  580.             [SuppressUnmanagedCodeSecurity]
  581.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  582.                 EntryPoint="?lua_touserdata@@YAPAXPAUlua_State@@H@Z")]
  583.             internal static extern global::System.IntPtr LuaTouserdata(global::System.IntPtr L, int idx);
  584.  
  585.             [SuppressUnmanagedCodeSecurity]
  586.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  587.                 EntryPoint="?lua_tothread@@YAPAUlua_State@@PAU1@H@Z")]
  588.             internal static extern global::System.IntPtr LuaTothread(global::System.IntPtr L, int idx);
  589.  
  590.             [SuppressUnmanagedCodeSecurity]
  591.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  592.                 EntryPoint="?lua_topointer@@YAPBXPAUlua_State@@H@Z")]
  593.             internal static extern global::System.IntPtr LuaTopointer(global::System.IntPtr L, int idx);
  594.  
  595.             [SuppressUnmanagedCodeSecurity]
  596.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  597.                 EntryPoint="?lua_arith@@YAXPAUlua_State@@H@Z")]
  598.             internal static extern void LuaArith(global::System.IntPtr L, int op);
  599.  
  600.             [SuppressUnmanagedCodeSecurity]
  601.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  602.                 EntryPoint="?lua_rawequal@@YAHPAUlua_State@@HH@Z")]
  603.             internal static extern int LuaRawequal(global::System.IntPtr L, int idx1, int idx2);
  604.  
  605.             [SuppressUnmanagedCodeSecurity]
  606.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  607.                 EntryPoint="?lua_compare@@YAHPAUlua_State@@HHH@Z")]
  608.             internal static extern int LuaCompare(global::System.IntPtr L, int idx1, int idx2, int op);
  609.  
  610.             [SuppressUnmanagedCodeSecurity]
  611.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  612.                 EntryPoint="?lua_pushnil@@YAXPAUlua_State@@@Z")]
  613.             internal static extern void LuaPushnil(global::System.IntPtr L);
  614.  
  615.             [SuppressUnmanagedCodeSecurity]
  616.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  617.                 EntryPoint="?lua_pushnumber@@YAXPAUlua_State@@N@Z")]
  618.             internal static extern void LuaPushnumber(global::System.IntPtr L, double n);
  619.  
  620.             [SuppressUnmanagedCodeSecurity]
  621.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  622.                 EntryPoint="?lua_pushinteger@@YAXPAUlua_State@@_J@Z")]
  623.             internal static extern void LuaPushinteger(global::System.IntPtr L, long n);
  624.  
  625.             [SuppressUnmanagedCodeSecurity]
  626.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  627.                 EntryPoint="?lua_pushlstring@@YAPBDPAUlua_State@@PBDI@Z")]
  628.             internal static extern global::System.IntPtr LuaPushlstring(global::System.IntPtr L, [MarshalAs(UnmanagedType.LPStr)] string s, uint len);
  629.  
  630.             [SuppressUnmanagedCodeSecurity]
  631.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  632.                 EntryPoint="?lua_pushstring@@YAPBDPAUlua_State@@PBD@Z")]
  633.             internal static extern global::System.IntPtr LuaPushstring(global::System.IntPtr L, [MarshalAs(UnmanagedType.LPStr)] string s);
  634.  
  635.             [SuppressUnmanagedCodeSecurity]
  636.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  637.                 EntryPoint="?lua_pushfstring@@YAPBDPAUlua_State@@PBDZZ")]
  638.             internal static extern global::System.IntPtr LuaPushfstring(global::System.IntPtr L, [MarshalAs(UnmanagedType.LPStr)] string fmt);
  639.  
  640.             [SuppressUnmanagedCodeSecurity]
  641.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  642.                 EntryPoint="?lua_pushcclosure@@YAXPAUlua_State@@P6AH0@ZH@Z")]
  643.             internal static extern void LuaPushcclosure(global::System.IntPtr L, global::System.IntPtr fn, int n);
  644.  
  645.             [SuppressUnmanagedCodeSecurity]
  646.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  647.                 EntryPoint="?lua_pushboolean@@YAXPAUlua_State@@H@Z")]
  648.             internal static extern void LuaPushboolean(global::System.IntPtr L, int b);
  649.  
  650.             [SuppressUnmanagedCodeSecurity]
  651.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  652.                 EntryPoint="?lua_pushlightuserdata@@YAXPAUlua_State@@PAX@Z")]
  653.             internal static extern void LuaPushlightuserdata(global::System.IntPtr L, global::System.IntPtr p);
  654.  
  655.             [SuppressUnmanagedCodeSecurity]
  656.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  657.                 EntryPoint="?lua_pushthread@@YAHPAUlua_State@@@Z")]
  658.             internal static extern int LuaPushthread(global::System.IntPtr L);
  659.  
  660.             [SuppressUnmanagedCodeSecurity]
  661.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  662.                 EntryPoint="?lua_getglobal@@YAHPAUlua_State@@PBD@Z")]
  663.             internal static extern int LuaGetglobal(global::System.IntPtr L, [MarshalAs(UnmanagedType.LPStr)] string name);
  664.  
  665.             [SuppressUnmanagedCodeSecurity]
  666.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  667.                 EntryPoint="?lua_gettable@@YAHPAUlua_State@@H@Z")]
  668.             internal static extern int LuaGettable(global::System.IntPtr L, int idx);
  669.  
  670.             [SuppressUnmanagedCodeSecurity]
  671.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  672.                 EntryPoint="?lua_getfield@@YAHPAUlua_State@@HPBD@Z")]
  673.             internal static extern int LuaGetfield(global::System.IntPtr L, int idx, [MarshalAs(UnmanagedType.LPStr)] string k);
  674.  
  675.             [SuppressUnmanagedCodeSecurity]
  676.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  677.                 EntryPoint="?lua_geti@@YAHPAUlua_State@@H_J@Z")]
  678.             internal static extern int LuaGeti(global::System.IntPtr L, int idx, long n);
  679.  
  680.             [SuppressUnmanagedCodeSecurity]
  681.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  682.                 EntryPoint="?lua_rawget@@YAHPAUlua_State@@H@Z")]
  683.             internal static extern int LuaRawget(global::System.IntPtr L, int idx);
  684.  
  685.             [SuppressUnmanagedCodeSecurity]
  686.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  687.                 EntryPoint="?lua_rawgeti@@YAHPAUlua_State@@H_J@Z")]
  688.             internal static extern int LuaRawgeti(global::System.IntPtr L, int idx, long n);
  689.  
  690.             [SuppressUnmanagedCodeSecurity]
  691.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  692.                 EntryPoint="?lua_rawgetp@@YAHPAUlua_State@@HPBX@Z")]
  693.             internal static extern int LuaRawgetp(global::System.IntPtr L, int idx, global::System.IntPtr p);
  694.  
  695.             [SuppressUnmanagedCodeSecurity]
  696.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  697.                 EntryPoint="?lua_createtable@@YAXPAUlua_State@@HH@Z")]
  698.             internal static extern void LuaCreatetable(global::System.IntPtr L, int narr, int nrec);
  699.  
  700.             [SuppressUnmanagedCodeSecurity]
  701.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  702.                 EntryPoint="?lua_newuserdata@@YAPAXPAUlua_State@@I@Z")]
  703.             internal static extern global::System.IntPtr LuaNewuserdata(global::System.IntPtr L, uint sz);
  704.  
  705.             [SuppressUnmanagedCodeSecurity]
  706.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  707.                 EntryPoint="?lua_getmetatable@@YAHPAUlua_State@@H@Z")]
  708.             internal static extern int LuaGetmetatable(global::System.IntPtr L, int objindex);
  709.  
  710.             [SuppressUnmanagedCodeSecurity]
  711.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  712.                 EntryPoint="?lua_getuservalue@@YAHPAUlua_State@@H@Z")]
  713.             internal static extern int LuaGetuservalue(global::System.IntPtr L, int idx);
  714.  
  715.             [SuppressUnmanagedCodeSecurity]
  716.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  717.                 EntryPoint="?lua_setglobal@@YAXPAUlua_State@@PBD@Z")]
  718.             internal static extern void LuaSetglobal(global::System.IntPtr L, [MarshalAs(UnmanagedType.LPStr)] string name);
  719.  
  720.             [SuppressUnmanagedCodeSecurity]
  721.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  722.                 EntryPoint="?lua_settable@@YAXPAUlua_State@@H@Z")]
  723.             internal static extern void LuaSettable(global::System.IntPtr L, int idx);
  724.  
  725.             [SuppressUnmanagedCodeSecurity]
  726.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  727.                 EntryPoint="?lua_setfield@@YAXPAUlua_State@@HPBD@Z")]
  728.             internal static extern void LuaSetfield(global::System.IntPtr L, int idx, [MarshalAs(UnmanagedType.LPStr)] string k);
  729.  
  730.             [SuppressUnmanagedCodeSecurity]
  731.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  732.                 EntryPoint="?lua_seti@@YAXPAUlua_State@@H_J@Z")]
  733.             internal static extern void LuaSeti(global::System.IntPtr L, int idx, long n);
  734.  
  735.             [SuppressUnmanagedCodeSecurity]
  736.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  737.                 EntryPoint="?lua_rawset@@YAXPAUlua_State@@H@Z")]
  738.             internal static extern void LuaRawset(global::System.IntPtr L, int idx);
  739.  
  740.             [SuppressUnmanagedCodeSecurity]
  741.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  742.                 EntryPoint="?lua_rawseti@@YAXPAUlua_State@@H_J@Z")]
  743.             internal static extern void LuaRawseti(global::System.IntPtr L, int idx, long n);
  744.  
  745.             [SuppressUnmanagedCodeSecurity]
  746.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  747.                 EntryPoint="?lua_rawsetp@@YAXPAUlua_State@@HPBX@Z")]
  748.             internal static extern void LuaRawsetp(global::System.IntPtr L, int idx, global::System.IntPtr p);
  749.  
  750.             [SuppressUnmanagedCodeSecurity]
  751.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  752.                 EntryPoint="?lua_setmetatable@@YAHPAUlua_State@@H@Z")]
  753.             internal static extern int LuaSetmetatable(global::System.IntPtr L, int objindex);
  754.  
  755.             [SuppressUnmanagedCodeSecurity]
  756.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  757.                 EntryPoint="?lua_setuservalue@@YAXPAUlua_State@@H@Z")]
  758.             internal static extern void LuaSetuservalue(global::System.IntPtr L, int idx);
  759.  
  760.             [SuppressUnmanagedCodeSecurity]
  761.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  762.                 EntryPoint="?lua_callk@@YAXPAUlua_State@@HHHP6AH0HH@Z@Z")]
  763.             internal static extern void LuaCallk(global::System.IntPtr L, int nargs, int nresults, int ctx, global::System.IntPtr k);
  764.  
  765.             [SuppressUnmanagedCodeSecurity]
  766.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  767.                 EntryPoint="?lua_pcallk@@YAHPAUlua_State@@HHHHP6AH0HH@Z@Z")]
  768.             internal static extern int LuaPcallk(global::System.IntPtr L, int nargs, int nresults, int errfunc, int ctx, global::System.IntPtr k);
  769.  
  770.             [SuppressUnmanagedCodeSecurity]
  771.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  772.                 EntryPoint="?lua_load@@YAHPAUlua_State@@P6APBD0PAXPAI@Z1PBD4@Z")]
  773.             internal static extern int LuaLoad(global::System.IntPtr L, global::System.IntPtr reader, global::System.IntPtr dt, [MarshalAs(UnmanagedType.LPStr)] string chunkname, [MarshalAs(UnmanagedType.LPStr)] string mode);
  774.  
  775.             [SuppressUnmanagedCodeSecurity]
  776.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  777.                 EntryPoint="?lua_dump@@YAHPAUlua_State@@P6AH0PBXIPAX@Z2H@Z")]
  778.             internal static extern int LuaDump(global::System.IntPtr L, global::System.IntPtr writer, global::System.IntPtr data, int strip);
  779.  
  780.             [SuppressUnmanagedCodeSecurity]
  781.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  782.                 EntryPoint="?lua_yieldk@@YAHPAUlua_State@@HHP6AH0HH@Z@Z")]
  783.             internal static extern int LuaYieldk(global::System.IntPtr L, int nresults, int ctx, global::System.IntPtr k);
  784.  
  785.             [SuppressUnmanagedCodeSecurity]
  786.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  787.                 EntryPoint="?lua_resume@@YAHPAUlua_State@@0H@Z")]
  788.             internal static extern int LuaResume(global::System.IntPtr L, global::System.IntPtr from, int narg);
  789.  
  790.             [SuppressUnmanagedCodeSecurity]
  791.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  792.                 EntryPoint="?lua_status@@YAHPAUlua_State@@@Z")]
  793.             internal static extern int LuaStatus(global::System.IntPtr L);
  794.  
  795.             [SuppressUnmanagedCodeSecurity]
  796.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  797.                 EntryPoint="?lua_isyieldable@@YAHPAUlua_State@@@Z")]
  798.             internal static extern int LuaIsyieldable(global::System.IntPtr L);
  799.  
  800.             [SuppressUnmanagedCodeSecurity]
  801.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  802.                 EntryPoint="?lua_gc@@YAHPAUlua_State@@HH@Z")]
  803.             internal static extern int LuaGc(global::System.IntPtr L, int what, int data);
  804.  
  805.             [SuppressUnmanagedCodeSecurity]
  806.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  807.                 EntryPoint="?lua_error@@YAHPAUlua_State@@@Z")]
  808.             internal static extern int LuaError(global::System.IntPtr L);
  809.  
  810.             [SuppressUnmanagedCodeSecurity]
  811.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  812.                 EntryPoint="?lua_next@@YAHPAUlua_State@@H@Z")]
  813.             internal static extern int LuaNext(global::System.IntPtr L, int idx);
  814.  
  815.             [SuppressUnmanagedCodeSecurity]
  816.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  817.                 EntryPoint="?lua_concat@@YAXPAUlua_State@@H@Z")]
  818.             internal static extern void LuaConcat(global::System.IntPtr L, int n);
  819.  
  820.             [SuppressUnmanagedCodeSecurity]
  821.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  822.                 EntryPoint="?lua_len@@YAXPAUlua_State@@H@Z")]
  823.             internal static extern void LuaLen(global::System.IntPtr L, int idx);
  824.  
  825.             [SuppressUnmanagedCodeSecurity]
  826.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  827.                 EntryPoint="?lua_stringtonumber@@YAIPAUlua_State@@PBD@Z")]
  828.             internal static extern uint LuaStringtonumber(global::System.IntPtr L, [MarshalAs(UnmanagedType.LPStr)] string s);
  829.  
  830.             [SuppressUnmanagedCodeSecurity]
  831.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  832.                 EntryPoint="?lua_getallocf@@YAP6APAXPAX0II@ZPAUlua_State@@PAPAX@Z")]
  833.             internal static extern global::System.IntPtr LuaGetallocf(global::System.IntPtr L, void** ud);
  834.  
  835.             [SuppressUnmanagedCodeSecurity]
  836.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  837.                 EntryPoint="?lua_setallocf@@YAXPAUlua_State@@P6APAXPAX1II@Z1@Z")]
  838.             internal static extern void LuaSetallocf(global::System.IntPtr L, global::System.IntPtr f, global::System.IntPtr ud);
  839.  
  840.             [SuppressUnmanagedCodeSecurity]
  841.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  842.                 EntryPoint="?lua_getstack@@YAHPAUlua_State@@HPAUlua_Debug@@@Z")]
  843.             internal static extern int LuaGetstack(global::System.IntPtr L, int level, global::System.IntPtr ar);
  844.  
  845.             [SuppressUnmanagedCodeSecurity]
  846.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  847.                 EntryPoint="?lua_getinfo@@YAHPAUlua_State@@PBDPAUlua_Debug@@@Z")]
  848.             internal static extern int LuaGetinfo(global::System.IntPtr L, [MarshalAs(UnmanagedType.LPStr)] string what, global::System.IntPtr ar);
  849.  
  850.             [SuppressUnmanagedCodeSecurity]
  851.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  852.                 EntryPoint="?lua_getlocal@@YAPBDPAUlua_State@@PBUlua_Debug@@H@Z")]
  853.             internal static extern global::System.IntPtr LuaGetlocal(global::System.IntPtr L, global::System.IntPtr ar, int n);
  854.  
  855.             [SuppressUnmanagedCodeSecurity]
  856.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  857.                 EntryPoint="?lua_setlocal@@YAPBDPAUlua_State@@PBUlua_Debug@@H@Z")]
  858.             internal static extern global::System.IntPtr LuaSetlocal(global::System.IntPtr L, global::System.IntPtr ar, int n);
  859.  
  860.             [SuppressUnmanagedCodeSecurity]
  861.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  862.                 EntryPoint="?lua_getupvalue@@YAPBDPAUlua_State@@HH@Z")]
  863.             internal static extern global::System.IntPtr LuaGetupvalue(global::System.IntPtr L, int funcindex, int n);
  864.  
  865.             [SuppressUnmanagedCodeSecurity]
  866.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  867.                 EntryPoint="?lua_setupvalue@@YAPBDPAUlua_State@@HH@Z")]
  868.             internal static extern global::System.IntPtr LuaSetupvalue(global::System.IntPtr L, int funcindex, int n);
  869.  
  870.             [SuppressUnmanagedCodeSecurity]
  871.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  872.                 EntryPoint="?lua_upvalueid@@YAPAXPAUlua_State@@HH@Z")]
  873.             internal static extern global::System.IntPtr LuaUpvalueid(global::System.IntPtr L, int fidx, int n);
  874.  
  875.             [SuppressUnmanagedCodeSecurity]
  876.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  877.                 EntryPoint="?lua_upvaluejoin@@YAXPAUlua_State@@HHHH@Z")]
  878.             internal static extern void LuaUpvaluejoin(global::System.IntPtr L, int fidx1, int n1, int fidx2, int n2);
  879.  
  880.             [SuppressUnmanagedCodeSecurity]
  881.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  882.                 EntryPoint="?lua_sethook@@YAXPAUlua_State@@P6AX0PAUlua_Debug@@@ZHH@Z")]
  883.             internal static extern void LuaSethook(global::System.IntPtr L, global::System.IntPtr func, int mask, int count);
  884.  
  885.             [SuppressUnmanagedCodeSecurity]
  886.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  887.                 EntryPoint="?lua_gethook@@YAP6AXPAUlua_State@@PAUlua_Debug@@@Z0@Z")]
  888.             internal static extern global::System.IntPtr LuaGethook(global::System.IntPtr L);
  889.  
  890.             [SuppressUnmanagedCodeSecurity]
  891.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  892.                 EntryPoint="?lua_gethookmask@@YAHPAUlua_State@@@Z")]
  893.             internal static extern int LuaGethookmask(global::System.IntPtr L);
  894.  
  895.             [SuppressUnmanagedCodeSecurity]
  896.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  897.                 EntryPoint="?lua_gethookcount@@YAHPAUlua_State@@@Z")]
  898.             internal static extern int LuaGethookcount(global::System.IntPtr L);
  899.         }
  900.  
  901.         public static global::Lua53.LuaState LuaNewstate(global::Lua53.LuaAlloc f, global::System.IntPtr ud)
  902.         {
  903.             var __arg0 = f == null ? global::System.IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(f);
  904.             var __ret = __Internal.LuaNewstate(__arg0, ud);
  905.             global::Lua53.LuaState __result0;
  906.             if (__ret == IntPtr.Zero) __result0 = null;
  907.             else if (global::Lua53.LuaState.NativeToManagedMap.ContainsKey(__ret))
  908.                 __result0 = (global::Lua53.LuaState) global::Lua53.LuaState.NativeToManagedMap[__ret];
  909.             else __result0 = global::Lua53.LuaState.__CreateInstance(__ret);
  910.             return __result0;
  911.         }
  912.  
  913.         public static void LuaClose(global::Lua53.LuaState L)
  914.         {
  915.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  916.             __Internal.LuaClose(__arg0);
  917.         }
  918.  
  919.         public static global::Lua53.LuaState LuaNewthread(global::Lua53.LuaState L)
  920.         {
  921.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  922.             var __ret = __Internal.LuaNewthread(__arg0);
  923.             global::Lua53.LuaState __result0;
  924.             if (__ret == IntPtr.Zero) __result0 = null;
  925.             else if (global::Lua53.LuaState.NativeToManagedMap.ContainsKey(__ret))
  926.                 __result0 = (global::Lua53.LuaState) global::Lua53.LuaState.NativeToManagedMap[__ret];
  927.             else __result0 = global::Lua53.LuaState.__CreateInstance(__ret);
  928.             return __result0;
  929.         }
  930.  
  931.         public static global::Lua53.LuaCFunction LuaAtpanic(global::Lua53.LuaState L, global::Lua53.LuaCFunction panicf)
  932.         {
  933.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  934.             var __arg1 = panicf == null ? global::System.IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(panicf);
  935.             var __ret = __Internal.LuaAtpanic(__arg0, __arg1);
  936.             var __ptr0 = __ret;
  937.             return __ptr0 == IntPtr.Zero? null : (global::Lua53.LuaCFunction) Marshal.GetDelegateForFunctionPointer(__ptr0, typeof(global::Lua53.LuaCFunction));
  938.         }
  939.  
  940.         public static double* LuaVersion(global::Lua53.LuaState L)
  941.         {
  942.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  943.             var __ret = __Internal.LuaVersion(__arg0);
  944.             return __ret;
  945.         }
  946.  
  947.         public static int LuaAbsindex(global::Lua53.LuaState L, int idx)
  948.         {
  949.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  950.             var __ret = __Internal.LuaAbsindex(__arg0, idx);
  951.             return __ret;
  952.         }
  953.  
  954.         public static int LuaGettop(global::Lua53.LuaState L)
  955.         {
  956.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  957.             var __ret = __Internal.LuaGettop(__arg0);
  958.             return __ret;
  959.         }
  960.  
  961.         public static void LuaSettop(global::Lua53.LuaState L, int idx)
  962.         {
  963.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  964.             __Internal.LuaSettop(__arg0, idx);
  965.         }
  966.  
  967.         public static void LuaPushvalue(global::Lua53.LuaState L, int idx)
  968.         {
  969.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  970.             __Internal.LuaPushvalue(__arg0, idx);
  971.         }
  972.  
  973.         public static void LuaRotate(global::Lua53.LuaState L, int idx, int n)
  974.         {
  975.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  976.             __Internal.LuaRotate(__arg0, idx, n);
  977.         }
  978.  
  979.         public static void LuaCopy(global::Lua53.LuaState L, int fromidx, int toidx)
  980.         {
  981.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  982.             __Internal.LuaCopy(__arg0, fromidx, toidx);
  983.         }
  984.  
  985.         public static int LuaCheckstack(global::Lua53.LuaState L, int n)
  986.         {
  987.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  988.             var __ret = __Internal.LuaCheckstack(__arg0, n);
  989.             return __ret;
  990.         }
  991.  
  992.         public static void LuaXmove(global::Lua53.LuaState from, global::Lua53.LuaState to, int n)
  993.         {
  994.             var __arg0 = ReferenceEquals(from, null) ? global::System.IntPtr.Zero : from.__Instance;
  995.             var __arg1 = ReferenceEquals(to, null) ? global::System.IntPtr.Zero : to.__Instance;
  996.             __Internal.LuaXmove(__arg0, __arg1, n);
  997.         }
  998.  
  999.         public static int LuaIsnumber(global::Lua53.LuaState L, int idx)
  1000.         {
  1001.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1002.             var __ret = __Internal.LuaIsnumber(__arg0, idx);
  1003.             return __ret;
  1004.         }
  1005.  
  1006.         public static int LuaIsstring(global::Lua53.LuaState L, int idx)
  1007.         {
  1008.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1009.             var __ret = __Internal.LuaIsstring(__arg0, idx);
  1010.             return __ret;
  1011.         }
  1012.  
  1013.         public static int LuaIscfunction(global::Lua53.LuaState L, int idx)
  1014.         {
  1015.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1016.             var __ret = __Internal.LuaIscfunction(__arg0, idx);
  1017.             return __ret;
  1018.         }
  1019.  
  1020.         public static int LuaIsinteger(global::Lua53.LuaState L, int idx)
  1021.         {
  1022.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1023.             var __ret = __Internal.LuaIsinteger(__arg0, idx);
  1024.             return __ret;
  1025.         }
  1026.  
  1027.         public static int LuaIsuserdata(global::Lua53.LuaState L, int idx)
  1028.         {
  1029.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1030.             var __ret = __Internal.LuaIsuserdata(__arg0, idx);
  1031.             return __ret;
  1032.         }
  1033.  
  1034.         public static int LuaType(global::Lua53.LuaState L, int idx)
  1035.         {
  1036.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1037.             var __ret = __Internal.LuaType(__arg0, idx);
  1038.             return __ret;
  1039.         }
  1040.  
  1041.         public static string LuaTypename(global::Lua53.LuaState L, int tp)
  1042.         {
  1043.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1044.             var __ret = __Internal.LuaTypename(__arg0, tp);
  1045.             return Marshal.PtrToStringAnsi(__ret);
  1046.         }
  1047.  
  1048.         public static double LuaTonumberx(global::Lua53.LuaState L, int idx, ref int isnum)
  1049.         {
  1050.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1051.             fixed (int* __refParamPtr2 = &isnum)
  1052.             {
  1053.                 var __arg2 = __refParamPtr2;
  1054.                 var __ret = __Internal.LuaTonumberx(__arg0, idx, __arg2);
  1055.                 return __ret;
  1056.             }
  1057.         }
  1058.  
  1059.         public static long LuaTointegerx(global::Lua53.LuaState L, int idx, ref int isnum)
  1060.         {
  1061.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1062.             fixed (int* __refParamPtr2 = &isnum)
  1063.             {
  1064.                 var __arg2 = __refParamPtr2;
  1065.                 var __ret = __Internal.LuaTointegerx(__arg0, idx, __arg2);
  1066.                 return __ret;
  1067.             }
  1068.         }
  1069.  
  1070.         public static int LuaToboolean(global::Lua53.LuaState L, int idx)
  1071.         {
  1072.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1073.             var __ret = __Internal.LuaToboolean(__arg0, idx);
  1074.             return __ret;
  1075.         }
  1076.  
  1077.         public static string LuaTolstring(global::Lua53.LuaState L, int idx, ref uint len)
  1078.         {
  1079.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1080.             fixed (uint* __refParamPtr2 = &len)
  1081.             {
  1082.                 var __arg2 = __refParamPtr2;
  1083.                 var __ret = __Internal.LuaTolstring(__arg0, idx, __arg2);
  1084.                 return Marshal.PtrToStringAnsi(__ret);
  1085.             }
  1086.         }
  1087.  
  1088.         public static uint LuaRawlen(global::Lua53.LuaState L, int idx)
  1089.         {
  1090.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1091.             var __ret = __Internal.LuaRawlen(__arg0, idx);
  1092.             return __ret;
  1093.         }
  1094.  
  1095.         public static global::Lua53.LuaCFunction LuaTocfunction(global::Lua53.LuaState L, int idx)
  1096.         {
  1097.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1098.             var __ret = __Internal.LuaTocfunction(__arg0, idx);
  1099.             var __ptr0 = __ret;
  1100.             return __ptr0 == IntPtr.Zero? null : (global::Lua53.LuaCFunction) Marshal.GetDelegateForFunctionPointer(__ptr0, typeof(global::Lua53.LuaCFunction));
  1101.         }
  1102.  
  1103.         public static global::System.IntPtr LuaTouserdata(global::Lua53.LuaState L, int idx)
  1104.         {
  1105.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1106.             var __ret = __Internal.LuaTouserdata(__arg0, idx);
  1107.             return __ret;
  1108.         }
  1109.  
  1110.         public static global::Lua53.LuaState LuaTothread(global::Lua53.LuaState L, int idx)
  1111.         {
  1112.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1113.             var __ret = __Internal.LuaTothread(__arg0, idx);
  1114.             global::Lua53.LuaState __result0;
  1115.             if (__ret == IntPtr.Zero) __result0 = null;
  1116.             else if (global::Lua53.LuaState.NativeToManagedMap.ContainsKey(__ret))
  1117.                 __result0 = (global::Lua53.LuaState) global::Lua53.LuaState.NativeToManagedMap[__ret];
  1118.             else __result0 = global::Lua53.LuaState.__CreateInstance(__ret);
  1119.             return __result0;
  1120.         }
  1121.  
  1122.         public static global::System.IntPtr LuaTopointer(global::Lua53.LuaState L, int idx)
  1123.         {
  1124.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1125.             var __ret = __Internal.LuaTopointer(__arg0, idx);
  1126.             return __ret;
  1127.         }
  1128.  
  1129.         public static void LuaArith(global::Lua53.LuaState L, int op)
  1130.         {
  1131.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1132.             __Internal.LuaArith(__arg0, op);
  1133.         }
  1134.  
  1135.         public static int LuaRawequal(global::Lua53.LuaState L, int idx1, int idx2)
  1136.         {
  1137.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1138.             var __ret = __Internal.LuaRawequal(__arg0, idx1, idx2);
  1139.             return __ret;
  1140.         }
  1141.  
  1142.         public static int LuaCompare(global::Lua53.LuaState L, int idx1, int idx2, int op)
  1143.         {
  1144.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1145.             var __ret = __Internal.LuaCompare(__arg0, idx1, idx2, op);
  1146.             return __ret;
  1147.         }
  1148.  
  1149.         public static void LuaPushnil(global::Lua53.LuaState L)
  1150.         {
  1151.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1152.             __Internal.LuaPushnil(__arg0);
  1153.         }
  1154.  
  1155.         public static void LuaPushnumber(global::Lua53.LuaState L, double n)
  1156.         {
  1157.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1158.             __Internal.LuaPushnumber(__arg0, n);
  1159.         }
  1160.  
  1161.         public static void LuaPushinteger(global::Lua53.LuaState L, long n)
  1162.         {
  1163.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1164.             __Internal.LuaPushinteger(__arg0, n);
  1165.         }
  1166.  
  1167.         public static string LuaPushlstring(global::Lua53.LuaState L, string s, uint len)
  1168.         {
  1169.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1170.             var __ret = __Internal.LuaPushlstring(__arg0, s, len);
  1171.             return Marshal.PtrToStringAnsi(__ret);
  1172.         }
  1173.  
  1174.         public static string LuaPushstring(global::Lua53.LuaState L, string s)
  1175.         {
  1176.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1177.             var __ret = __Internal.LuaPushstring(__arg0, s);
  1178.             return Marshal.PtrToStringAnsi(__ret);
  1179.         }
  1180.  
  1181.         public static string LuaPushfstring(global::Lua53.LuaState L, string fmt)
  1182.         {
  1183.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1184.             var __ret = __Internal.LuaPushfstring(__arg0, fmt);
  1185.             return Marshal.PtrToStringAnsi(__ret);
  1186.         }
  1187.  
  1188.         public static void LuaPushcclosure(global::Lua53.LuaState L, global::Lua53.LuaCFunction fn, int n)
  1189.         {
  1190.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1191.             var __arg1 = fn == null ? global::System.IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(fn);
  1192.             __Internal.LuaPushcclosure(__arg0, __arg1, n);
  1193.         }
  1194.  
  1195.         public static void LuaPushboolean(global::Lua53.LuaState L, int b)
  1196.         {
  1197.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1198.             __Internal.LuaPushboolean(__arg0, b);
  1199.         }
  1200.  
  1201.         public static void LuaPushlightuserdata(global::Lua53.LuaState L, global::System.IntPtr p)
  1202.         {
  1203.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1204.             __Internal.LuaPushlightuserdata(__arg0, p);
  1205.         }
  1206.  
  1207.         public static int LuaPushthread(global::Lua53.LuaState L)
  1208.         {
  1209.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1210.             var __ret = __Internal.LuaPushthread(__arg0);
  1211.             return __ret;
  1212.         }
  1213.  
  1214.         public static int LuaGetglobal(global::Lua53.LuaState L, string name)
  1215.         {
  1216.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1217.             var __ret = __Internal.LuaGetglobal(__arg0, name);
  1218.             return __ret;
  1219.         }
  1220.  
  1221.         public static int LuaGettable(global::Lua53.LuaState L, int idx)
  1222.         {
  1223.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1224.             var __ret = __Internal.LuaGettable(__arg0, idx);
  1225.             return __ret;
  1226.         }
  1227.  
  1228.         public static int LuaGetfield(global::Lua53.LuaState L, int idx, string k)
  1229.         {
  1230.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1231.             var __ret = __Internal.LuaGetfield(__arg0, idx, k);
  1232.             return __ret;
  1233.         }
  1234.  
  1235.         public static int LuaGeti(global::Lua53.LuaState L, int idx, long n)
  1236.         {
  1237.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1238.             var __ret = __Internal.LuaGeti(__arg0, idx, n);
  1239.             return __ret;
  1240.         }
  1241.  
  1242.         public static int LuaRawget(global::Lua53.LuaState L, int idx)
  1243.         {
  1244.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1245.             var __ret = __Internal.LuaRawget(__arg0, idx);
  1246.             return __ret;
  1247.         }
  1248.  
  1249.         public static int LuaRawgeti(global::Lua53.LuaState L, int idx, long n)
  1250.         {
  1251.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1252.             var __ret = __Internal.LuaRawgeti(__arg0, idx, n);
  1253.             return __ret;
  1254.         }
  1255.  
  1256.         public static int LuaRawgetp(global::Lua53.LuaState L, int idx, global::System.IntPtr p)
  1257.         {
  1258.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1259.             var __ret = __Internal.LuaRawgetp(__arg0, idx, p);
  1260.             return __ret;
  1261.         }
  1262.  
  1263.         public static void LuaCreatetable(global::Lua53.LuaState L, int narr, int nrec)
  1264.         {
  1265.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1266.             __Internal.LuaCreatetable(__arg0, narr, nrec);
  1267.         }
  1268.  
  1269.         public static global::System.IntPtr LuaNewuserdata(global::Lua53.LuaState L, uint sz)
  1270.         {
  1271.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1272.             var __ret = __Internal.LuaNewuserdata(__arg0, sz);
  1273.             return __ret;
  1274.         }
  1275.  
  1276.         public static int LuaGetmetatable(global::Lua53.LuaState L, int objindex)
  1277.         {
  1278.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1279.             var __ret = __Internal.LuaGetmetatable(__arg0, objindex);
  1280.             return __ret;
  1281.         }
  1282.  
  1283.         public static int LuaGetuservalue(global::Lua53.LuaState L, int idx)
  1284.         {
  1285.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1286.             var __ret = __Internal.LuaGetuservalue(__arg0, idx);
  1287.             return __ret;
  1288.         }
  1289.  
  1290.         public static void LuaSetglobal(global::Lua53.LuaState L, string name)
  1291.         {
  1292.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1293.             __Internal.LuaSetglobal(__arg0, name);
  1294.         }
  1295.  
  1296.         public static void LuaSettable(global::Lua53.LuaState L, int idx)
  1297.         {
  1298.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1299.             __Internal.LuaSettable(__arg0, idx);
  1300.         }
  1301.  
  1302.         public static void LuaSetfield(global::Lua53.LuaState L, int idx, string k)
  1303.         {
  1304.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1305.             __Internal.LuaSetfield(__arg0, idx, k);
  1306.         }
  1307.  
  1308.         public static void LuaSeti(global::Lua53.LuaState L, int idx, long n)
  1309.         {
  1310.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1311.             __Internal.LuaSeti(__arg0, idx, n);
  1312.         }
  1313.  
  1314.         public static void LuaRawset(global::Lua53.LuaState L, int idx)
  1315.         {
  1316.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1317.             __Internal.LuaRawset(__arg0, idx);
  1318.         }
  1319.  
  1320.         public static void LuaRawseti(global::Lua53.LuaState L, int idx, long n)
  1321.         {
  1322.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1323.             __Internal.LuaRawseti(__arg0, idx, n);
  1324.         }
  1325.  
  1326.         public static void LuaRawsetp(global::Lua53.LuaState L, int idx, global::System.IntPtr p)
  1327.         {
  1328.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1329.             __Internal.LuaRawsetp(__arg0, idx, p);
  1330.         }
  1331.  
  1332.         public static int LuaSetmetatable(global::Lua53.LuaState L, int objindex)
  1333.         {
  1334.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1335.             var __ret = __Internal.LuaSetmetatable(__arg0, objindex);
  1336.             return __ret;
  1337.         }
  1338.  
  1339.         public static void LuaSetuservalue(global::Lua53.LuaState L, int idx)
  1340.         {
  1341.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1342.             __Internal.LuaSetuservalue(__arg0, idx);
  1343.         }
  1344.  
  1345.         public static void LuaCallk(global::Lua53.LuaState L, int nargs, int nresults, int ctx, global::Lua53.LuaKFunction k)
  1346.         {
  1347.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1348.             var __arg4 = k == null ? global::System.IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(k);
  1349.             __Internal.LuaCallk(__arg0, nargs, nresults, ctx, __arg4);
  1350.         }
  1351.  
  1352.         public static int LuaPcallk(global::Lua53.LuaState L, int nargs, int nresults, int errfunc, int ctx, global::Lua53.LuaKFunction k)
  1353.         {
  1354.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1355.             var __arg5 = k == null ? global::System.IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(k);
  1356.             var __ret = __Internal.LuaPcallk(__arg0, nargs, nresults, errfunc, ctx, __arg5);
  1357.             return __ret;
  1358.         }
  1359.  
  1360.         public static int LuaLoad(global::Lua53.LuaState L, global::Lua53.LuaReader reader, global::System.IntPtr dt, string chunkname, string mode)
  1361.         {
  1362.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1363.             var __arg1 = reader == null ? global::System.IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(reader);
  1364.             var __ret = __Internal.LuaLoad(__arg0, __arg1, dt, chunkname, mode);
  1365.             return __ret;
  1366.         }
  1367.  
  1368.         public static int LuaDump(global::Lua53.LuaState L, global::Lua53.LuaWriter writer, global::System.IntPtr data, int strip)
  1369.         {
  1370.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1371.             var __arg1 = writer == null ? global::System.IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(writer);
  1372.             var __ret = __Internal.LuaDump(__arg0, __arg1, data, strip);
  1373.             return __ret;
  1374.         }
  1375.  
  1376.         public static int LuaYieldk(global::Lua53.LuaState L, int nresults, int ctx, global::Lua53.LuaKFunction k)
  1377.         {
  1378.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1379.             var __arg3 = k == null ? global::System.IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(k);
  1380.             var __ret = __Internal.LuaYieldk(__arg0, nresults, ctx, __arg3);
  1381.             return __ret;
  1382.         }
  1383.  
  1384.         public static int LuaResume(global::Lua53.LuaState L, global::Lua53.LuaState from, int narg)
  1385.         {
  1386.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1387.             var __arg1 = ReferenceEquals(from, null) ? global::System.IntPtr.Zero : from.__Instance;
  1388.             var __ret = __Internal.LuaResume(__arg0, __arg1, narg);
  1389.             return __ret;
  1390.         }
  1391.  
  1392.         public static int LuaStatus(global::Lua53.LuaState L)
  1393.         {
  1394.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1395.             var __ret = __Internal.LuaStatus(__arg0);
  1396.             return __ret;
  1397.         }
  1398.  
  1399.         public static int LuaIsyieldable(global::Lua53.LuaState L)
  1400.         {
  1401.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1402.             var __ret = __Internal.LuaIsyieldable(__arg0);
  1403.             return __ret;
  1404.         }
  1405.  
  1406.         public static int LuaGc(global::Lua53.LuaState L, int what, int data)
  1407.         {
  1408.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1409.             var __ret = __Internal.LuaGc(__arg0, what, data);
  1410.             return __ret;
  1411.         }
  1412.  
  1413.         public static int LuaError(global::Lua53.LuaState L)
  1414.         {
  1415.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1416.             var __ret = __Internal.LuaError(__arg0);
  1417.             return __ret;
  1418.         }
  1419.  
  1420.         public static int LuaNext(global::Lua53.LuaState L, int idx)
  1421.         {
  1422.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1423.             var __ret = __Internal.LuaNext(__arg0, idx);
  1424.             return __ret;
  1425.         }
  1426.  
  1427.         public static void LuaConcat(global::Lua53.LuaState L, int n)
  1428.         {
  1429.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1430.             __Internal.LuaConcat(__arg0, n);
  1431.         }
  1432.  
  1433.         public static void LuaLen(global::Lua53.LuaState L, int idx)
  1434.         {
  1435.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1436.             __Internal.LuaLen(__arg0, idx);
  1437.         }
  1438.  
  1439.         public static uint LuaStringtonumber(global::Lua53.LuaState L, string s)
  1440.         {
  1441.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1442.             var __ret = __Internal.LuaStringtonumber(__arg0, s);
  1443.             return __ret;
  1444.         }
  1445.  
  1446.         public static global::Lua53.LuaAlloc LuaGetallocf(global::Lua53.LuaState L, void** ud)
  1447.         {
  1448.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1449.             var __ret = __Internal.LuaGetallocf(__arg0, ud);
  1450.             var __ptr0 = __ret;
  1451.             return __ptr0 == IntPtr.Zero? null : (global::Lua53.LuaAlloc) Marshal.GetDelegateForFunctionPointer(__ptr0, typeof(global::Lua53.LuaAlloc));
  1452.         }
  1453.  
  1454.         public static void LuaSetallocf(global::Lua53.LuaState L, global::Lua53.LuaAlloc f, global::System.IntPtr ud)
  1455.         {
  1456.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1457.             var __arg1 = f == null ? global::System.IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(f);
  1458.             __Internal.LuaSetallocf(__arg0, __arg1, ud);
  1459.         }
  1460.  
  1461.         public static int LuaGetstack(global::Lua53.LuaState L, int level, global::Lua53.LuaDebug ar)
  1462.         {
  1463.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1464.             var __arg2 = ReferenceEquals(ar, null) ? global::System.IntPtr.Zero : ar.__Instance;
  1465.             var __ret = __Internal.LuaGetstack(__arg0, level, __arg2);
  1466.             return __ret;
  1467.         }
  1468.  
  1469.         public static int LuaGetinfo(global::Lua53.LuaState L, string what, global::Lua53.LuaDebug ar)
  1470.         {
  1471.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1472.             var __arg2 = ReferenceEquals(ar, null) ? global::System.IntPtr.Zero : ar.__Instance;
  1473.             var __ret = __Internal.LuaGetinfo(__arg0, what, __arg2);
  1474.             return __ret;
  1475.         }
  1476.  
  1477.         public static string LuaGetlocal(global::Lua53.LuaState L, global::Lua53.LuaDebug ar, int n)
  1478.         {
  1479.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1480.             var __arg1 = ReferenceEquals(ar, null) ? global::System.IntPtr.Zero : ar.__Instance;
  1481.             var __ret = __Internal.LuaGetlocal(__arg0, __arg1, n);
  1482.             return Marshal.PtrToStringAnsi(__ret);
  1483.         }
  1484.  
  1485.         public static string LuaSetlocal(global::Lua53.LuaState L, global::Lua53.LuaDebug ar, int n)
  1486.         {
  1487.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1488.             var __arg1 = ReferenceEquals(ar, null) ? global::System.IntPtr.Zero : ar.__Instance;
  1489.             var __ret = __Internal.LuaSetlocal(__arg0, __arg1, n);
  1490.             return Marshal.PtrToStringAnsi(__ret);
  1491.         }
  1492.  
  1493.         public static string LuaGetupvalue(global::Lua53.LuaState L, int funcindex, int n)
  1494.         {
  1495.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1496.             var __ret = __Internal.LuaGetupvalue(__arg0, funcindex, n);
  1497.             return Marshal.PtrToStringAnsi(__ret);
  1498.         }
  1499.  
  1500.         public static string LuaSetupvalue(global::Lua53.LuaState L, int funcindex, int n)
  1501.         {
  1502.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1503.             var __ret = __Internal.LuaSetupvalue(__arg0, funcindex, n);
  1504.             return Marshal.PtrToStringAnsi(__ret);
  1505.         }
  1506.  
  1507.         public static global::System.IntPtr LuaUpvalueid(global::Lua53.LuaState L, int fidx, int n)
  1508.         {
  1509.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1510.             var __ret = __Internal.LuaUpvalueid(__arg0, fidx, n);
  1511.             return __ret;
  1512.         }
  1513.  
  1514.         public static void LuaUpvaluejoin(global::Lua53.LuaState L, int fidx1, int n1, int fidx2, int n2)
  1515.         {
  1516.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1517.             __Internal.LuaUpvaluejoin(__arg0, fidx1, n1, fidx2, n2);
  1518.         }
  1519.  
  1520.         public static void LuaSethook(global::Lua53.LuaState L, global::Lua53.LuaHook func, int mask, int count)
  1521.         {
  1522.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1523.             var __arg1 = func == null ? global::System.IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func);
  1524.             __Internal.LuaSethook(__arg0, __arg1, mask, count);
  1525.         }
  1526.  
  1527.         public static global::Lua53.LuaHook LuaGethook(global::Lua53.LuaState L)
  1528.         {
  1529.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1530.             var __ret = __Internal.LuaGethook(__arg0);
  1531.             var __ptr0 = __ret;
  1532.             return __ptr0 == IntPtr.Zero? null : (global::Lua53.LuaHook) Marshal.GetDelegateForFunctionPointer(__ptr0, typeof(global::Lua53.LuaHook));
  1533.         }
  1534.  
  1535.         public static int LuaGethookmask(global::Lua53.LuaState L)
  1536.         {
  1537.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1538.             var __ret = __Internal.LuaGethookmask(__arg0);
  1539.             return __ret;
  1540.         }
  1541.  
  1542.         public static int LuaGethookcount(global::Lua53.LuaState L)
  1543.         {
  1544.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1545.             var __ret = __Internal.LuaGethookcount(__arg0);
  1546.             return __ret;
  1547.         }
  1548.  
  1549.         public static string LuaIdent
  1550.         {
  1551.             get
  1552.             {
  1553.                 var __ptr = (string*)CppSharp.SymbolResolver.ResolveSymbol("__Internal", "?lua_ident@@3QBDB");
  1554.                 return Marshal.PtrToStringAnsi(__ptr);
  1555.             }
  1556.         }
  1557.     }
  1558.  
  1559.     public unsafe partial class lualib
  1560.     {
  1561.         public partial struct __Internal
  1562.         {
  1563.             [SuppressUnmanagedCodeSecurity]
  1564.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  1565.                 EntryPoint="?luaopen_base@@YAHPAUlua_State@@@Z")]
  1566.             internal static extern int LuaopenBase(global::System.IntPtr L);
  1567.  
  1568.             [SuppressUnmanagedCodeSecurity]
  1569.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  1570.                 EntryPoint="?luaopen_coroutine@@YAHPAUlua_State@@@Z")]
  1571.             internal static extern int LuaopenCoroutine(global::System.IntPtr L);
  1572.  
  1573.             [SuppressUnmanagedCodeSecurity]
  1574.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  1575.                 EntryPoint="?luaopen_table@@YAHPAUlua_State@@@Z")]
  1576.             internal static extern int LuaopenTable(global::System.IntPtr L);
  1577.  
  1578.             [SuppressUnmanagedCodeSecurity]
  1579.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  1580.                 EntryPoint="?luaopen_io@@YAHPAUlua_State@@@Z")]
  1581.             internal static extern int LuaopenIo(global::System.IntPtr L);
  1582.  
  1583.             [SuppressUnmanagedCodeSecurity]
  1584.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  1585.                 EntryPoint="?luaopen_os@@YAHPAUlua_State@@@Z")]
  1586.             internal static extern int LuaopenOs(global::System.IntPtr L);
  1587.  
  1588.             [SuppressUnmanagedCodeSecurity]
  1589.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  1590.                 EntryPoint="?luaopen_string@@YAHPAUlua_State@@@Z")]
  1591.             internal static extern int LuaopenString(global::System.IntPtr L);
  1592.  
  1593.             [SuppressUnmanagedCodeSecurity]
  1594.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  1595.                 EntryPoint="?luaopen_utf8@@YAHPAUlua_State@@@Z")]
  1596.             internal static extern int LuaopenUtf8(global::System.IntPtr L);
  1597.  
  1598.             [SuppressUnmanagedCodeSecurity]
  1599.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  1600.                 EntryPoint="?luaopen_bit32@@YAHPAUlua_State@@@Z")]
  1601.             internal static extern int LuaopenBit32(global::System.IntPtr L);
  1602.  
  1603.             [SuppressUnmanagedCodeSecurity]
  1604.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  1605.                 EntryPoint="?luaopen_math@@YAHPAUlua_State@@@Z")]
  1606.             internal static extern int LuaopenMath(global::System.IntPtr L);
  1607.  
  1608.             [SuppressUnmanagedCodeSecurity]
  1609.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  1610.                 EntryPoint="?luaopen_debug@@YAHPAUlua_State@@@Z")]
  1611.             internal static extern int LuaopenDebug(global::System.IntPtr L);
  1612.  
  1613.             [SuppressUnmanagedCodeSecurity]
  1614.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  1615.                 EntryPoint="?luaopen_package@@YAHPAUlua_State@@@Z")]
  1616.             internal static extern int LuaopenPackage(global::System.IntPtr L);
  1617.  
  1618.             [SuppressUnmanagedCodeSecurity]
  1619.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  1620.                 EntryPoint="?luaL_openlibs@@YAXPAUlua_State@@@Z")]
  1621.             internal static extern void LuaL_openlibs(global::System.IntPtr L);
  1622.         }
  1623.  
  1624.         public static int LuaopenBase(global::Lua53.LuaState L)
  1625.         {
  1626.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1627.             var __ret = __Internal.LuaopenBase(__arg0);
  1628.             return __ret;
  1629.         }
  1630.  
  1631.         public static int LuaopenCoroutine(global::Lua53.LuaState L)
  1632.         {
  1633.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1634.             var __ret = __Internal.LuaopenCoroutine(__arg0);
  1635.             return __ret;
  1636.         }
  1637.  
  1638.         public static int LuaopenTable(global::Lua53.LuaState L)
  1639.         {
  1640.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1641.             var __ret = __Internal.LuaopenTable(__arg0);
  1642.             return __ret;
  1643.         }
  1644.  
  1645.         public static int LuaopenIo(global::Lua53.LuaState L)
  1646.         {
  1647.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1648.             var __ret = __Internal.LuaopenIo(__arg0);
  1649.             return __ret;
  1650.         }
  1651.  
  1652.         public static int LuaopenOs(global::Lua53.LuaState L)
  1653.         {
  1654.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1655.             var __ret = __Internal.LuaopenOs(__arg0);
  1656.             return __ret;
  1657.         }
  1658.  
  1659.         public static int LuaopenString(global::Lua53.LuaState L)
  1660.         {
  1661.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1662.             var __ret = __Internal.LuaopenString(__arg0);
  1663.             return __ret;
  1664.         }
  1665.  
  1666.         public static int LuaopenUtf8(global::Lua53.LuaState L)
  1667.         {
  1668.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1669.             var __ret = __Internal.LuaopenUtf8(__arg0);
  1670.             return __ret;
  1671.         }
  1672.  
  1673.         public static int LuaopenBit32(global::Lua53.LuaState L)
  1674.         {
  1675.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1676.             var __ret = __Internal.LuaopenBit32(__arg0);
  1677.             return __ret;
  1678.         }
  1679.  
  1680.         public static int LuaopenMath(global::Lua53.LuaState L)
  1681.         {
  1682.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1683.             var __ret = __Internal.LuaopenMath(__arg0);
  1684.             return __ret;
  1685.         }
  1686.  
  1687.         public static int LuaopenDebug(global::Lua53.LuaState L)
  1688.         {
  1689.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1690.             var __ret = __Internal.LuaopenDebug(__arg0);
  1691.             return __ret;
  1692.         }
  1693.  
  1694.         public static int LuaopenPackage(global::Lua53.LuaState L)
  1695.         {
  1696.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1697.             var __ret = __Internal.LuaopenPackage(__arg0);
  1698.             return __ret;
  1699.         }
  1700.  
  1701.         public static void LuaL_openlibs(global::Lua53.LuaState L)
  1702.         {
  1703.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  1704.             __Internal.LuaL_openlibs(__arg0);
  1705.         }
  1706.     }
  1707.  
  1708.     public unsafe partial class LuaL_Reg : IDisposable
  1709.     {
  1710.         public partial struct __Internal
  1711.         {
  1712.             internal global::System.IntPtr name;
  1713.  
  1714.             internal global::System.IntPtr func;
  1715.  
  1716.             [SuppressUnmanagedCodeSecurity]
  1717.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
  1718.                 EntryPoint="??0luaL_Reg@@QAE@ABU0@@Z")]
  1719.             internal static extern global::System.IntPtr cctor(global::System.IntPtr instance, global::System.IntPtr _0);
  1720.         }
  1721.  
  1722.         public global::System.IntPtr __Instance { get; protected set; }
  1723.  
  1724.         protected int __PointerAdjustment;
  1725.         internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Lua53.LuaL_Reg> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Lua53.LuaL_Reg>();
  1726.         protected void*[] __OriginalVTables;
  1727.  
  1728.         protected bool __ownsNativeInstance;
  1729.  
  1730.         internal static global::Lua53.LuaL_Reg __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
  1731.         {
  1732.             return new global::Lua53.LuaL_Reg(native.ToPointer(), skipVTables);
  1733.         }
  1734.  
  1735.         internal static global::Lua53.LuaL_Reg __CreateInstance(global::Lua53.LuaL_Reg.__Internal native, bool skipVTables = false)
  1736.         {
  1737.             return new global::Lua53.LuaL_Reg(native, skipVTables);
  1738.         }
  1739.  
  1740.         private static void* __CopyValue(global::Lua53.LuaL_Reg.__Internal native)
  1741.         {
  1742.             var ret = Marshal.AllocHGlobal(sizeof(global::Lua53.LuaL_Reg.__Internal));
  1743.             *(global::Lua53.LuaL_Reg.__Internal*) ret = native;
  1744.             return ret.ToPointer();
  1745.         }
  1746.  
  1747.         private LuaL_Reg(global::Lua53.LuaL_Reg.__Internal native, bool skipVTables = false)
  1748.             : this(__CopyValue(native), skipVTables)
  1749.         {
  1750.             __ownsNativeInstance = true;
  1751.             NativeToManagedMap[__Instance] = this;
  1752.         }
  1753.  
  1754.         protected LuaL_Reg(void* native, bool skipVTables = false)
  1755.         {
  1756.             if (native == null)
  1757.                 return;
  1758.             __Instance = new global::System.IntPtr(native);
  1759.         }
  1760.  
  1761.         public LuaL_Reg()
  1762.         {
  1763.             __Instance = Marshal.AllocHGlobal(sizeof(global::Lua53.LuaL_Reg.__Internal));
  1764.             __ownsNativeInstance = true;
  1765.             NativeToManagedMap[__Instance] = this;
  1766.         }
  1767.  
  1768.         public LuaL_Reg(global::Lua53.LuaL_Reg _0)
  1769.         {
  1770.             __Instance = Marshal.AllocHGlobal(sizeof(global::Lua53.LuaL_Reg.__Internal));
  1771.             __ownsNativeInstance = true;
  1772.             NativeToManagedMap[__Instance] = this;
  1773.             *((global::Lua53.LuaL_Reg.__Internal*) __Instance) = *((global::Lua53.LuaL_Reg.__Internal*) _0.__Instance);
  1774.         }
  1775.  
  1776.         ~LuaL_Reg()
  1777.         {
  1778.             Dispose(false);
  1779.         }
  1780.  
  1781.         public void Dispose()
  1782.         {
  1783.             Dispose(disposing: true);
  1784.             GC.SuppressFinalize(this);
  1785.         }
  1786.  
  1787.         public virtual void Dispose(bool disposing)
  1788.         {
  1789.             if (__Instance == IntPtr.Zero)
  1790.                 return;
  1791.             global::Lua53.LuaL_Reg __dummy;
  1792.             NativeToManagedMap.TryRemove(__Instance, out __dummy);
  1793.             if (__ownsNativeInstance)
  1794.                 Marshal.FreeHGlobal(__Instance);
  1795.             __Instance = IntPtr.Zero;
  1796.         }
  1797.  
  1798.         public string Name
  1799.         {
  1800.             get
  1801.             {
  1802.                 return Marshal.PtrToStringAnsi(((global::Lua53.LuaL_Reg.__Internal*) __Instance)->name);
  1803.             }
  1804.  
  1805.             set
  1806.             {
  1807.                 ((global::Lua53.LuaL_Reg.__Internal*) __Instance)->name = Marshal.StringToHGlobalAnsi(value);
  1808.             }
  1809.         }
  1810.  
  1811.         public global::Lua53.LuaCFunction Func
  1812.         {
  1813.             get
  1814.             {
  1815.                 var __ptr0 = ((global::Lua53.LuaL_Reg.__Internal*) __Instance)->func;
  1816.                 return __ptr0 == IntPtr.Zero? null : (global::Lua53.LuaCFunction) Marshal.GetDelegateForFunctionPointer(__ptr0, typeof(global::Lua53.LuaCFunction));
  1817.             }
  1818.  
  1819.             set
  1820.             {
  1821.                 ((global::Lua53.LuaL_Reg.__Internal*) __Instance)->func = value == null ? global::System.IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value);
  1822.             }
  1823.         }
  1824.     }
  1825.  
  1826.     public unsafe partial class LuaL_Buffer : IDisposable
  1827.     {
  1828.         public partial struct __Internal
  1829.         {
  1830.             internal global::System.IntPtr b;
  1831.  
  1832.             internal uint size;
  1833.  
  1834.             internal uint n;
  1835.  
  1836.             internal global::System.IntPtr L;
  1837.  
  1838.             internal fixed sbyte initb[4096];
  1839.  
  1840.             [SuppressUnmanagedCodeSecurity]
  1841.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
  1842.                 EntryPoint="??0luaL_Buffer@@QAE@ABU0@@Z")]
  1843.             internal static extern global::System.IntPtr cctor(global::System.IntPtr instance, global::System.IntPtr _0);
  1844.         }
  1845.  
  1846.         public global::System.IntPtr __Instance { get; protected set; }
  1847.  
  1848.         protected int __PointerAdjustment;
  1849.         internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Lua53.LuaL_Buffer> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Lua53.LuaL_Buffer>();
  1850.         protected void*[] __OriginalVTables;
  1851.  
  1852.         protected bool __ownsNativeInstance;
  1853.  
  1854.         internal static global::Lua53.LuaL_Buffer __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
  1855.         {
  1856.             return new global::Lua53.LuaL_Buffer(native.ToPointer(), skipVTables);
  1857.         }
  1858.  
  1859.         internal static global::Lua53.LuaL_Buffer __CreateInstance(global::Lua53.LuaL_Buffer.__Internal native, bool skipVTables = false)
  1860.         {
  1861.             return new global::Lua53.LuaL_Buffer(native, skipVTables);
  1862.         }
  1863.  
  1864.         private static void* __CopyValue(global::Lua53.LuaL_Buffer.__Internal native)
  1865.         {
  1866.             var ret = Marshal.AllocHGlobal(sizeof(global::Lua53.LuaL_Buffer.__Internal));
  1867.             *(global::Lua53.LuaL_Buffer.__Internal*) ret = native;
  1868.             return ret.ToPointer();
  1869.         }
  1870.  
  1871.         private LuaL_Buffer(global::Lua53.LuaL_Buffer.__Internal native, bool skipVTables = false)
  1872.             : this(__CopyValue(native), skipVTables)
  1873.         {
  1874.             __ownsNativeInstance = true;
  1875.             NativeToManagedMap[__Instance] = this;
  1876.         }
  1877.  
  1878.         protected LuaL_Buffer(void* native, bool skipVTables = false)
  1879.         {
  1880.             if (native == null)
  1881.                 return;
  1882.             __Instance = new global::System.IntPtr(native);
  1883.         }
  1884.  
  1885.         public LuaL_Buffer()
  1886.         {
  1887.             __Instance = Marshal.AllocHGlobal(sizeof(global::Lua53.LuaL_Buffer.__Internal));
  1888.             __ownsNativeInstance = true;
  1889.             NativeToManagedMap[__Instance] = this;
  1890.         }
  1891.  
  1892.         public LuaL_Buffer(global::Lua53.LuaL_Buffer _0)
  1893.         {
  1894.             __Instance = Marshal.AllocHGlobal(sizeof(global::Lua53.LuaL_Buffer.__Internal));
  1895.             __ownsNativeInstance = true;
  1896.             NativeToManagedMap[__Instance] = this;
  1897.             *((global::Lua53.LuaL_Buffer.__Internal*) __Instance) = *((global::Lua53.LuaL_Buffer.__Internal*) _0.__Instance);
  1898.         }
  1899.  
  1900.         ~LuaL_Buffer()
  1901.         {
  1902.             Dispose(false);
  1903.         }
  1904.  
  1905.         public void Dispose()
  1906.         {
  1907.             Dispose(disposing: true);
  1908.             GC.SuppressFinalize(this);
  1909.         }
  1910.  
  1911.         public virtual void Dispose(bool disposing)
  1912.         {
  1913.             if (__Instance == IntPtr.Zero)
  1914.                 return;
  1915.             global::Lua53.LuaL_Buffer __dummy;
  1916.             NativeToManagedMap.TryRemove(__Instance, out __dummy);
  1917.             if (__ownsNativeInstance)
  1918.                 Marshal.FreeHGlobal(__Instance);
  1919.             __Instance = IntPtr.Zero;
  1920.         }
  1921.  
  1922.         public char* B
  1923.         {
  1924.             get
  1925.             {
  1926.                 return (char*) ((global::Lua53.LuaL_Buffer.__Internal*) __Instance)->b;
  1927.             }
  1928.  
  1929.             set
  1930.             {
  1931.                 ((global::Lua53.LuaL_Buffer.__Internal*) __Instance)->b = (global::System.IntPtr) (sbyte*) value;
  1932.             }
  1933.         }
  1934.  
  1935.         public uint Size
  1936.         {
  1937.             get
  1938.             {
  1939.                 return ((global::Lua53.LuaL_Buffer.__Internal*) __Instance)->size;
  1940.             }
  1941.  
  1942.             set
  1943.             {
  1944.                 ((global::Lua53.LuaL_Buffer.__Internal*) __Instance)->size = value;
  1945.             }
  1946.         }
  1947.  
  1948.         public uint N
  1949.         {
  1950.             get
  1951.             {
  1952.                 return ((global::Lua53.LuaL_Buffer.__Internal*) __Instance)->n;
  1953.             }
  1954.  
  1955.             set
  1956.             {
  1957.                 ((global::Lua53.LuaL_Buffer.__Internal*) __Instance)->n = value;
  1958.             }
  1959.         }
  1960.  
  1961.         public global::Lua53.LuaState L
  1962.         {
  1963.             get
  1964.             {
  1965.                 global::Lua53.LuaState __result0;
  1966.                 if (((global::Lua53.LuaL_Buffer.__Internal*) __Instance)->L == IntPtr.Zero) __result0 = null;
  1967.                 else if (global::Lua53.LuaState.NativeToManagedMap.ContainsKey(((global::Lua53.LuaL_Buffer.__Internal*) __Instance)->L))
  1968.                     __result0 = (global::Lua53.LuaState) global::Lua53.LuaState.NativeToManagedMap[((global::Lua53.LuaL_Buffer.__Internal*) __Instance)->L];
  1969.                 else __result0 = global::Lua53.LuaState.__CreateInstance(((global::Lua53.LuaL_Buffer.__Internal*) __Instance)->L);
  1970.                 return __result0;
  1971.             }
  1972.  
  1973.             set
  1974.             {
  1975.                 ((global::Lua53.LuaL_Buffer.__Internal*) __Instance)->L = ReferenceEquals(value, null) ? global::System.IntPtr.Zero : value.__Instance;
  1976.             }
  1977.         }
  1978.  
  1979.         public char[] Initb
  1980.         {
  1981.             get
  1982.             {
  1983.                 char[] __value = null;
  1984.                 if (((global::Lua53.LuaL_Buffer.__Internal*) __Instance)->initb != null)
  1985.                 {
  1986.                     __value = new char[4096];
  1987.                     for (int i = 0; i < 4096; i++)
  1988.                         __value[i] = global::System.Convert.ToChar(((global::Lua53.LuaL_Buffer.__Internal*) __Instance)->initb[i]);
  1989.                 }
  1990.                 return __value;
  1991.             }
  1992.  
  1993.             set
  1994.             {
  1995.                 if (value != null)
  1996.                 {
  1997.                     for (int i = 0; i < 4096; i++)
  1998.                         ((global::Lua53.LuaL_Buffer.__Internal*) __Instance)->initb[i] = global::System.Convert.ToSByte(value[i]);
  1999.                 }
  2000.             }
  2001.         }
  2002.     }
  2003.  
  2004.     public unsafe partial class LuaL_Stream : IDisposable
  2005.     {
  2006.         public partial struct __Internal
  2007.         {
  2008.             internal global::System.IntPtr f;
  2009.  
  2010.             internal global::System.IntPtr closef;
  2011.  
  2012.             [SuppressUnmanagedCodeSecurity]
  2013.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
  2014.                 EntryPoint="??0luaL_Stream@@QAE@ABU0@@Z")]
  2015.             internal static extern global::System.IntPtr cctor(global::System.IntPtr instance, global::System.IntPtr _0);
  2016.         }
  2017.  
  2018.         public global::System.IntPtr __Instance { get; protected set; }
  2019.  
  2020.         protected int __PointerAdjustment;
  2021.         internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Lua53.LuaL_Stream> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Lua53.LuaL_Stream>();
  2022.         protected void*[] __OriginalVTables;
  2023.  
  2024.         protected bool __ownsNativeInstance;
  2025.  
  2026.         internal static global::Lua53.LuaL_Stream __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
  2027.         {
  2028.             return new global::Lua53.LuaL_Stream(native.ToPointer(), skipVTables);
  2029.         }
  2030.  
  2031.         internal static global::Lua53.LuaL_Stream __CreateInstance(global::Lua53.LuaL_Stream.__Internal native, bool skipVTables = false)
  2032.         {
  2033.             return new global::Lua53.LuaL_Stream(native, skipVTables);
  2034.         }
  2035.  
  2036.         private static void* __CopyValue(global::Lua53.LuaL_Stream.__Internal native)
  2037.         {
  2038.             var ret = Marshal.AllocHGlobal(sizeof(global::Lua53.LuaL_Stream.__Internal));
  2039.             *(global::Lua53.LuaL_Stream.__Internal*) ret = native;
  2040.             return ret.ToPointer();
  2041.         }
  2042.  
  2043.         private LuaL_Stream(global::Lua53.LuaL_Stream.__Internal native, bool skipVTables = false)
  2044.             : this(__CopyValue(native), skipVTables)
  2045.         {
  2046.             __ownsNativeInstance = true;
  2047.             NativeToManagedMap[__Instance] = this;
  2048.         }
  2049.  
  2050.         protected LuaL_Stream(void* native, bool skipVTables = false)
  2051.         {
  2052.             if (native == null)
  2053.                 return;
  2054.             __Instance = new global::System.IntPtr(native);
  2055.         }
  2056.  
  2057.         public LuaL_Stream()
  2058.         {
  2059.             __Instance = Marshal.AllocHGlobal(sizeof(global::Lua53.LuaL_Stream.__Internal));
  2060.             __ownsNativeInstance = true;
  2061.             NativeToManagedMap[__Instance] = this;
  2062.         }
  2063.  
  2064.         public LuaL_Stream(global::Lua53.LuaL_Stream _0)
  2065.         {
  2066.             __Instance = Marshal.AllocHGlobal(sizeof(global::Lua53.LuaL_Stream.__Internal));
  2067.             __ownsNativeInstance = true;
  2068.             NativeToManagedMap[__Instance] = this;
  2069.             *((global::Lua53.LuaL_Stream.__Internal*) __Instance) = *((global::Lua53.LuaL_Stream.__Internal*) _0.__Instance);
  2070.         }
  2071.  
  2072.         ~LuaL_Stream()
  2073.         {
  2074.             Dispose(false);
  2075.         }
  2076.  
  2077.         public void Dispose()
  2078.         {
  2079.             Dispose(disposing: true);
  2080.             GC.SuppressFinalize(this);
  2081.         }
  2082.  
  2083.         public virtual void Dispose(bool disposing)
  2084.         {
  2085.             if (__Instance == IntPtr.Zero)
  2086.                 return;
  2087.             global::Lua53.LuaL_Stream __dummy;
  2088.             NativeToManagedMap.TryRemove(__Instance, out __dummy);
  2089.             if (__ownsNativeInstance)
  2090.                 Marshal.FreeHGlobal(__Instance);
  2091.             __Instance = IntPtr.Zero;
  2092.         }
  2093.  
  2094.         public global::System.IntPtr F
  2095.         {
  2096.             get
  2097.             {
  2098.                 return ((global::Lua53.LuaL_Stream.__Internal*) __Instance)->f;
  2099.             }
  2100.  
  2101.             set
  2102.             {
  2103.                 ((global::Lua53.LuaL_Stream.__Internal*) __Instance)->f = value;
  2104.             }
  2105.         }
  2106.  
  2107.         public global::Lua53.LuaCFunction Closef
  2108.         {
  2109.             get
  2110.             {
  2111.                 var __ptr0 = ((global::Lua53.LuaL_Stream.__Internal*) __Instance)->closef;
  2112.                 return __ptr0 == IntPtr.Zero? null : (global::Lua53.LuaCFunction) Marshal.GetDelegateForFunctionPointer(__ptr0, typeof(global::Lua53.LuaCFunction));
  2113.             }
  2114.  
  2115.             set
  2116.             {
  2117.                 ((global::Lua53.LuaL_Stream.__Internal*) __Instance)->closef = value == null ? global::System.IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value);
  2118.             }
  2119.         }
  2120.     }
  2121.  
  2122.     public unsafe partial class lauxlib
  2123.     {
  2124.         public partial struct __Internal
  2125.         {
  2126.             [SuppressUnmanagedCodeSecurity]
  2127.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2128.                 EntryPoint="?luaL_checkversion_@@YAXPAUlua_State@@NI@Z")]
  2129.             internal static extern void LuaL_checkversion(global::System.IntPtr L, double ver, uint sz);
  2130.  
  2131.             [SuppressUnmanagedCodeSecurity]
  2132.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2133.                 EntryPoint="?luaL_getmetafield@@YAHPAUlua_State@@HPBD@Z")]
  2134.             internal static extern int LuaL_getmetafield(global::System.IntPtr L, int obj, [MarshalAs(UnmanagedType.LPStr)] string e);
  2135.  
  2136.             [SuppressUnmanagedCodeSecurity]
  2137.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2138.                 EntryPoint="?luaL_callmeta@@YAHPAUlua_State@@HPBD@Z")]
  2139.             internal static extern int LuaL_callmeta(global::System.IntPtr L, int obj, [MarshalAs(UnmanagedType.LPStr)] string e);
  2140.  
  2141.             [SuppressUnmanagedCodeSecurity]
  2142.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2143.                 EntryPoint="?luaL_tolstring@@YAPBDPAUlua_State@@HPAI@Z")]
  2144.             internal static extern global::System.IntPtr LuaL_tolstring(global::System.IntPtr L, int idx, uint* len);
  2145.  
  2146.             [SuppressUnmanagedCodeSecurity]
  2147.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2148.                 EntryPoint="?luaL_argerror@@YAHPAUlua_State@@HPBD@Z")]
  2149.             internal static extern int LuaL_argerror(global::System.IntPtr L, int arg, [MarshalAs(UnmanagedType.LPStr)] string extramsg);
  2150.  
  2151.             [SuppressUnmanagedCodeSecurity]
  2152.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2153.                 EntryPoint="?luaL_checklstring@@YAPBDPAUlua_State@@HPAI@Z")]
  2154.             internal static extern global::System.IntPtr LuaL_checklstring(global::System.IntPtr L, int arg, uint* l);
  2155.  
  2156.             [SuppressUnmanagedCodeSecurity]
  2157.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2158.                 EntryPoint="?luaL_optlstring@@YAPBDPAUlua_State@@HPBDPAI@Z")]
  2159.             internal static extern global::System.IntPtr LuaL_optlstring(global::System.IntPtr L, int arg, [MarshalAs(UnmanagedType.LPStr)] string def, uint* l);
  2160.  
  2161.             [SuppressUnmanagedCodeSecurity]
  2162.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2163.                 EntryPoint="?luaL_checknumber@@YANPAUlua_State@@H@Z")]
  2164.             internal static extern double LuaL_checknumber(global::System.IntPtr L, int arg);
  2165.  
  2166.             [SuppressUnmanagedCodeSecurity]
  2167.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2168.                 EntryPoint="?luaL_optnumber@@YANPAUlua_State@@HN@Z")]
  2169.             internal static extern double LuaL_optnumber(global::System.IntPtr L, int arg, double def);
  2170.  
  2171.             [SuppressUnmanagedCodeSecurity]
  2172.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2173.                 EntryPoint="?luaL_checkinteger@@YA_JPAUlua_State@@H@Z")]
  2174.             internal static extern long LuaL_checkinteger(global::System.IntPtr L, int arg);
  2175.  
  2176.             [SuppressUnmanagedCodeSecurity]
  2177.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2178.                 EntryPoint="?luaL_optinteger@@YA_JPAUlua_State@@H_J@Z")]
  2179.             internal static extern long LuaL_optinteger(global::System.IntPtr L, int arg, long def);
  2180.  
  2181.             [SuppressUnmanagedCodeSecurity]
  2182.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2183.                 EntryPoint="?luaL_checkstack@@YAXPAUlua_State@@HPBD@Z")]
  2184.             internal static extern void LuaL_checkstack(global::System.IntPtr L, int sz, [MarshalAs(UnmanagedType.LPStr)] string msg);
  2185.  
  2186.             [SuppressUnmanagedCodeSecurity]
  2187.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2188.                 EntryPoint="?luaL_checktype@@YAXPAUlua_State@@HH@Z")]
  2189.             internal static extern void LuaL_checktype(global::System.IntPtr L, int arg, int t);
  2190.  
  2191.             [SuppressUnmanagedCodeSecurity]
  2192.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2193.                 EntryPoint="?luaL_checkany@@YAXPAUlua_State@@H@Z")]
  2194.             internal static extern void LuaL_checkany(global::System.IntPtr L, int arg);
  2195.  
  2196.             [SuppressUnmanagedCodeSecurity]
  2197.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2198.                 EntryPoint="?luaL_newmetatable@@YAHPAUlua_State@@PBD@Z")]
  2199.             internal static extern int LuaL_newmetatable(global::System.IntPtr L, [MarshalAs(UnmanagedType.LPStr)] string tname);
  2200.  
  2201.             [SuppressUnmanagedCodeSecurity]
  2202.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2203.                 EntryPoint="?luaL_setmetatable@@YAXPAUlua_State@@PBD@Z")]
  2204.             internal static extern void LuaL_setmetatable(global::System.IntPtr L, [MarshalAs(UnmanagedType.LPStr)] string tname);
  2205.  
  2206.             [SuppressUnmanagedCodeSecurity]
  2207.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2208.                 EntryPoint="?luaL_testudata@@YAPAXPAUlua_State@@HPBD@Z")]
  2209.             internal static extern global::System.IntPtr LuaL_testudata(global::System.IntPtr L, int ud, [MarshalAs(UnmanagedType.LPStr)] string tname);
  2210.  
  2211.             [SuppressUnmanagedCodeSecurity]
  2212.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2213.                 EntryPoint="?luaL_checkudata@@YAPAXPAUlua_State@@HPBD@Z")]
  2214.             internal static extern global::System.IntPtr LuaL_checkudata(global::System.IntPtr L, int ud, [MarshalAs(UnmanagedType.LPStr)] string tname);
  2215.  
  2216.             [SuppressUnmanagedCodeSecurity]
  2217.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2218.                 EntryPoint="?luaL_where@@YAXPAUlua_State@@H@Z")]
  2219.             internal static extern void LuaL_where(global::System.IntPtr L, int lvl);
  2220.  
  2221.             [SuppressUnmanagedCodeSecurity]
  2222.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2223.                 EntryPoint="?luaL_error@@YAHPAUlua_State@@PBDZZ")]
  2224.             internal static extern int LuaL_error(global::System.IntPtr L, [MarshalAs(UnmanagedType.LPStr)] string fmt);
  2225.  
  2226.             [SuppressUnmanagedCodeSecurity]
  2227.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2228.                 EntryPoint="?luaL_checkoption@@YAHPAUlua_State@@HPBDQBQBD@Z")]
  2229.             internal static extern int LuaL_checkoption(global::System.IntPtr L, int arg, [MarshalAs(UnmanagedType.LPStr)] string def, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr)] string[] lst);
  2230.  
  2231.             [SuppressUnmanagedCodeSecurity]
  2232.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2233.                 EntryPoint="?luaL_fileresult@@YAHPAUlua_State@@HPBD@Z")]
  2234.             internal static extern int LuaL_fileresult(global::System.IntPtr L, int stat, [MarshalAs(UnmanagedType.LPStr)] string fname);
  2235.  
  2236.             [SuppressUnmanagedCodeSecurity]
  2237.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2238.                 EntryPoint="?luaL_execresult@@YAHPAUlua_State@@H@Z")]
  2239.             internal static extern int LuaL_execresult(global::System.IntPtr L, int stat);
  2240.  
  2241.             [SuppressUnmanagedCodeSecurity]
  2242.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2243.                 EntryPoint="?luaL_ref@@YAHPAUlua_State@@H@Z")]
  2244.             internal static extern int LuaL_ref(global::System.IntPtr L, int t);
  2245.  
  2246.             [SuppressUnmanagedCodeSecurity]
  2247.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2248.                 EntryPoint="?luaL_unref@@YAXPAUlua_State@@HH@Z")]
  2249.             internal static extern void LuaL_unref(global::System.IntPtr L, int t, int @ref);
  2250.  
  2251.             [SuppressUnmanagedCodeSecurity]
  2252.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2253.                 EntryPoint="?luaL_loadfilex@@YAHPAUlua_State@@PBD1@Z")]
  2254.             internal static extern int LuaL_loadfilex(global::System.IntPtr L, [MarshalAs(UnmanagedType.LPStr)] string filename, [MarshalAs(UnmanagedType.LPStr)] string mode);
  2255.  
  2256.             [SuppressUnmanagedCodeSecurity]
  2257.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2258.                 EntryPoint="?luaL_loadbufferx@@YAHPAUlua_State@@PBDI11@Z")]
  2259.             internal static extern int LuaL_loadbufferx(global::System.IntPtr L, [MarshalAs(UnmanagedType.LPStr)] string buff, uint sz, [MarshalAs(UnmanagedType.LPStr)] string name, [MarshalAs(UnmanagedType.LPStr)] string mode);
  2260.  
  2261.             [SuppressUnmanagedCodeSecurity]
  2262.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2263.                 EntryPoint="?luaL_loadstring@@YAHPAUlua_State@@PBD@Z")]
  2264.             internal static extern int LuaL_loadstring(global::System.IntPtr L, [MarshalAs(UnmanagedType.LPStr)] string s);
  2265.  
  2266.             [SuppressUnmanagedCodeSecurity]
  2267.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2268.                 EntryPoint="?luaL_newstate@@YAPAUlua_State@@XZ")]
  2269.             internal static extern global::System.IntPtr LuaL_newstate();
  2270.  
  2271.             [SuppressUnmanagedCodeSecurity]
  2272.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2273.                 EntryPoint="?luaL_len@@YA_JPAUlua_State@@H@Z")]
  2274.             internal static extern long LuaL_len(global::System.IntPtr L, int idx);
  2275.  
  2276.             [SuppressUnmanagedCodeSecurity]
  2277.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2278.                 EntryPoint="?luaL_gsub@@YAPBDPAUlua_State@@PBD11@Z")]
  2279.             internal static extern global::System.IntPtr LuaL_gsub(global::System.IntPtr L, [MarshalAs(UnmanagedType.LPStr)] string s, [MarshalAs(UnmanagedType.LPStr)] string p, [MarshalAs(UnmanagedType.LPStr)] string r);
  2280.  
  2281.             [SuppressUnmanagedCodeSecurity]
  2282.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2283.                 EntryPoint="?luaL_setfuncs@@YAXPAUlua_State@@PBUluaL_Reg@@H@Z")]
  2284.             internal static extern void LuaL_setfuncs(global::System.IntPtr L, global::System.IntPtr l, int nup);
  2285.  
  2286.             [SuppressUnmanagedCodeSecurity]
  2287.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2288.                 EntryPoint="?luaL_getsubtable@@YAHPAUlua_State@@HPBD@Z")]
  2289.             internal static extern int LuaL_getsubtable(global::System.IntPtr L, int idx, [MarshalAs(UnmanagedType.LPStr)] string fname);
  2290.  
  2291.             [SuppressUnmanagedCodeSecurity]
  2292.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2293.                 EntryPoint="?luaL_traceback@@YAXPAUlua_State@@0PBDH@Z")]
  2294.             internal static extern void LuaL_traceback(global::System.IntPtr L, global::System.IntPtr L1, [MarshalAs(UnmanagedType.LPStr)] string msg, int level);
  2295.  
  2296.             [SuppressUnmanagedCodeSecurity]
  2297.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2298.                 EntryPoint="?luaL_requiref@@YAXPAUlua_State@@PBDP6AH0@ZH@Z")]
  2299.             internal static extern void LuaL_requiref(global::System.IntPtr L, [MarshalAs(UnmanagedType.LPStr)] string modname, global::System.IntPtr openf, int glb);
  2300.  
  2301.             [SuppressUnmanagedCodeSecurity]
  2302.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2303.                 EntryPoint="?luaL_buffinit@@YAXPAUlua_State@@PAUluaL_Buffer@@@Z")]
  2304.             internal static extern void LuaL_buffinit(global::System.IntPtr L, global::System.IntPtr B);
  2305.  
  2306.             [SuppressUnmanagedCodeSecurity]
  2307.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2308.                 EntryPoint="?luaL_prepbuffsize@@YAPADPAUluaL_Buffer@@I@Z")]
  2309.             internal static extern sbyte* LuaL_prepbuffsize(global::System.IntPtr B, uint sz);
  2310.  
  2311.             [SuppressUnmanagedCodeSecurity]
  2312.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2313.                 EntryPoint="?luaL_addlstring@@YAXPAUluaL_Buffer@@PBDI@Z")]
  2314.             internal static extern void LuaL_addlstring(global::System.IntPtr B, [MarshalAs(UnmanagedType.LPStr)] string s, uint l);
  2315.  
  2316.             [SuppressUnmanagedCodeSecurity]
  2317.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2318.                 EntryPoint="?luaL_addstring@@YAXPAUluaL_Buffer@@PBD@Z")]
  2319.             internal static extern void LuaL_addstring(global::System.IntPtr B, [MarshalAs(UnmanagedType.LPStr)] string s);
  2320.  
  2321.             [SuppressUnmanagedCodeSecurity]
  2322.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2323.                 EntryPoint="?luaL_addvalue@@YAXPAUluaL_Buffer@@@Z")]
  2324.             internal static extern void LuaL_addvalue(global::System.IntPtr B);
  2325.  
  2326.             [SuppressUnmanagedCodeSecurity]
  2327.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2328.                 EntryPoint="?luaL_pushresult@@YAXPAUluaL_Buffer@@@Z")]
  2329.             internal static extern void LuaL_pushresult(global::System.IntPtr B);
  2330.  
  2331.             [SuppressUnmanagedCodeSecurity]
  2332.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2333.                 EntryPoint="?luaL_pushresultsize@@YAXPAUluaL_Buffer@@I@Z")]
  2334.             internal static extern void LuaL_pushresultsize(global::System.IntPtr B, uint sz);
  2335.  
  2336.             [SuppressUnmanagedCodeSecurity]
  2337.             [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  2338.                 EntryPoint="?luaL_buffinitsize@@YAPADPAUlua_State@@PAUluaL_Buffer@@I@Z")]
  2339.             internal static extern sbyte* LuaL_buffinitsize(global::System.IntPtr L, global::System.IntPtr B, uint sz);
  2340.         }
  2341.  
  2342.         public static void LuaL_checkversion(global::Lua53.LuaState L, double ver, uint sz)
  2343.         {
  2344.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2345.             __Internal.LuaL_checkversion(__arg0, ver, sz);
  2346.         }
  2347.  
  2348.         public static int LuaL_getmetafield(global::Lua53.LuaState L, int obj, string e)
  2349.         {
  2350.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2351.             var __ret = __Internal.LuaL_getmetafield(__arg0, obj, e);
  2352.             return __ret;
  2353.         }
  2354.  
  2355.         public static int LuaL_callmeta(global::Lua53.LuaState L, int obj, string e)
  2356.         {
  2357.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2358.             var __ret = __Internal.LuaL_callmeta(__arg0, obj, e);
  2359.             return __ret;
  2360.         }
  2361.  
  2362.         public static string LuaL_tolstring(global::Lua53.LuaState L, int idx, ref uint len)
  2363.         {
  2364.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2365.             fixed (uint* __refParamPtr2 = &len)
  2366.             {
  2367.                 var __arg2 = __refParamPtr2;
  2368.                 var __ret = __Internal.LuaL_tolstring(__arg0, idx, __arg2);
  2369.                 return Marshal.PtrToStringAnsi(__ret);
  2370.             }
  2371.         }
  2372.  
  2373.         public static int LuaL_argerror(global::Lua53.LuaState L, int arg, string extramsg)
  2374.         {
  2375.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2376.             var __ret = __Internal.LuaL_argerror(__arg0, arg, extramsg);
  2377.             return __ret;
  2378.         }
  2379.  
  2380.         public static string LuaL_checklstring(global::Lua53.LuaState L, int arg, ref uint l)
  2381.         {
  2382.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2383.             fixed (uint* __refParamPtr2 = &l)
  2384.             {
  2385.                 var __arg2 = __refParamPtr2;
  2386.                 var __ret = __Internal.LuaL_checklstring(__arg0, arg, __arg2);
  2387.                 return Marshal.PtrToStringAnsi(__ret);
  2388.             }
  2389.         }
  2390.  
  2391.         public static string LuaL_optlstring(global::Lua53.LuaState L, int arg, string def, ref uint l)
  2392.         {
  2393.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2394.             fixed (uint* __refParamPtr3 = &l)
  2395.             {
  2396.                 var __arg3 = __refParamPtr3;
  2397.                 var __ret = __Internal.LuaL_optlstring(__arg0, arg, def, __arg3);
  2398.                 return Marshal.PtrToStringAnsi(__ret);
  2399.             }
  2400.         }
  2401.  
  2402.         public static double LuaL_checknumber(global::Lua53.LuaState L, int arg)
  2403.         {
  2404.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2405.             var __ret = __Internal.LuaL_checknumber(__arg0, arg);
  2406.             return __ret;
  2407.         }
  2408.  
  2409.         public static double LuaL_optnumber(global::Lua53.LuaState L, int arg, double def)
  2410.         {
  2411.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2412.             var __ret = __Internal.LuaL_optnumber(__arg0, arg, def);
  2413.             return __ret;
  2414.         }
  2415.  
  2416.         public static long LuaL_checkinteger(global::Lua53.LuaState L, int arg)
  2417.         {
  2418.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2419.             var __ret = __Internal.LuaL_checkinteger(__arg0, arg);
  2420.             return __ret;
  2421.         }
  2422.  
  2423.         public static long LuaL_optinteger(global::Lua53.LuaState L, int arg, long def)
  2424.         {
  2425.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2426.             var __ret = __Internal.LuaL_optinteger(__arg0, arg, def);
  2427.             return __ret;
  2428.         }
  2429.  
  2430.         public static void LuaL_checkstack(global::Lua53.LuaState L, int sz, string msg)
  2431.         {
  2432.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2433.             __Internal.LuaL_checkstack(__arg0, sz, msg);
  2434.         }
  2435.  
  2436.         public static void LuaL_checktype(global::Lua53.LuaState L, int arg, int t)
  2437.         {
  2438.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2439.             __Internal.LuaL_checktype(__arg0, arg, t);
  2440.         }
  2441.  
  2442.         public static void LuaL_checkany(global::Lua53.LuaState L, int arg)
  2443.         {
  2444.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2445.             __Internal.LuaL_checkany(__arg0, arg);
  2446.         }
  2447.  
  2448.         public static int LuaL_newmetatable(global::Lua53.LuaState L, string tname)
  2449.         {
  2450.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2451.             var __ret = __Internal.LuaL_newmetatable(__arg0, tname);
  2452.             return __ret;
  2453.         }
  2454.  
  2455.         public static void LuaL_setmetatable(global::Lua53.LuaState L, string tname)
  2456.         {
  2457.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2458.             __Internal.LuaL_setmetatable(__arg0, tname);
  2459.         }
  2460.  
  2461.         public static global::System.IntPtr LuaL_testudata(global::Lua53.LuaState L, int ud, string tname)
  2462.         {
  2463.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2464.             var __ret = __Internal.LuaL_testudata(__arg0, ud, tname);
  2465.             return __ret;
  2466.         }
  2467.  
  2468.         public static global::System.IntPtr LuaL_checkudata(global::Lua53.LuaState L, int ud, string tname)
  2469.         {
  2470.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2471.             var __ret = __Internal.LuaL_checkudata(__arg0, ud, tname);
  2472.             return __ret;
  2473.         }
  2474.  
  2475.         public static void LuaL_where(global::Lua53.LuaState L, int lvl)
  2476.         {
  2477.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2478.             __Internal.LuaL_where(__arg0, lvl);
  2479.         }
  2480.  
  2481.         public static int LuaL_error(global::Lua53.LuaState L, string fmt)
  2482.         {
  2483.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2484.             var __ret = __Internal.LuaL_error(__arg0, fmt);
  2485.             return __ret;
  2486.         }
  2487.  
  2488.         public static int LuaL_checkoption(global::Lua53.LuaState L, int arg, string def, string[] lst)
  2489.         {
  2490.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2491.             var __ret = __Internal.LuaL_checkoption(__arg0, arg, def, lst);
  2492.             return __ret;
  2493.         }
  2494.  
  2495.         public static int LuaL_fileresult(global::Lua53.LuaState L, int stat, string fname)
  2496.         {
  2497.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2498.             var __ret = __Internal.LuaL_fileresult(__arg0, stat, fname);
  2499.             return __ret;
  2500.         }
  2501.  
  2502.         public static int LuaL_execresult(global::Lua53.LuaState L, int stat)
  2503.         {
  2504.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2505.             var __ret = __Internal.LuaL_execresult(__arg0, stat);
  2506.             return __ret;
  2507.         }
  2508.  
  2509.         public static int LuaL_ref(global::Lua53.LuaState L, int t)
  2510.         {
  2511.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2512.             var __ret = __Internal.LuaL_ref(__arg0, t);
  2513.             return __ret;
  2514.         }
  2515.  
  2516.         public static void LuaL_unref(global::Lua53.LuaState L, int t, int @ref)
  2517.         {
  2518.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2519.             __Internal.LuaL_unref(__arg0, t, @ref);
  2520.         }
  2521.  
  2522.         public static int LuaL_loadfilex(global::Lua53.LuaState L, string filename, string mode)
  2523.         {
  2524.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2525.             var __ret = __Internal.LuaL_loadfilex(__arg0, filename, mode);
  2526.             return __ret;
  2527.         }
  2528.  
  2529.         public static int LuaL_loadbufferx(global::Lua53.LuaState L, string buff, uint sz, string name, string mode)
  2530.         {
  2531.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2532.             var __ret = __Internal.LuaL_loadbufferx(__arg0, buff, sz, name, mode);
  2533.             return __ret;
  2534.         }
  2535.  
  2536.         public static int LuaL_loadstring(global::Lua53.LuaState L, string s)
  2537.         {
  2538.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2539.             var __ret = __Internal.LuaL_loadstring(__arg0, s);
  2540.             return __ret;
  2541.         }
  2542.  
  2543.         public static global::Lua53.LuaState LuaL_newstate()
  2544.         {
  2545.             var __ret = __Internal.LuaL_newstate();
  2546.             global::Lua53.LuaState __result0;
  2547.             if (__ret == IntPtr.Zero) __result0 = null;
  2548.             else if (global::Lua53.LuaState.NativeToManagedMap.ContainsKey(__ret))
  2549.                 __result0 = (global::Lua53.LuaState) global::Lua53.LuaState.NativeToManagedMap[__ret];
  2550.             else __result0 = global::Lua53.LuaState.__CreateInstance(__ret);
  2551.             return __result0;
  2552.         }
  2553.  
  2554.         public static long LuaL_len(global::Lua53.LuaState L, int idx)
  2555.         {
  2556.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2557.             var __ret = __Internal.LuaL_len(__arg0, idx);
  2558.             return __ret;
  2559.         }
  2560.  
  2561.         public static string LuaL_gsub(global::Lua53.LuaState L, string s, string p, string r)
  2562.         {
  2563.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2564.             var __ret = __Internal.LuaL_gsub(__arg0, s, p, r);
  2565.             return Marshal.PtrToStringAnsi(__ret);
  2566.         }
  2567.  
  2568.         public static void LuaL_setfuncs(global::Lua53.LuaState L, global::Lua53.LuaL_Reg l, int nup)
  2569.         {
  2570.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2571.             var __arg1 = ReferenceEquals(l, null) ? global::System.IntPtr.Zero : l.__Instance;
  2572.             __Internal.LuaL_setfuncs(__arg0, __arg1, nup);
  2573.         }
  2574.  
  2575.         public static int LuaL_getsubtable(global::Lua53.LuaState L, int idx, string fname)
  2576.         {
  2577.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2578.             var __ret = __Internal.LuaL_getsubtable(__arg0, idx, fname);
  2579.             return __ret;
  2580.         }
  2581.  
  2582.         public static void LuaL_traceback(global::Lua53.LuaState L, global::Lua53.LuaState L1, string msg, int level)
  2583.         {
  2584.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2585.             var __arg1 = ReferenceEquals(L1, null) ? global::System.IntPtr.Zero : L1.__Instance;
  2586.             __Internal.LuaL_traceback(__arg0, __arg1, msg, level);
  2587.         }
  2588.  
  2589.         public static void LuaL_requiref(global::Lua53.LuaState L, string modname, global::Lua53.LuaCFunction openf, int glb)
  2590.         {
  2591.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2592.             var __arg2 = openf == null ? global::System.IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(openf);
  2593.             __Internal.LuaL_requiref(__arg0, modname, __arg2, glb);
  2594.         }
  2595.  
  2596.         public static void LuaL_buffinit(global::Lua53.LuaState L, global::Lua53.LuaL_Buffer B)
  2597.         {
  2598.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2599.             var __arg1 = ReferenceEquals(B, null) ? global::System.IntPtr.Zero : B.__Instance;
  2600.             __Internal.LuaL_buffinit(__arg0, __arg1);
  2601.         }
  2602.  
  2603.         public static char* LuaL_prepbuffsize(global::Lua53.LuaL_Buffer B, uint sz)
  2604.         {
  2605.             var __arg0 = ReferenceEquals(B, null) ? global::System.IntPtr.Zero : B.__Instance;
  2606.             var __ret = __Internal.LuaL_prepbuffsize(__arg0, sz);
  2607.             return (char*) __ret;
  2608.         }
  2609.  
  2610.         public static void LuaL_addlstring(global::Lua53.LuaL_Buffer B, string s, uint l)
  2611.         {
  2612.             var __arg0 = ReferenceEquals(B, null) ? global::System.IntPtr.Zero : B.__Instance;
  2613.             __Internal.LuaL_addlstring(__arg0, s, l);
  2614.         }
  2615.  
  2616.         public static void LuaL_addstring(global::Lua53.LuaL_Buffer B, string s)
  2617.         {
  2618.             var __arg0 = ReferenceEquals(B, null) ? global::System.IntPtr.Zero : B.__Instance;
  2619.             __Internal.LuaL_addstring(__arg0, s);
  2620.         }
  2621.  
  2622.         public static void LuaL_addvalue(global::Lua53.LuaL_Buffer B)
  2623.         {
  2624.             var __arg0 = ReferenceEquals(B, null) ? global::System.IntPtr.Zero : B.__Instance;
  2625.             __Internal.LuaL_addvalue(__arg0);
  2626.         }
  2627.  
  2628.         public static void LuaL_pushresult(global::Lua53.LuaL_Buffer B)
  2629.         {
  2630.             var __arg0 = ReferenceEquals(B, null) ? global::System.IntPtr.Zero : B.__Instance;
  2631.             __Internal.LuaL_pushresult(__arg0);
  2632.         }
  2633.  
  2634.         public static void LuaL_pushresultsize(global::Lua53.LuaL_Buffer B, uint sz)
  2635.         {
  2636.             var __arg0 = ReferenceEquals(B, null) ? global::System.IntPtr.Zero : B.__Instance;
  2637.             __Internal.LuaL_pushresultsize(__arg0, sz);
  2638.         }
  2639.  
  2640.         public static char* LuaL_buffinitsize(global::Lua53.LuaState L, global::Lua53.LuaL_Buffer B, uint sz)
  2641.         {
  2642.             var __arg0 = ReferenceEquals(L, null) ? global::System.IntPtr.Zero : L.__Instance;
  2643.             var __arg1 = ReferenceEquals(B, null) ? global::System.IntPtr.Zero : B.__Instance;
  2644.             var __ret = __Internal.LuaL_buffinitsize(__arg0, __arg1, sz);
  2645.             return (char*) __ret;
  2646.         }
  2647.     }
  2648. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement