summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/eolian/database_validate.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c
index 6ed286866b..22df42d8ff 100644
--- a/src/lib/eolian/database_validate.c
+++ b/src/lib/eolian/database_validate.c
@@ -351,6 +351,26 @@ _validate_function(Eolian_Function *func, Eina_Hash *nhash)
351} 351}
352 352
353static Eina_Bool 353static Eina_Bool
354_validate_part(Eolian_Part *part, Eina_Hash *nhash)
355{
356 if (!_validate_doc(part->doc))
357 return EINA_FALSE;
358
359 const Eolian_Function *ofunc = eina_hash_find(nhash, part->name);
360 if (ofunc)
361 {
362 char buf[512];
363 snprintf(buf, sizeof(buf),
364 "part '%s' conflicts with a function (defined at %s:%d:%d)",
365 part->name, ofunc->base.file,
366 ofunc->base.line, ofunc->base.column);
367 _obj_error(&part->base, buf);
368 }
369
370 return _validate(&part->base);
371}
372
373static Eina_Bool
354_validate_event(Eolian_Event *event) 374_validate_event(Eolian_Event *event)
355{ 375{
356 if (event->type && !_validate_type(event->type)) 376 if (event->type && !_validate_type(event->type))
@@ -381,6 +401,7 @@ _validate_class(Eolian_Class *cl, Eina_Hash *nhash)
381 Eina_List *l; 401 Eina_List *l;
382 Eolian_Function *func; 402 Eolian_Function *func;
383 Eolian_Event *event; 403 Eolian_Event *event;
404 Eolian_Part *part;
384 Eolian_Implement *impl; 405 Eolian_Implement *impl;
385 Eolian_Class *icl; 406 Eolian_Class *icl;
386 Eina_Bool res = EINA_TRUE; 407 Eina_Bool res = EINA_TRUE;
@@ -413,6 +434,10 @@ _validate_class(Eolian_Class *cl, Eina_Hash *nhash)
413 if (!(res = _validate_event(event))) 434 if (!(res = _validate_event(event)))
414 goto freehash; 435 goto freehash;
415 436
437 EINA_LIST_FOREACH(cl->parts, l, part)
438 if (!(res = _validate_part(part, nhash)))
439 goto freehash;
440
416 EINA_LIST_FOREACH(cl->implements, l, impl) 441 EINA_LIST_FOREACH(cl->implements, l, impl)
417 if (!(res = _validate_implement(impl))) 442 if (!(res = _validate_implement(impl)))
418 goto freehash; 443 goto freehash;