Ejemplo n.º 1
0
// -------------------------------------------------------------------
// Read a reward in from a save file; create & return the correct type
// Returns a NULL pointer if data is bad
// -------------------------------------------------------------------
t_obelisk_reward_ptr t_obelisk_reward::read( std::streambuf & stream )
{
	int version; 
	t_obelisk_reward_ptr result = common_read( stream, version );

	if ( result.get() != NULL )
	{
		if ( !result->read_data( stream, version ) )
			return t_obelisk_reward_ptr();
	}

	return result;
}
Ejemplo n.º 2
0
static DWORD WINAPI echo_process(void* arg) {
  int fd = *(int*)arg;

  ssize_t n;
  char buff[1024];

  while ((n = common_read(fd, sizeof(buff), buff)) > 0)
    common_writen(fd, buff, n);

  common_close(fd);

  return 0;
}