From 1d3d33e7c300fa627823d50151dbeba835540d3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 22 May 2012 09:53:15 +0200 Subject: eiotas_private.h: add macros INIT_IOTA and ADD_TO_PARENT --- src/lib/eiotas_private.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/lib/eiotas_private.h b/src/lib/eiotas_private.h index 67ed4f3..d522e5d 100644 --- a/src/lib/eiotas_private.h +++ b/src/lib/eiotas_private.h @@ -43,6 +43,19 @@ return NULL; \ } +#define INIT_IOTA(_iota,_name,_parent,_type) \ + if(eiotas_iota_init(_iota,_name,_parent,_type)) { \ + return NULL; \ + } + +#define ADD_TO_PARENT(_parent,_iota,_st_name) \ + if(eina_hash_find(_parent->children,_iota->name)) { \ + ERR("%s %s already exists in %s",_st_name,_iota->name,parent->iota.path); \ + eiotas_iota_desinit(_iota); \ + return NULL; \ + } \ + eina_hash_direct_add(_parent->children,_iota->name,_iota); + #ifdef CRITICAL #undef CRITICAL #endif -- cgit v1.1-2-g2b99