public static LuaIntegerType LuaLCheckInteger(LuaState L, int narg) { LuaIntegerType d = LuaToInteger(L, narg); if (d == 0 && LuaIsNumber(L, narg) == 0) /* avoid extra test when d is not 0 */ { TagError(L, narg, LUA_TNUMBER); } return(d); }
private static int FSetVBuf(LuaState L) { CharPtr[] modenames = { "no", "full", "line", null }; int[] mode = { _IONBF, _IOFBF, _IOLBF }; Stream f = ToFile(L); int op = LuaLCheckOption(L, 2, null, modenames); LuaIntegerType sz = LuaLOptInteger(L, 3, LUAL_BUFFERSIZE); int res = setvbuf(f, null, mode[op], (uint)sz); return(PushResult(L, (res == 0) ? 1 : 0, null)); }
} // ctor /// <summary>Create a new lua-script-manager.</summary> /// <param name="integerType"></param> /// <param name="floatType"></param> public Lua(LuaIntegerType integerType, LuaFloatType floatType) { this.IntegerType = integerType; this.FloatType = floatType; } // ctor
public static long LuaLOptLong(LuaState L, int n, LuaIntegerType d) { return(LuaLOptInteger(L, n, d)); }
public static int LuaLOptInt(LuaState L, int n, LuaIntegerType d) { return((int)LuaLOptInteger(L, n, d)); }
public static LuaIntegerType LuaLOptInteger(LuaState L, int narg, LuaIntegerType def) { return(LuaLOptInteger(L, LuaLCheckInteger, narg, def)); }
public static long LuaLOptLong(LuaState L, int n, LuaIntegerType d) {return LuaLOptInteger(L, n, d);}
public static int LuaLOptInt(LuaState L, int n, LuaIntegerType d) {return (int)LuaLOptInteger(L, n, d);}
public static LuaIntegerType LuaLOptInteger (LuaState L, int narg, LuaIntegerType def) { return LuaLOptInteger(L, LuaLCheckInteger, narg, def); }