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); }
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)); }
public static long LinyeeLOptLong(LinyeeState L, int n, LinyeeIntegerType d) { return(LinyeeLOptInteger(L, n, d)); }
public static int LinyeeLOptInt(LinyeeState L, int n, LinyeeIntegerType d) { return((int)LinyeeLOptInteger(L, n, d)); }
public static LinyeeIntegerType LinyeeLOptInteger(LinyeeState L, int narg, LinyeeIntegerType def) { return(LinyeeLOptInteger(L, LinyeeLCheckInteger, narg, def)); }