q66 pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f851fa511e5b4fabac2002185b426445fc6ae208
commit f851fa511e5b4fabac2002185b426445fc6ae208 Author: Daniel Kolesa <d.kol...@osg.samsung.com> Date: Wed Nov 1 13:19:33 2017 +0100 eolian: add part validation (including dup check with funcs) --- src/lib/eolian/database_validate.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) 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) } static Eina_Bool +_validate_part(Eolian_Part *part, Eina_Hash *nhash) +{ + if (!_validate_doc(part->doc)) + return EINA_FALSE; + + const Eolian_Function *ofunc = eina_hash_find(nhash, part->name); + if (ofunc) + { + char buf[512]; + snprintf(buf, sizeof(buf), + "part '%s' conflicts with a function (defined at %s:%d:%d)", + part->name, ofunc->base.file, + ofunc->base.line, ofunc->base.column); + _obj_error(&part->base, buf); + } + + return _validate(&part->base); +} + +static Eina_Bool _validate_event(Eolian_Event *event) { if (event->type && !_validate_type(event->type)) @@ -381,6 +401,7 @@ _validate_class(Eolian_Class *cl, Eina_Hash *nhash) Eina_List *l; Eolian_Function *func; Eolian_Event *event; + Eolian_Part *part; Eolian_Implement *impl; Eolian_Class *icl; Eina_Bool res = EINA_TRUE; @@ -413,6 +434,10 @@ _validate_class(Eolian_Class *cl, Eina_Hash *nhash) if (!(res = _validate_event(event))) goto freehash; + EINA_LIST_FOREACH(cl->parts, l, part) + if (!(res = _validate_part(part, nhash))) + goto freehash; + EINA_LIST_FOREACH(cl->implements, l, impl) if (!(res = _validate_implement(impl))) goto freehash; --