libmemcached/server.cc
/*
  If we do not have a valid object to clone from, we toss an error.
*/
If we do not have a valid object to clone from, we toss an error.
If we do not have a valid object to clone from we toss an error .
memcached_server_st *memcached_server_clone(memcached_server_st *destination,
                                            memcached_server_st *source)
{
  if (not source)
  {
    return NULL;
  }
  memcached_string_t hostname= { memcached_string_make_from_cstr(source->hostname) };
  destination= __server_create_with(source->root, destination,
                                    hostname,
                                    source->port, source->weight,
                                    source->type);
  if (destination)
  {
    if (source->error_messages)
    {
      destination->error_messages= memcached_error_copy(*source);
    }
  }
  return destination;
}
memcached_server_st * memcached_server_clone ( memcached_server_st * destination , memcached_server_st * source ) { if ( not source ) { return NULL ; } memcached_string_t hostname = { memcached_string_make_from_cstr ( source -> hostname ) } ; destination = __server_create_with ( source -> root , destination , hostname , source -> port , source -> weight , source -> type ) ; if ( destination ) { if ( source -> error_messages ) { destination -> error_messages = memcached_error_copy ( * source ) ; } } return destination ; }
If we do not have a valid object to clone from, we toss an error.
If we do not have a valid object to clone from we toss an error .
/* We just do a normal create if source is missing */