예제 #1
0
/**
 * Copy a RIAK_LINK structure to a RpbLink structure
 */
void riak_copy_link_to_rpblink(struct RIACK_CLIENT* client, struct RIACK_LINK* rlink, RpbLink* rpc_link)
{
	rpb_link__init(rpc_link);
	if (rlink->bucket.value) {
		rpc_link->has_bucket = 1;
		RMALLOCCOPY(client, rpc_link->bucket.data, rpc_link->bucket.len,
				rlink->bucket.value, rlink->bucket.len);
	}
	if (rlink->key.value) {
		rpc_link->has_key = 1;
		RMALLOCCOPY(client, rpc_link->key.data, rpc_link->key.len,
				rlink->key.value, rlink->key.len);
	}
	if (rlink->tag.value) {
		rpc_link->has_tag = 1;
		RMALLOCCOPY(client, rpc_link->tag.data, rpc_link->tag.len,
				rlink->tag.value, rlink->tag.len);
	}
}
예제 #2
0
파일: riack_helpers.c 프로젝트: ecks/riack
/**
 * Copy a RIACK_LINK structure to a RpbLink structure
 */
void riack_copy_link_to_rpblink(riack_client* client, riack_link* rlink, RpbLink* rpc_link)
{
	rpb_link__init(rpc_link);
	if (rlink->bucket.value) {
		rpc_link->has_bucket = 1;
		RMALLOCCOPY(client, rpc_link->bucket.data, rpc_link->bucket.len,
				rlink->bucket.value, rlink->bucket.len);
	}
	if (rlink->key.value) {
		rpc_link->has_key = 1;
		RMALLOCCOPY(client, rpc_link->key.data, rpc_link->key.len,
				rlink->key.value, rlink->key.len);
	}
	if (rlink->tag.value) {
		rpc_link->has_tag = 1;
		RMALLOCCOPY(client, rpc_link->tag.data, rpc_link->tag.len,
				rlink->tag.value, rlink->tag.len);
	}
}