| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 |
- //this source code was auto-generated by tolua#, do not modify it
- using System;
- using LuaInterface;
- public class LuaUInt64Wrap
- {
- public static void Register(LuaState L)
- {
- L.BeginClass(typeof(LuaUInt64), typeof(System.Object));
- L.RegFunction("Make", Make);
- L.RegFunction("FromString", FromString);
- L.RegFunction("And", And);
- L.RegFunction("Or", Or);
- L.RegFunction("Xor", Xor);
- L.RegFunction("FromDouble", FromDouble);
- L.RegFunction("ToDouble", ToDouble);
- L.RegFunction("ToString", ToString);
- L.RegFunction("UInt64ToBytes", UInt64ToBytes);
- L.RegFunction("BytesToUInt64", BytesToUInt64);
- L.RegFunction("New", _CreateLuaUInt64);
- L.RegFunction("__tostring", ToLua.op_ToString);
- L.EndClass();
- }
- [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
- static int _CreateLuaUInt64(IntPtr L)
- {
- try
- {
- int count = LuaDLL.lua_gettop(L);
- if (count == 0)
- {
- LuaUInt64 obj = new LuaUInt64();
- ToLua.PushObject(L, obj);
- return 1;
- }
- else
- {
- return LuaDLL.luaL_throw(L, "invalid arguments to ctor method: LuaUInt64.New");
- }
- }
- catch (Exception e)
- {
- return LuaDLL.toluaL_exception(L, e);
- }
- }
- [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
- static int Make(IntPtr L)
- {
- try
- {
- ToLua.CheckArgsCount(L, 2);
- uint arg0 = (uint)LuaDLL.luaL_checknumber(L, 1);
- uint arg1 = (uint)LuaDLL.luaL_checknumber(L, 2);
- byte[] o = LuaUInt64.Make(arg0, arg1);
- ToLua.Push(L, o);
- return 1;
- }
- catch (Exception e)
- {
- return LuaDLL.toluaL_exception(L, e);
- }
- }
- [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
- static int FromString(IntPtr L)
- {
- try
- {
- ToLua.CheckArgsCount(L, 1);
- string arg0 = ToLua.CheckString(L, 1);
- byte[] o = LuaUInt64.FromString(arg0);
- ToLua.Push(L, o);
- return 1;
- }
- catch (Exception e)
- {
- return LuaDLL.toluaL_exception(L, e);
- }
- }
- [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
- static int And(IntPtr L)
- {
- try
- {
- ToLua.CheckArgsCount(L, 2);
- byte[] arg0 = ToLua.CheckByteBuffer(L, 1);
- byte[] arg1 = ToLua.CheckByteBuffer(L, 2);
- byte[] o = LuaUInt64.And(arg0, arg1);
- ToLua.Push(L, o);
- return 1;
- }
- catch (Exception e)
- {
- return LuaDLL.toluaL_exception(L, e);
- }
- }
- [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
- static int Or(IntPtr L)
- {
- try
- {
- ToLua.CheckArgsCount(L, 2);
- byte[] arg0 = ToLua.CheckByteBuffer(L, 1);
- byte[] arg1 = ToLua.CheckByteBuffer(L, 2);
- byte[] o = LuaUInt64.Or(arg0, arg1);
- ToLua.Push(L, o);
- return 1;
- }
- catch (Exception e)
- {
- return LuaDLL.toluaL_exception(L, e);
- }
- }
- [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
- static int Xor(IntPtr L)
- {
- try
- {
- ToLua.CheckArgsCount(L, 2);
- byte[] arg0 = ToLua.CheckByteBuffer(L, 1);
- byte[] arg1 = ToLua.CheckByteBuffer(L, 2);
- byte[] o = LuaUInt64.Xor(arg0, arg1);
- ToLua.Push(L, o);
- return 1;
- }
- catch (Exception e)
- {
- return LuaDLL.toluaL_exception(L, e);
- }
- }
- [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
- static int FromDouble(IntPtr L)
- {
- try
- {
- ToLua.CheckArgsCount(L, 1);
- double arg0 = (double)LuaDLL.luaL_checknumber(L, 1);
- byte[] o = LuaUInt64.FromDouble(arg0);
- ToLua.Push(L, o);
- return 1;
- }
- catch (Exception e)
- {
- return LuaDLL.toluaL_exception(L, e);
- }
- }
- [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
- static int ToDouble(IntPtr L)
- {
- try
- {
- ToLua.CheckArgsCount(L, 1);
- byte[] arg0 = ToLua.CheckByteBuffer(L, 1);
- double o = LuaUInt64.ToDouble(arg0);
- LuaDLL.lua_pushnumber(L, o);
- return 1;
- }
- catch (Exception e)
- {
- return LuaDLL.toluaL_exception(L, e);
- }
- }
- [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
- static int ToString(IntPtr L)
- {
- try
- {
- int count = LuaDLL.lua_gettop(L);
- if (count == 1 && TypeChecker.CheckTypes<byte[]>(L, 1))
- {
- byte[] arg0 = ToLua.CheckByteBuffer(L, 1);
- string o = LuaUInt64.ToString(arg0);
- LuaDLL.lua_pushstring(L, o);
- return 1;
- }
- else if (count == 1 && TypeChecker.CheckTypes<LuaUInt64>(L, 1))
- {
- LuaUInt64 obj = (LuaUInt64)ToLua.ToObject(L, 1);
- string o = obj.ToString();
- LuaDLL.lua_pushstring(L, o);
- return 1;
- }
- else
- {
- return LuaDLL.luaL_throw(L, "invalid arguments to method: LuaUInt64.ToString");
- }
- }
- catch (Exception e)
- {
- return LuaDLL.toluaL_exception(L, e);
- }
- }
- [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
- static int UInt64ToBytes(IntPtr L)
- {
- try
- {
- ToLua.CheckArgsCount(L, 1);
- ulong arg0 = LuaDLL.tolua_checkuint64(L, 1);
- byte[] o = LuaUInt64.UInt64ToBytes(arg0);
- ToLua.Push(L, o);
- return 1;
- }
- catch (Exception e)
- {
- return LuaDLL.toluaL_exception(L, e);
- }
- }
- [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
- static int BytesToUInt64(IntPtr L)
- {
- try
- {
- ToLua.CheckArgsCount(L, 1);
- byte[] arg0 = ToLua.CheckByteBuffer(L, 1);
- ulong o = LuaUInt64.BytesToUInt64(arg0);
- LuaDLL.tolua_pushuint64(L, o);
- return 1;
- }
- catch (Exception e)
- {
- return LuaDLL.toluaL_exception(L, e);
- }
- }
- }
|