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; }
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; }