Esempio n. 1
0
CBInventoryBroadcast * CBNewInventoryBroadcastFromData(CBByteArray * data,void (*onErrorReceived)(CBError error,char *,...)){
	CBInventoryBroadcast * self = malloc(sizeof(*self));
	if (NOT self) {
		onErrorReceived(CB_ERROR_OUT_OF_MEMORY,"Cannot allocate %i bytes of memory in CBNewInventoryBroadcastFromData\n",sizeof(*self));
		return NULL;
	}
	CBGetObject(self)->free = CBFreeInventoryBroadcast;
	if(CBInitInventoryBroadcastFromData(self,data,onErrorReceived))
		return self;
	free(self);
	return NULL;
}
Esempio n. 2
0
CBInventoryBroadcast * CBNewInventoryBroadcastFromData(CBByteArray * data,CBEvents * events){
	CBInventoryBroadcast * self = malloc(sizeof(*self));
	CBGetObject(self)->free = CBFreeInventoryBroadcast;
	CBInitInventoryBroadcastFromData(self,data,events);
	return self;
}