aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2018-03-16 00:14:13 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2018-03-16 00:14:13 +0100
commit6c0180d7f852a1399990140142f40018ebc99349 (patch)
treebc5fe8934fde262dbe365cff436031d1bfc278a5
parenteolian: fix unit child management (diff)
downloadefl-6c0180d7f852a1399990140142f40018ebc99349.tar.gz
eolian: more stringent and fine-grained validation
-rw-r--r--src/lib/eolian/database_validate.c16
-rw-r--r--src/lib/eolian/eolian_database.c6
-rw-r--r--src/lib/eolian/eolian_database.h2
3 files changed, 12 insertions, 12 deletions
diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c
index b2e078062a..3536a0531d 100644
--- a/src/lib/eolian/database_validate.c
+++ b/src/lib/eolian/database_validate.c
@@ -417,7 +417,7 @@ _validate_part(const Eolian_Unit *src, Eolian_Part *part, Eina_Hash *nhash)
return EINA_FALSE;
/* switch the class name for class */
- Eolian_Class *pcl = eina_hash_find(src->state->unit.classes, part->klass_name);
+ Eolian_Class *pcl = eina_hash_find(src->classes, part->klass_name);
if (!pcl)
{
char buf[PATH_MAX];
@@ -677,7 +677,7 @@ _db_fill_inherits(const Eolian_Unit *src, Eolian_Class *cl, Eina_Hash *fhash)
eina_stringshare_del(inn);
continue;
}
- Eolian_Class *icl = eina_hash_find(src->state->unit.classes, inn);
+ Eolian_Class *icl = eina_hash_find(src->classes, inn);
if (!icl)
{
succ = EINA_FALSE;
@@ -846,7 +846,7 @@ _var_map_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED,
}
Eina_Bool
-database_validate(Eolian_State *state, const Eolian_Unit *src)
+database_validate(const Eolian_Unit *src)
{
Eolian_Class *cl;
@@ -888,23 +888,23 @@ database_validate(Eolian_State *state, const Eolian_Unit *src)
Cb_Ret rt = { src, &vals, EINA_TRUE };
- eina_hash_foreach(state->unit.aliases, (Eina_Hash_Foreach)_typedecl_map_cb, &rt);
+ eina_hash_foreach(src->aliases, (Eina_Hash_Foreach)_typedecl_map_cb, &rt);
if (!rt.succ)
return EINA_FALSE;
- eina_hash_foreach(state->unit.structs, (Eina_Hash_Foreach)_typedecl_map_cb, &rt);
+ eina_hash_foreach(src->structs, (Eina_Hash_Foreach)_typedecl_map_cb, &rt);
if (!rt.succ)
return EINA_FALSE;
- eina_hash_foreach(state->unit.enums, (Eina_Hash_Foreach)_typedecl_map_cb, &rt);
+ eina_hash_foreach(src->enums, (Eina_Hash_Foreach)_typedecl_map_cb, &rt);
if (!rt.succ)
return EINA_FALSE;
- eina_hash_foreach(state->unit.globals, (Eina_Hash_Foreach)_var_map_cb, &rt);
+ eina_hash_foreach(src->globals, (Eina_Hash_Foreach)_var_map_cb, &rt);
if (!rt.succ)
return EINA_FALSE;
- eina_hash_foreach(state->unit.constants, (Eina_Hash_Foreach)_var_map_cb, &rt);
+ eina_hash_foreach(src->constants, (Eina_Hash_Foreach)_var_map_cb, &rt);
if (!rt.succ)
return EINA_FALSE;
diff --git a/src/lib/eolian/eolian_database.c b/src/lib/eolian/eolian_database.c
index f3fc255ad8..ef96b1a1ef 100644
--- a/src/lib/eolian/eolian_database.c
+++ b/src/lib/eolian/eolian_database.c
@@ -806,7 +806,7 @@ eolian_state_file_parse(Eolian_State *state, const char *filepath)
if (!_parse_deferred(ret))
return NULL;
_merge_units(ret);
- if (!database_validate(state, ret))
+ if (!database_validate(ret))
return NULL;
return &state->unit;
}
@@ -839,7 +839,7 @@ eolian_state_all_eot_files_parse(Eolian_State *state)
eina_hash_foreach(state->filenames_eot, _tfile_parse, &pd);
- if (pd.ret && !database_validate(state, &state->unit))
+ if (pd.ret && !database_validate(&state->unit))
return EINA_FALSE;
return pd.ret;
@@ -867,7 +867,7 @@ eolian_state_all_eo_files_parse(Eolian_State *state)
eina_hash_foreach(state->filenames_eo, _file_parse, &pd);
- if (pd.ret && !database_validate(state, &state->unit))
+ if (pd.ret && !database_validate(&state->unit))
return EINA_FALSE;
return pd.ret;
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index 347974b7ce..28ff7879dc 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -314,7 +314,7 @@ struct _Eolian_Variable
};
char *database_class_to_filename(const char *cname);
-Eina_Bool database_validate(Eolian_State *state, const Eolian_Unit *src);
+Eina_Bool database_validate(const Eolian_Unit *src);
void database_object_add(Eolian_Unit *unit, const Eolian_Object *obj);