Example #1
0
        public static int luaZ_fill(ZIO z)
        {
            uint     size;
            LuaState L = z.L;
            CharPtr  buff;

            if (z.eoz != 0)
            {
                return(EOZ);
            }
            LuaUnlock(L);
            buff = z.reader(L, z.data, out size);
            LuaLock(L);
            if (buff == null || size == 0)
            {
                z.eoz = 1;      /* avoid calling reader function next time */
                return(EOZ);
            }
            z.n = size - 1;
            z.p = new CharPtr(buff);
            int result = char2int(z.p[0]);

            z.p.inc();
            return(result);
        }
Example #2
0
		public static int luaZ_fill (ZIO z) {
		  uint size;
		  LuaState L = z.L;
		  CharPtr buff;
		  lua_unlock(L);
		  buff = z.reader(L, z.data, out size);
		  lua_lock(L);
		  if (buff == null || size == 0) return EOZ;
		  z.n = size - 1;
		  z.p = new CharPtr(buff);
		  int result = char2int(z.p[0]);
		  z.p.inc();
		  return result;
		}
Example #3
0
        public static int luaZ_fill(ZIO z)
        {
            uint      size;
            lua_State L = z.L;
            CharPtr   buff;

            lua_unlock(L);
            buff = z.reader(L, z.data, out size);
            lua_lock(L);
            if (buff == null || size == 0)
            {
                return(EOZ);
            }
            z.n = size - 1;                                        /* discount char being returned */
            z.p = new CharPtr(buff);
            int result = (int)(z.p[0]); z.p.inc(); return(result); //FIXME:changed, (byte)->(int)
        }
Example #4
0
        public static int luaZ_fill(ZIO z)
        {
            uint      size;
            lua_State L = z.L;
            CharPtr   buff;

            lua_unlock(L);
            buff = z.reader(L, z.data, out size);
            lua_lock(L);
            if (buff == null || size == 0)
            {
                return(EOZ);
            }
            z.n = size - 1;
            z.p = new CharPtr(buff);
            int result = char2int(z.p[0]);

            z.p.inc();
            return(result);
        }
Example #5
0
		public static int luaZ_fill (ZIO z) {
		  uint size;
		  LuaState L = z.L;
		  CharPtr buff;
		  if (z.eoz != 0) return EOZ;
		  LuaUnlock(L);
		  buff = z.reader(L, z.data, out size);
		  LuaLock(L);
		  if (buff == null || size == 0) {
		    z.eoz = 1;  /* avoid calling reader function next time */
		    return EOZ;
		  }
		  z.n = size - 1;
		  z.p = new CharPtr(buff);
		  int result = char2int(z.p[0]);
		  z.p.inc();
		  return result;
		}