diff options
| author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-22 09:53:15 +0200 | 
|---|---|---|
| committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-22 09:53:15 +0200 | 
| commit | 1d3d33e7c300fa627823d50151dbeba835540d3e (patch) | |
| tree | fd6a0bfd018ee307ad9f0b5342b5a0eba6b79a6f /src/lib | |
| parent | 7e6d7b9fe180f8555e2ea2caa29fa3efb51707c3 (diff) | |
| download | edoors-1d3d33e7c300fa627823d50151dbeba835540d3e.zip edoors-1d3d33e7c300fa627823d50151dbeba835540d3e.tar.gz  | |
eiotas_private.h: add macros INIT_IOTA and ADD_TO_PARENT
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/eiotas_private.h | 13 | 
1 files changed, 13 insertions, 0 deletions
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  | 
