summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2017-12-04 11:44:56 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2017-12-05 16:41:42 +0100
commit2a0f873c8427e08bc855b3ad03913c627e7dd939 (patch)
treee9767de654945f6e447ef27b6f7161183c2498fd
parente83e0897652bda4ecde28b7eeed7236c2b07ad39 (diff)
eolian: pass unit within validation engine
-rw-r--r--src/lib/eolian/database_validate.c179
-rw-r--r--src/lib/eolian/eolian_database.c9
-rw-r--r--src/lib/eolian/eolian_database.h2
3 files changed, 98 insertions, 92 deletions
diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c
index 7559303e24..0e60aeb50c 100644
--- a/src/lib/eolian/database_validate.c
+++ b/src/lib/eolian/database_validate.c
@@ -16,7 +16,7 @@ _validate(Eolian_Object *obj)
16} 16}
17 17
18static Eina_Bool 18static Eina_Bool
19_validate_docstr(Eina_Stringshare *str, const Eolian_Object *info) 19_validate_docstr(const Eolian_Unit *src, Eina_Stringshare *str, const Eolian_Object *info)
20{ 20{
21 if (!str || !str[0]) return EINA_TRUE; 21 if (!str || !str[0]) return EINA_TRUE;
22 22
@@ -30,8 +30,7 @@ _validate_docstr(Eina_Stringshare *str, const Eolian_Object *info)
30 eolian_doc_token_init(&tok); 30 eolian_doc_token_init(&tok);
31 while (ret && (doc = eolian_documentation_tokenize(doc, &tok))) 31 while (ret && (doc = eolian_documentation_tokenize(doc, &tok)))
32 if (eolian_doc_token_type_get(&tok) == EOLIAN_DOC_TOKEN_REF) 32 if (eolian_doc_token_type_get(&tok) == EOLIAN_DOC_TOKEN_REF)
33 /* FIXME: pass unit properly */ 33 if (eolian_doc_token_ref_get(src, &tok, NULL, NULL) == EOLIAN_DOC_REF_INVALID)
34 if (eolian_doc_token_ref_get(NULL, &tok, NULL, NULL) == EOLIAN_DOC_REF_INVALID)
35 { 34 {
36 char *refn = eolian_doc_token_text_get(&tok); 35 char *refn = eolian_doc_token_text_get(&tok);
37 _eolian_log_line(info->file, info->line, info->column, 36 _eolian_log_line(info->file, info->line, info->column,
@@ -47,53 +46,60 @@ _validate_docstr(Eina_Stringshare *str, const Eolian_Object *info)
47} 46}
48 47
49static Eina_Bool 48static Eina_Bool
50_validate_doc(Eolian_Documentation *doc) 49_validate_doc(const Eolian_Unit *src, Eolian_Documentation *doc)
51{ 50{
52 if (!doc) 51 if (!doc)
53 return EINA_TRUE; 52 return EINA_TRUE;
54 53
55 if (!_validate_docstr(doc->summary, &doc->base)) 54 if (!_validate_docstr(src, doc->summary, &doc->base))
56 return EINA_FALSE; 55 return EINA_FALSE;
57 if (!_validate_docstr(doc->description, &doc->base)) 56 if (!_validate_docstr(src, doc->description, &doc->base))
58 return EINA_FALSE; 57 return EINA_FALSE;
59 58
60 return _validate(&doc->base); 59 return _validate(&doc->base);
61} 60}
62 61
63static Eina_Bool _validate_type(Eolian_Type *tp); 62static Eina_Bool _validate_type(const Eolian_Unit *src, Eolian_Type *tp);
64static Eina_Bool _validate_expr(Eolian_Expression *expr, 63static Eina_Bool _validate_expr(const Eolian_Unit *src,
64 Eolian_Expression *expr,
65 const Eolian_Type *tp, 65 const Eolian_Type *tp,
66 Eolian_Expression_Mask msk); 66 Eolian_Expression_Mask msk);
67 67
68typedef struct _Cb_Ret
69{
70 const Eolian_Unit *unit;
71 Eina_Bool succ;
72} Cb_Ret;
73
68static Eina_Bool 74static Eina_Bool
69_sf_map_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, 75_sf_map_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED,
70 const Eolian_Struct_Type_Field *sf, Eina_Bool *sc) 76 const Eolian_Struct_Type_Field *sf, Cb_Ret *sc)
71{ 77{
72 *sc = _validate_type(sf->type); 78 sc->succ = _validate_type(sc->unit, sf->type);
73 79
74 if (!*sc) 80 if (!sc->succ)
75 return EINA_FALSE; 81 return EINA_FALSE;
76 82
77 *sc = _validate_doc(sf->doc); 83 sc->succ = _validate_doc(sc->unit, sf->doc);
78 84
79 return *sc; 85 return sc->succ;
80} 86}
81 87
82static Eina_Bool 88static Eina_Bool
83_ef_map_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, 89_ef_map_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED,
84 const Eolian_Enum_Type_Field *ef, Eina_Bool *sc) 90 const Eolian_Enum_Type_Field *ef, Cb_Ret *sc)
85{ 91{
86 if (ef->value) 92 if (ef->value)
87 *sc = _validate_expr(ef->value, NULL, EOLIAN_MASK_INT); 93 sc->succ = _validate_expr(sc->unit, ef->value, NULL, EOLIAN_MASK_INT);
88 else 94 else
89 *sc = EINA_TRUE; 95 sc->succ = EINA_TRUE;
90 96
91 if (!*sc) 97 if (!sc->succ)
92 return EINA_FALSE; 98 return EINA_FALSE;
93 99
94 *sc = _validate_doc(ef->doc); 100 sc->succ = _validate_doc(sc->unit, ef->doc);
95 101
96 return *sc; 102 return sc->succ;
97} 103}
98 104
99static Eina_Bool 105static Eina_Bool
@@ -104,27 +110,27 @@ _obj_error(const Eolian_Object *o, const char *msg)
104} 110}
105 111
106static Eina_Bool 112static Eina_Bool
107_validate_typedecl(Eolian_Typedecl *tp) 113_validate_typedecl(const Eolian_Unit *src, Eolian_Typedecl *tp)
108{ 114{
109 if (tp->base.validated) 115 if (tp->base.validated)
110 return EINA_TRUE; 116 return EINA_TRUE;
111 117
112 if (!_validate_doc(tp->doc)) 118 if (!_validate_doc(src, tp->doc))
113 return EINA_FALSE; 119 return EINA_FALSE;
114 120
115 switch (tp->type) 121 switch (tp->type)
116 { 122 {
117 case EOLIAN_TYPEDECL_ALIAS: 123 case EOLIAN_TYPEDECL_ALIAS:
118 if (!_validate_type(tp->base_type)) 124 if (!_validate_type(src, tp->base_type))
119 return EINA_FALSE; 125 return EINA_FALSE;
120 if (!tp->freefunc && tp->base_type->freefunc) 126 if (!tp->freefunc && tp->base_type->freefunc)
121 tp->freefunc = eina_stringshare_ref(tp->base_type->freefunc); 127 tp->freefunc = eina_stringshare_ref(tp->base_type->freefunc);
122 return _validate(&tp->base); 128 return _validate(&tp->base);
123 case EOLIAN_TYPEDECL_STRUCT: 129 case EOLIAN_TYPEDECL_STRUCT:
124 { 130 {
125 Eina_Bool succ = EINA_TRUE; 131 Cb_Ret rt = { src, EINA_TRUE };
126 eina_hash_foreach(tp->fields, (Eina_Hash_Foreach)_sf_map_cb, &succ); 132 eina_hash_foreach(tp->fields, (Eina_Hash_Foreach)_sf_map_cb, &rt);
127 if (!succ) 133 if (!rt.succ)
128 return EINA_FALSE; 134 return EINA_FALSE;
129 return _validate(&tp->base); 135 return _validate(&tp->base);
130 } 136 }
@@ -132,9 +138,9 @@ _validate_typedecl(Eolian_Typedecl *tp)
132 return _validate(&tp->base); 138 return _validate(&tp->base);
133 case EOLIAN_TYPEDECL_ENUM: 139 case EOLIAN_TYPEDECL_ENUM:
134 { 140 {
135 Eina_Bool succ = EINA_TRUE; 141 Cb_Ret rt = { src, EINA_TRUE };
136 eina_hash_foreach(tp->fields, (Eina_Hash_Foreach)_ef_map_cb, &succ); 142 eina_hash_foreach(tp->fields, (Eina_Hash_Foreach)_ef_map_cb, &rt);
137 if (!succ) 143 if (!rt.succ)
138 return EINA_FALSE; 144 return EINA_FALSE;
139 return _validate(&tp->base); 145 return _validate(&tp->base);
140 } 146 }
@@ -163,7 +169,7 @@ static const char *eo_value_free = "eina_value_flush";
163static const char *eo_value_ptr_free = "eina_value_free"; 169static const char *eo_value_ptr_free = "eina_value_free";
164 170
165static Eina_Bool 171static Eina_Bool
166_validate_type(Eolian_Type *tp) 172_validate_type(const Eolian_Unit *src, Eolian_Type *tp)
167{ 173{
168 char buf[256]; 174 char buf[256];
169 175
@@ -203,7 +209,7 @@ _validate_type(Eolian_Type *tp)
203 /* validate types in brackets so freefuncs get written... */ 209 /* validate types in brackets so freefuncs get written... */
204 while (itp) 210 while (itp)
205 { 211 {
206 if (!_validate_type(itp)) 212 if (!_validate_type(src, itp))
207 return EINA_FALSE; 213 return EINA_FALSE;
208 if ((kwid >= KW_accessor) && (kwid <= KW_list)) 214 if ((kwid >= KW_accessor) && (kwid <= KW_list))
209 { 215 {
@@ -253,7 +259,7 @@ _validate_type(Eolian_Type *tp)
253 snprintf(buf, sizeof(buf), "undefined type %s", tp->full_name); 259 snprintf(buf, sizeof(buf), "undefined type %s", tp->full_name);
254 return _obj_error(&tp->base, buf); 260 return _obj_error(&tp->base, buf);
255 } 261 }
256 if (!_validate_typedecl(tpp)) 262 if (!_validate_typedecl(src, tpp))
257 return EINA_FALSE; 263 return EINA_FALSE;
258 if (tpp->freefunc && !tp->freefunc) 264 if (tpp->freefunc && !tp->freefunc)
259 tp->freefunc = eina_stringshare_ref(tpp->freefunc); 265 tp->freefunc = eina_stringshare_ref(tpp->freefunc);
@@ -261,8 +267,7 @@ _validate_type(Eolian_Type *tp)
261 } 267 }
262 case EOLIAN_TYPE_CLASS: 268 case EOLIAN_TYPE_CLASS:
263 { 269 {
264 /* FIXME: pass unit properly */ 270 if (!eolian_type_class_get(src, tp))
265 if (!eolian_type_class_get(NULL, tp))
266 { 271 {
267 snprintf(buf, sizeof(buf), "undefined class %s " 272 snprintf(buf, sizeof(buf), "undefined class %s "
268 "(likely wrong namespacing)", tp->full_name); 273 "(likely wrong namespacing)", tp->full_name);
@@ -279,15 +284,14 @@ _validate_type(Eolian_Type *tp)
279} 284}
280 285
281static Eina_Bool 286static Eina_Bool
282_validate_expr(Eolian_Expression *expr, 287_validate_expr(const Eolian_Unit *src, Eolian_Expression *expr,
283 const Eolian_Type *tp, Eolian_Expression_Mask msk) 288 const Eolian_Type *tp, Eolian_Expression_Mask msk)
284{ 289{
285 Eolian_Value val; 290 Eolian_Value val;
286 /* FIXME: pass unit properly */
287 if (tp) 291 if (tp)
288 val = eolian_expression_eval_type(NULL, expr, tp); 292 val = eolian_expression_eval_type(src, expr, tp);
289 else 293 else
290 val = eolian_expression_eval(NULL, expr, msk); 294 val = eolian_expression_eval(src, expr, msk);
291 295
292 if (val.type == EOLIAN_EXPR_UNKNOWN) 296 if (val.type == EOLIAN_EXPR_UNKNOWN)
293 return EINA_FALSE; 297 return EINA_FALSE;
@@ -296,19 +300,19 @@ _validate_expr(Eolian_Expression *expr,
296} 300}
297 301
298static Eina_Bool 302static Eina_Bool
299_validate_param(Eolian_Function_Parameter *param) 303_validate_param(const Eolian_Unit *src, Eolian_Function_Parameter *param)
300{ 304{
301 if (!_validate_type(param->type)) 305 if (!_validate_type(src, param->type))
302 return EINA_FALSE; 306 return EINA_FALSE;
303 307
304 if (!_validate_doc(param->doc)) 308 if (!_validate_doc(src, param->doc))
305 return EINA_FALSE; 309 return EINA_FALSE;
306 310
307 return _validate(&param->base); 311 return _validate(&param->base);
308} 312}
309 313
310static Eina_Bool 314static Eina_Bool
311_validate_function(Eolian_Function *func, Eina_Hash *nhash) 315_validate_function(const Eolian_Unit *src, Eolian_Function *func, Eina_Hash *nhash)
312{ 316{
313 Eina_List *l; 317 Eina_List *l;
314 Eolian_Function_Parameter *param; 318 Eolian_Function_Parameter *param;
@@ -333,23 +337,23 @@ _validate_function(Eolian_Function *func, Eina_Hash *nhash)
333 _obj_error(&func->base, buf); 337 _obj_error(&func->base, buf);
334 } 338 }
335 339
336 if (func->get_ret_type && !_validate_type(func->get_ret_type)) 340 if (func->get_ret_type && !_validate_type(src, func->get_ret_type))
337 return EINA_FALSE; 341 return EINA_FALSE;
338 342
339 if (func->set_ret_type && !_validate_type(func->set_ret_type)) 343 if (func->set_ret_type && !_validate_type(src, func->set_ret_type))
340 return EINA_FALSE; 344 return EINA_FALSE;
341 345
342 if (func->get_ret_val && !_validate_expr(func->get_ret_val, 346 if (func->get_ret_val && !_validate_expr(src, func->get_ret_val,
343 func->get_ret_type, 0)) 347 func->get_ret_type, 0))
344 return EINA_FALSE; 348 return EINA_FALSE;
345 349
346 if (func->set_ret_val && !_validate_expr(func->set_ret_val, 350 if (func->set_ret_val && !_validate_expr(src, func->set_ret_val,
347 func->set_ret_type, 0)) 351 func->set_ret_type, 0))
348 return EINA_FALSE; 352 return EINA_FALSE;
349 353
350#define EOLIAN_PARAMS_VALIDATE(params) \ 354#define EOLIAN_PARAMS_VALIDATE(params) \
351 EINA_LIST_FOREACH(params, l, param) \ 355 EINA_LIST_FOREACH(params, l, param) \
352 if (!_validate_param(param)) \ 356 if (!_validate_param(src, param)) \
353 return EINA_FALSE; 357 return EINA_FALSE;
354 358
355 EOLIAN_PARAMS_VALIDATE(func->prop_values); 359 EOLIAN_PARAMS_VALIDATE(func->prop_values);
@@ -361,9 +365,9 @@ _validate_function(Eolian_Function *func, Eina_Hash *nhash)
361 365
362#undef EOLIAN_PARAMS_VALIDATE 366#undef EOLIAN_PARAMS_VALIDATE
363 367
364 if (!_validate_doc(func->get_return_doc)) 368 if (!_validate_doc(src, func->get_return_doc))
365 return EINA_FALSE; 369 return EINA_FALSE;
366 if (!_validate_doc(func->set_return_doc)) 370 if (!_validate_doc(src, func->set_return_doc))
367 return EINA_FALSE; 371 return EINA_FALSE;
368 372
369 /* just for now, when dups become errors there will be no need to check */ 373 /* just for now, when dups become errors there will be no need to check */
@@ -374,9 +378,9 @@ _validate_function(Eolian_Function *func, Eina_Hash *nhash)
374} 378}
375 379
376static Eina_Bool 380static Eina_Bool
377_validate_part(Eolian_Part *part, Eina_Hash *nhash) 381_validate_part(const Eolian_Unit *src, Eolian_Part *part, Eina_Hash *nhash)
378{ 382{
379 if (!_validate_doc(part->doc)) 383 if (!_validate_doc(src, part->doc))
380 return EINA_FALSE; 384 return EINA_FALSE;
381 385
382 const Eolian_Function *ofunc = eina_hash_find(nhash, part->name); 386 const Eolian_Function *ofunc = eina_hash_find(nhash, part->name);
@@ -394,32 +398,32 @@ _validate_part(Eolian_Part *part, Eina_Hash *nhash)
394} 398}
395 399
396static Eina_Bool 400static Eina_Bool
397_validate_event(Eolian_Event *event) 401_validate_event(const Eolian_Unit *src, Eolian_Event *event)
398{ 402{
399 if (event->type && !_validate_type(event->type)) 403 if (event->type && !_validate_type(src, event->type))
400 return EINA_FALSE; 404 return EINA_FALSE;
401 405
402 if (!_validate_doc(event->doc)) 406 if (!_validate_doc(src, event->doc))
403 return EINA_FALSE; 407 return EINA_FALSE;
404 408
405 return _validate(&event->base); 409 return _validate(&event->base);
406} 410}
407 411
408static Eina_Bool 412static Eina_Bool
409_validate_implement(Eolian_Implement *impl) 413_validate_implement(const Eolian_Unit *src, Eolian_Implement *impl)
410{ 414{
411 if (!_validate_doc(impl->common_doc)) 415 if (!_validate_doc(src, impl->common_doc))
412 return EINA_FALSE; 416 return EINA_FALSE;
413 if (!_validate_doc(impl->get_doc)) 417 if (!_validate_doc(src, impl->get_doc))
414 return EINA_FALSE; 418 return EINA_FALSE;
415 if (!_validate_doc(impl->set_doc)) 419 if (!_validate_doc(src, impl->set_doc))
416 return EINA_FALSE; 420 return EINA_FALSE;
417 421
418 return _validate(&impl->base); 422 return _validate(&impl->base);
419} 423}
420 424
421static Eina_Bool 425static Eina_Bool
422_validate_class(Eolian_Class *cl, Eina_Hash *nhash) 426_validate_class(const Eolian_Unit *src, Eolian_Class *cl, Eina_Hash *nhash)
423{ 427{
424 Eina_List *l; 428 Eina_List *l;
425 Eolian_Function *func; 429 Eolian_Function *func;
@@ -441,31 +445,31 @@ _validate_class(Eolian_Class *cl, Eina_Hash *nhash)
441 445
442 EINA_LIST_FOREACH(cl->inherits, l, icl) 446 EINA_LIST_FOREACH(cl->inherits, l, icl)
443 { 447 {
444 if (!(res = _validate_class(icl, nhash))) 448 if (!(res = _validate_class(src, icl, nhash)))
445 goto freehash; 449 goto freehash;
446 } 450 }
447 451
448 EINA_LIST_FOREACH(cl->properties, l, func) 452 EINA_LIST_FOREACH(cl->properties, l, func)
449 if (!(res = _validate_function(func, nhash))) 453 if (!(res = _validate_function(src, func, nhash)))
450 goto freehash; 454 goto freehash;
451 455
452 EINA_LIST_FOREACH(cl->methods, l, func) 456 EINA_LIST_FOREACH(cl->methods, l, func)
453 if (!(res = _validate_function(func, nhash))) 457 if (!(res = _validate_function(src, func, nhash)))
454 goto freehash; 458 goto freehash;
455 459
456 EINA_LIST_FOREACH(cl->events, l, event) 460 EINA_LIST_FOREACH(cl->events, l, event)
457 if (!(res = _validate_event(event))) 461 if (!(res = _validate_event(src, event)))
458 goto freehash; 462 goto freehash;
459 463
460 EINA_LIST_FOREACH(cl->parts, l, part) 464 EINA_LIST_FOREACH(cl->parts, l, part)
461 if (!(res = _validate_part(part, nhash))) 465 if (!(res = _validate_part(src, part, nhash)))
462 goto freehash; 466 goto freehash;
463 467
464 EINA_LIST_FOREACH(cl->implements, l, impl) 468 EINA_LIST_FOREACH(cl->implements, l, impl)
465 if (!(res = _validate_implement(impl))) 469 if (!(res = _validate_implement(src, impl)))
466 goto freehash; 470 goto freehash;
467 471
468 if (!(res = _validate_doc(cl->doc))) 472 if (!(res = _validate_doc(src, cl->doc)))
469 goto freehash; 473 goto freehash;
470 474
471freehash: 475freehash:
@@ -477,18 +481,18 @@ freehash:
477} 481}
478 482
479static Eina_Bool 483static Eina_Bool
480_validate_variable(Eolian_Variable *var) 484_validate_variable(const Eolian_Unit *src, Eolian_Variable *var)
481{ 485{
482 if (var->base.validated) 486 if (var->base.validated)
483 return EINA_TRUE; 487 return EINA_TRUE;
484 488
485 if (!_validate_type(var->base_type)) 489 if (!_validate_type(src, var->base_type))
486 return EINA_FALSE; 490 return EINA_FALSE;
487 491
488 if (var->value && !_validate_expr(var->value, var->base_type, 0)) 492 if (var->value && !_validate_expr(src, var->value, var->base_type, 0))
489 return EINA_FALSE; 493 return EINA_FALSE;
490 494
491 if (!_validate_doc(var->doc)) 495 if (!_validate_doc(src, var->doc))
492 return EINA_FALSE; 496 return EINA_FALSE;
493 497
494 return _validate(&var->base); 498 return _validate(&var->base);
@@ -496,53 +500,52 @@ _validate_variable(Eolian_Variable *var)
496 500
497static Eina_Bool 501static Eina_Bool
498_typedecl_map_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, 502_typedecl_map_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED,
499 Eolian_Typedecl *tp, Eina_Bool *sc) 503 Eolian_Typedecl *tp, Cb_Ret *sc)
500{ 504{
501 return (*sc = _validate_typedecl(tp)); 505 return (sc->succ = _validate_typedecl(sc->unit, tp));
502} 506}
503 507
504static Eina_Bool 508static Eina_Bool
505_var_map_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, 509_var_map_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED,
506 Eolian_Variable *var, Eina_Bool *sc) 510 Eolian_Variable *var, Cb_Ret *sc)
507{ 511{
508 return (*sc = _validate_variable(var)); 512 return (sc->succ = _validate_variable(sc->unit, var));
509} 513}
510 514
511Eina_Bool 515Eina_Bool
512database_validate() 516database_validate(const Eolian_Unit *src)
513{ 517{
514 Eolian_Class *cl; 518 Eolian_Class *cl;
515 519
516 /* FIXME: pass unit properly */ 520 Eina_Iterator *iter = eolian_all_classes_get(src);
517 Eina_Iterator *iter = eolian_all_classes_get(NULL);
518 EINA_ITERATOR_FOREACH(iter, cl) 521 EINA_ITERATOR_FOREACH(iter, cl)
519 if (cl->toplevel && !_validate_class(cl, NULL)) 522 if (cl->toplevel && !_validate_class(src, cl, NULL))
520 { 523 {
521 eina_iterator_free(iter); 524 eina_iterator_free(iter);
522 return EINA_FALSE; 525 return EINA_FALSE;
523 } 526 }
524 eina_iterator_free(iter); 527 eina_iterator_free(iter);
525 528
526 Eina_Bool succ = EINA_TRUE; 529 Cb_Ret rt = { src, EINA_TRUE };
527 530
528 eina_hash_foreach(_aliases, (Eina_Hash_Foreach)_typedecl_map_cb, &succ); 531 eina_hash_foreach(_aliases, (Eina_Hash_Foreach)_typedecl_map_cb, &rt);
529 if (!succ) 532 if (!rt.succ)
530 return EINA_FALSE; 533 return EINA_FALSE;
531 534
532 eina_hash_foreach(_structs, (Eina_Hash_Foreach)_typedecl_map_cb, &succ); 535 eina_hash_foreach(_structs, (Eina_Hash_Foreach)_typedecl_map_cb, &rt);
533 if (!succ) 536 if (!rt.succ)
534 return EINA_FALSE; 537 return EINA_FALSE;
535 538
536 eina_hash_foreach(_enums, (Eina_Hash_Foreach)_typedecl_map_cb, &succ); 539 eina_hash_foreach(_enums, (Eina_Hash_Foreach)_typedecl_map_cb, &rt);
537 if (!succ) 540 if (!rt.succ)
538 return EINA_FALSE; 541 return EINA_FALSE;
539 542
540 eina_hash_foreach(_globals, (Eina_Hash_Foreach)_var_map_cb, &succ); 543 eina_hash_foreach(_globals, (Eina_Hash_Foreach)_var_map_cb, &rt);
541 if (!succ) 544 if (!rt.succ)
542 return EINA_FALSE; 545 return EINA_FALSE;
543 546
544 eina_hash_foreach(_constants, (Eina_Hash_Foreach)_var_map_cb, &succ); 547 eina_hash_foreach(_constants, (Eina_Hash_Foreach)_var_map_cb, &rt);
545 if (!succ) 548 if (!rt.succ)
546 return EINA_FALSE; 549 return EINA_FALSE;
547 550
548 return EINA_TRUE; 551 return EINA_TRUE;
diff --git a/src/lib/eolian/eolian_database.c b/src/lib/eolian/eolian_database.c
index d2ae6a784f..e68e9d3b0a 100644
--- a/src/lib/eolian/eolian_database.c
+++ b/src/lib/eolian/eolian_database.c
@@ -779,7 +779,8 @@ eolian_file_parse(const char *filepath)
779 return NULL; 779 return NULL;
780 if (!_parse_deferred()) 780 if (!_parse_deferred())
781 return NULL; 781 return NULL;
782 if (!database_validate()) 782 /* FIXME: pass unit properly */
783 if (!database_validate(NULL))
783 return NULL; 784 return NULL;
784 return &unit_tmp; 785 return &unit_tmp;
785} 786}
@@ -802,7 +803,8 @@ eolian_all_eot_files_parse()
802 803
803 eina_hash_foreach(_tfilenames, _tfile_parse, &ret); 804 eina_hash_foreach(_tfilenames, _tfile_parse, &ret);
804 805
805 if (ret && !database_validate()) 806 /* FIXME: pass unit properly */
807 if (ret && !database_validate(NULL))
806 return EINA_FALSE; 808 return EINA_FALSE;
807 809
808 return ret; 810 return ret;
@@ -826,7 +828,8 @@ eolian_all_eo_files_parse()
826 828
827 eina_hash_foreach(_filenames, _file_parse, &ret); 829 eina_hash_foreach(_filenames, _file_parse, &ret);
828 830
829 if (ret && !database_validate()) 831 /* FIXME: pass unit properly */
832 if (ret && !database_validate(NULL))
830 return EINA_FALSE; 833 return EINA_FALSE;
831 834
832 return ret; 835 return ret;
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index e92cebdc3c..ad8dfdba54 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -315,7 +315,7 @@ int database_init(void);
315int database_shutdown(void); 315int database_shutdown(void);
316 316
317char *database_class_to_filename(const char *cname); 317char *database_class_to_filename(const char *cname);
318Eina_Bool database_validate(); 318Eina_Bool database_validate(const Eolian_Unit *src);
319 319
320void database_decl_add(Eina_Stringshare *name, Eolian_Declaration_Type type, 320void database_decl_add(Eina_Stringshare *name, Eolian_Declaration_Type type,
321 Eina_Stringshare *file, void *ptr); 321 Eina_Stringshare *file, void *ptr);