summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2017-12-06 13:46:10 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2017-12-06 15:07:31 +0100
commit14cd25a8d33956d6a2ad5a5b833be0413ef84fac (patch)
tree7b4bad580fbe5c9c676589807fb9c4cecb58ed63 /src
parent763c634dced12e5973f05b0a1958e8e51b6fbff8 (diff)
eolian: create an internal temporary state
Diffstat (limited to 'src')
-rw-r--r--src/lib/eolian/eolian_database.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/lib/eolian/eolian_database.c b/src/lib/eolian/eolian_database.c
index 0a6601b539..fff1f4373a 100644
--- a/src/lib/eolian/eolian_database.c
+++ b/src/lib/eolian/eolian_database.c
@@ -33,6 +33,8 @@ Eina_Hash *_defereos = NULL;
33 33
34static Eolian_Unit *_cunit = NULL; 34static Eolian_Unit *_cunit = NULL;
35 35
36Eolian *_state = NULL;
37
36static int _database_init_count = 0; 38static int _database_init_count = 0;
37 39
38static void 40static void
@@ -66,6 +68,7 @@ database_init()
66 _parsingeos = eina_hash_string_small_new(NULL); 68 _parsingeos = eina_hash_string_small_new(NULL);
67 _defereos = eina_hash_string_small_new(NULL); 69 _defereos = eina_hash_string_small_new(NULL);
68 _units = eina_hash_stringshared_new(EINA_FREE_CB(database_unit_del)); 70 _units = eina_hash_stringshared_new(EINA_FREE_CB(database_unit_del));
71 _state = eolian_new();
69 return ++_database_init_count; 72 return ++_database_init_count;
70} 73}
71 74
@@ -81,6 +84,7 @@ database_shutdown()
81 84
82 if (_database_init_count == 0) 85 if (_database_init_count == 0)
83 { 86 {
87 eolian_free(_state);
84 eina_hash_free(_classes ); _classes = NULL; 88 eina_hash_free(_classes ); _classes = NULL;
85 eina_hash_free(_aliases ); _aliases = NULL; 89 eina_hash_free(_aliases ); _aliases = NULL;
86 eina_hash_free(_structs ); _structs = NULL; 90 eina_hash_free(_structs ); _structs = NULL;
@@ -611,12 +615,12 @@ database_unit_init(Eolian_Unit *unit, Eina_Stringshare *fname)
611 } 615 }
612 616
613 unit->children = eina_hash_stringshared_new(NULL); 617 unit->children = eina_hash_stringshared_new(NULL);
614 unit->classes = eina_hash_stringshared_new(NULL); 618 unit->classes = eina_hash_stringshared_new(EINA_FREE_CB(database_class_del));
615 unit->globals = eina_hash_stringshared_new(NULL); 619 unit->globals = eina_hash_stringshared_new(EINA_FREE_CB(database_var_del));
616 unit->constants = eina_hash_stringshared_new(NULL); 620 unit->constants = eina_hash_stringshared_new(EINA_FREE_CB(database_var_del));
617 unit->aliases = eina_hash_stringshared_new(NULL); 621 unit->aliases = eina_hash_stringshared_new(EINA_FREE_CB(database_typedecl_del));
618 unit->structs = eina_hash_stringshared_new(NULL); 622 unit->structs = eina_hash_stringshared_new(EINA_FREE_CB(database_typedecl_del));
619 unit->enums = eina_hash_stringshared_new(NULL); 623 unit->enums = eina_hash_stringshared_new(EINA_FREE_CB(database_typedecl_del));
620 624
621 if (fname) 625 if (fname)
622 _cunit = unit; 626 _cunit = unit;