summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2018-02-21 17:50:18 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2018-02-22 11:19:22 +0100
commit7b5a73b96765223ffcf1f74a7733beda655c33a0 (patch)
tree54928dc8c6297d4bc5f1e52c4c699bb7ae906281
parent8c7ba8c3a31ec671ccd6d7d30682dbd631d69a62 (diff)
eolian: add eolian_object_add wrapper
-rw-r--r--src/lib/eolian/eo_parser.c7
-rw-r--r--src/lib/eolian/eolian_database.h7
2 files changed, 9 insertions, 5 deletions
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index 031687a80c..3f888c5dc7 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -2287,12 +2287,9 @@ eo_parser_database_fill(Eolian_Unit *parent, const char *filename, Eina_Bool eot
2287 } 2287 }
2288 ls->tmp.kls = NULL; 2288 ls->tmp.kls = NULL;
2289 2289
2290 eina_hash_set(ls->state->unit.classes, cl->full_name, cl); 2290 eolian_object_add(&cl->base, cl->full_name, ls->unit->classes);
2291 eina_hash_set(ls->unit->classes, cl->full_name, cl); 2291 eolian_object_add(&cl->base, cl->full_name, ls->state->unit.classes);
2292 eina_hash_set(ls->state->classes_f, cl->base.file, cl); 2292 eina_hash_set(ls->state->classes_f, cl->base.file, cl);
2293 /* once for unit, once for state */
2294 eolian_object_ref(&cl->base);
2295 eolian_object_ref(&cl->base);
2296 2293
2297done: 2294done:
2298 ret = ls->unit; 2295 ret = ls->unit;
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index 5811e93cad..e7ae5f1bb3 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -84,6 +84,13 @@ eolian_object_unref(Eolian_Object *obj)
84 return (--obj->refcount > 0); 84 return (--obj->refcount > 0);
85} 85}
86 86
87static inline void
88eolian_object_add(Eolian_Object *obj, Eina_Stringshare *name, Eina_Hash *hash)
89{
90 eina_hash_add(hash, name, obj);
91 eolian_object_ref(obj);
92}
93
87struct _Eolian_Documentation 94struct _Eolian_Documentation
88{ 95{
89 Eolian_Object base; 96 Eolian_Object base;