From e560a3ed6cdd9f8c5c23ce54bf4e96f3ca7de4e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 22 May 2012 10:25:40 +0200 Subject: implement eiotas_door_add and eiotas_door_free --- src/lib/eiotas_door.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/lib/eiotas_door.c b/src/lib/eiotas_door.c index 2a18182..b8ea87f 100644 --- a/src/lib/eiotas_door.c +++ b/src/lib/eiotas_door.c @@ -25,13 +25,28 @@ EAPI Eiotas_Door* eiotas_door_add(const char* name, Eiotas_Room *parent, Eiotas_User_Bits *user_bits) { - // TODO - return NULL; + CHECK_PARENT(); + + CHECK_USERBITS(user_bits); + + BUILD_INSTANCE(Eiotas_Door,door); + + INIT_IOTA(&door->iota,name,parent,EIOTAS_TYPE_DOOR); + + ADD_TO_PARENT(parent,(&door->iota),"Door") + + memcpy(&door->user_bits,user_bits,sizeof(Eiotas_User_Bits)); + + return door; } void eiotas_door_free(Eiotas_Door *door) { DBG("Door free 0x%X",door); - // TODO + + eiotas_iota_desinit(&door->iota); + door->user_bits.free_fct(door->user_bits.data); + + free(door); } -- cgit v1.1-2-g2b99