pike.git / lib / modules / ADT.pmod / module.pmod

version» Context lines:

pike.git/lib/modules/ADT.pmod/module.pmod:142:    //! Get the remaining data from the buffer and clears the buffer.    string(0..255) get_rest()    {    return read();    }       //! Reads an array of integers as written by @[put_fix_uint_array]    //! from the buffer.    array(int) get_fix_uint_array(int item_size, int size)    { -  array(int) res = allocate(size); -  for(int i = 0; i<size; i++) -  res[i] = read_int(item_size); -  return res; +  return read_ints(size, item_size);    }       //! Reads an array of integers as written by @[put_var_uint_array]    //! from the buffer.    array(int) get_var_uint_array(int item_size, int len)    {    int size = read_int(len);    int elems = size/item_size;    if( elems*item_size != size )    throw(structError("Impossible uint array length value.\n")); -  return get_fix_uint_array(item_size, elems); +  return read_ints(elems, item_size);    }       //! Returns one if there is any more data to read.    int(0..1) is_empty()    {    return !sizeof(this);    }   }