summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2017-12-15 17:10:40 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2017-12-15 17:11:11 +0100
commit373392d56e73cd29456a75ba5d3d79a73ee2a70b (patch)
tree8d90a985047a5e1bcda26445d016f2d6cc5721c2 /src/lib
parent18e18ca74c5456e0ecb7f03065959fb9fb7b58f4 (diff)
eolian: remove now unused database init/shutdown
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/eolian/eolian.c2
-rw-r--r--src/lib/eolian/eolian_database.c44
-rw-r--r--src/lib/eolian/eolian_database.h3
3 files changed, 12 insertions, 37 deletions
diff --git a/src/lib/eolian/eolian.c b/src/lib/eolian/eolian.c
index edb91829b2..4a38fb90db 100644
--- a/src/lib/eolian/eolian.c
+++ b/src/lib/eolian/eolian.c
@@ -36,7 +36,6 @@ EAPI int eolian_init(void)
36 return EINA_FALSE; 36 return EINA_FALSE;
37 } 37 }
38 38
39 database_init();
40 eo_lexer_init(); 39 eo_lexer_init();
41 return ++_eolian_init_counter; 40 return ++_eolian_init_counter;
42} 41}
@@ -58,7 +57,6 @@ EAPI int eolian_shutdown(void)
58 EINA_LOG_STATE_SHUTDOWN); 57 EINA_LOG_STATE_SHUTDOWN);
59 58
60 eo_lexer_shutdown(); 59 eo_lexer_shutdown();
61 database_shutdown();
62 eina_prefix_free(_eolian_prefix); 60 eina_prefix_free(_eolian_prefix);
63 _eolian_prefix = NULL; 61 _eolian_prefix = NULL;
64 62
diff --git a/src/lib/eolian/eolian_database.c b/src/lib/eolian/eolian_database.c
index fdba068728..8b82503e7e 100644
--- a/src/lib/eolian/eolian_database.c
+++ b/src/lib/eolian/eolian_database.c
@@ -8,34 +8,6 @@
8#include "eolian_database.h" 8#include "eolian_database.h"
9#include "eolian_priv.h" 9#include "eolian_priv.h"
10 10
11static int _database_init_count = 0;
12
13static void
14_hashlist_free(void *data)
15{
16 eina_list_free((Eina_List*)data);
17}
18
19int
20database_init()
21{
22 if (_database_init_count > 0) return ++_database_init_count;
23 return ++_database_init_count;
24}
25
26int
27database_shutdown()
28{
29 if (_database_init_count <= 0)
30 {
31 ERR("Init count not greater than 0 in shutdown.");
32 return 0;
33 }
34 _database_init_count--;
35
36 return _database_init_count;
37}
38
39void 11void
40database_decl_add(Eolian *state, Eina_Stringshare *name, 12database_decl_add(Eolian *state, Eina_Stringshare *name,
41 Eolian_Declaration_Type type, 13 Eolian_Declaration_Type type,
@@ -560,6 +532,12 @@ database_unit_del(Eolian_Unit *unit)
560 eina_hash_free(unit->decls); 532 eina_hash_free(unit->decls);
561} 533}
562 534
535static void
536_hashlist_free(void *data)
537{
538 eina_list_free((Eina_List*)data);
539}
540
563EAPI Eolian * 541EAPI Eolian *
564eolian_new(void) 542eolian_new(void)
565{ 543{
@@ -687,8 +665,7 @@ _eolian_file_parse_nodep(Eolian_Unit *parent, const char *filepath)
687{ 665{
688 Eina_Bool is_eo; 666 Eina_Bool is_eo;
689 const char *eopath; 667 const char *eopath;
690 if (_database_init_count <= 0) 668
691 return NULL;
692 is_eo = eina_str_has_suffix(filepath, EO_SUFFIX); 669 is_eo = eina_str_has_suffix(filepath, EO_SUFFIX);
693 if (!is_eo && !eina_str_has_suffix(filepath, EOT_SUFFIX)) 670 if (!is_eo && !eina_str_has_suffix(filepath, EOT_SUFFIX))
694 { 671 {
@@ -734,6 +711,9 @@ _parse_deferred(Eolian_Unit *parent)
734EAPI const Eolian_Unit * 711EAPI const Eolian_Unit *
735eolian_file_parse(Eolian *state, const char *filepath) 712eolian_file_parse(Eolian *state, const char *filepath)
736{ 713{
714 if (!state)
715 return NULL;
716
737 Eolian_Unit *ret = _eolian_file_parse_nodep((Eolian_Unit *)state, filepath); 717 Eolian_Unit *ret = _eolian_file_parse_nodep((Eolian_Unit *)state, filepath);
738 if (!ret) 718 if (!ret)
739 return NULL; 719 return NULL;
@@ -767,7 +747,7 @@ eolian_all_eot_files_parse(Eolian *state)
767{ 747{
768 Parse_Data pd = { state, EINA_TRUE }; 748 Parse_Data pd = { state, EINA_TRUE };
769 749
770 if (_database_init_count <= 0) 750 if (!state)
771 return EINA_FALSE; 751 return EINA_FALSE;
772 752
773 eina_hash_foreach(state->filenames_eot, _tfile_parse, &pd); 753 eina_hash_foreach(state->filenames_eot, _tfile_parse, &pd);
@@ -795,7 +775,7 @@ eolian_all_eo_files_parse(Eolian *state)
795{ 775{
796 Parse_Data pd = { state, EINA_TRUE }; 776 Parse_Data pd = { state, EINA_TRUE };
797 777
798 if (_database_init_count <= 0) 778 if (!state)
799 return EINA_FALSE; 779 return EINA_FALSE;
800 780
801 eina_hash_foreach(state->filenames_eo, _file_parse, &pd); 781 eina_hash_foreach(state->filenames_eo, _file_parse, &pd);
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index edef41e94c..e7e75393a4 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -314,9 +314,6 @@ struct _Eolian_Variable
314 Eina_Bool is_extern :1; 314 Eina_Bool is_extern :1;
315}; 315};
316 316
317int database_init(void);
318int database_shutdown(void);
319
320char *database_class_to_filename(const char *cname); 317char *database_class_to_filename(const char *cname);
321Eina_Bool database_validate(Eolian *state, const Eolian_Unit *src); 318Eina_Bool database_validate(Eolian *state, const Eolian_Unit *src);
322 319