Esempio n. 1
0
CBAddressBroadcast * CBNewAddressBroadcast(bool timeStamps,void (*onErrorReceived)(CBError error,char *,...)){
	CBAddressBroadcast * self = malloc(sizeof(*self));
	if (NOT self) {
		onErrorReceived(CB_ERROR_OUT_OF_MEMORY,"Cannot allocate %i bytes of memory in CBNewAddressBroadcast\n",sizeof(*self));
		return NULL;
	}
	CBGetObject(self)->free = CBFreeAddressBroadcast;
	if (CBInitAddressBroadcast(self,timeStamps,onErrorReceived))
		return self;
	free(self);
	return NULL;
}
Esempio n. 2
0
CBAddressBroadcast * CBNewAddressBroadcast(bool timeStamps){
	CBAddressBroadcast * self = malloc(sizeof(*self));
	if (NOT self) {
		CBLogError("Cannot allocate %i bytes of memory in CBNewAddressBroadcast\n", sizeof(*self));
		return NULL;
	}
	CBGetObject(self)->free = CBFreeAddressBroadcast;
	if (CBInitAddressBroadcast(self, timeStamps))
		return self;
	free(self);
	return NULL;
}