Exemple #1
0
        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);
        }
Exemple #2
0
        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));
        }
Exemple #3
0
        }         // 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
Exemple #4
0
 public static long LuaLOptLong(LuaState L, int n, LuaIntegerType d)
 {
     return(LuaLOptInteger(L, n, d));
 }
Exemple #5
0
 public static int LuaLOptInt(LuaState L, int n, LuaIntegerType d)
 {
     return((int)LuaLOptInteger(L, n, d));
 }
Exemple #6
0
 public static LuaIntegerType LuaLOptInteger(LuaState L, int narg, LuaIntegerType def)
 {
     return(LuaLOptInteger(L, LuaLCheckInteger, narg, def));
 }
Exemple #7
0
		public static long LuaLOptLong(LuaState L, int n, LuaIntegerType d)	{return LuaLOptInteger(L, n, d);}
Exemple #8
0
		public static int LuaLOptInt(LuaState L, int n, LuaIntegerType d)	{return (int)LuaLOptInteger(L, n, d);}
Exemple #9
0
		public static LuaIntegerType LuaLOptInteger (LuaState L, int narg, LuaIntegerType def) {
		  return LuaLOptInteger(L, LuaLCheckInteger, narg, def);
		}