From 9fca0e3b8d6517b85fa60271338873dd0127b62b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 22 May 2012 10:10:57 +0200 Subject: eiotas_private.h: add CHECK_USERBITS macro --- src/lib/eiotas_private.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/lib/eiotas_private.h b/src/lib/eiotas_private.h index d522e5d..c57b5a4 100644 --- a/src/lib/eiotas_private.h +++ b/src/lib/eiotas_private.h @@ -56,6 +56,22 @@ } \ eina_hash_direct_add(_parent->children,_iota->name,_iota); +#define CHECK_USERBITS(_userbits) \ + if(_userbits->data==NULL) { \ + ERR("userbits->data NULL is not allowed"); \ + return NULL; \ + } \ + if(_userbits->free_fct==NULL) { \ + ERR("userbits->free_fct NULL is not allowed"); \ + return NULL; \ + } \ + if(_userbits->recv_fct==NULL) { \ + ERR("userbits->recv_fct NULL is not allowed"); \ + return NULL; \ + } \ + +/* TODO userbits->start_fct; userbits->stop_fct; userbits->suspend_fct; userbits->resume_fct; */ + #ifdef CRITICAL #undef CRITICAL #endif -- cgit v1.1-2-g2b99