diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-22 10:25:40 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-22 10:25:40 +0200 |
commit | e560a3ed6cdd9f8c5c23ce54bf4e96f3ca7de4e4 (patch) | |
tree | 6075e8050b2d99d8d8122ac015ef1a361f580927 /src | |
parent | d841d5f34a177d53cc4e910d75dd1cb1169eeda0 (diff) | |
download | edoors-e560a3ed6cdd9f8c5c23ce54bf4e96f3ca7de4e4.zip edoors-e560a3ed6cdd9f8c5c23ce54bf4e96f3ca7de4e4.tar.gz |
implement eiotas_door_add and eiotas_door_free
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/eiotas_door.c | 21 |
1 files 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); } |