Exemplo n.º 1
0
        public static LinyeeIntegerType LinyeeLCheckInteger(LinyeeState L, int narg)
        {
            LinyeeIntegerType d = LinyeeToInteger(L, narg);

            if (d == 0 && LinyeeIsNumber(L, narg) == 0)      /* avoid extra test when d is not 0 */
            {
                TagError(L, narg, LINYEE_TNUMBER);
            }
            return(d);
        }
Exemplo n.º 2
0
        private static int FSetVBuf(LinyeeState L)
        {
            CharPtr[]         modenames = { "no", "full", "line", null };
            int[]             mode      = { _IONBF, _IOFBF, _IOLBF };
            Stream            f         = ToFile(L);
            int               op        = LinyeeLCheckOption(L, 2, null, modenames);
            LinyeeIntegerType sz        = LinyeeLOptInteger(L, 3, LUAL_BUFFERSIZE);
            int               res       = setvbuf(f, null, mode[op], (uint)sz);

            return(PushResult(L, (res == 0) ? 1 : 0, null));
        }
Exemplo n.º 3
0
 public static long LinyeeLOptLong(LinyeeState L, int n, LinyeeIntegerType d)
 {
     return(LinyeeLOptInteger(L, n, d));
 }
Exemplo n.º 4
0
 public static int LinyeeLOptInt(LinyeeState L, int n, LinyeeIntegerType d)
 {
     return((int)LinyeeLOptInteger(L, n, d));
 }
Exemplo n.º 5
0
 public static LinyeeIntegerType LinyeeLOptInteger(LinyeeState L, int narg, LinyeeIntegerType def)
 {
     return(LinyeeLOptInteger(L, LinyeeLCheckInteger, narg, def));
 }