summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@yahoo.com>2015-02-11 16:58:53 +0200
committerDaniel Zaoui <daniel.zaoui@yahoo.com>2015-02-12 15:58:50 +0200
commit2349e1ac41345ba73c2a2a1a0d8435114ba613ef (patch)
treea5aaabd346fc710fec4c8fc531fd03e029df4810
parent7415a5fc3643e16589867a8b496835afaa09f016 (diff)
Eolian: store the class filenames with the extensions.
This change is needed to give Espion a way to request the parsing of a class when a eo_add happens and the class is not known by Eolian.
-rw-r--r--src/lib/eolian/eo_parser.c8
-rw-r--r--src/lib/eolian/eolian_database.c5
2 files changed, 4 insertions, 9 deletions
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index 47923c8558..67047559ed 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -125,13 +125,9 @@ pop_str(Eo_Lexer *ls)
125} 125}
126 126
127static Eina_Bool 127static Eina_Bool
128compare_class_file(const char *fn_ext, const char *fn_noext) 128compare_class_file(const char *fn1, const char *fn2)
129{ 129{
130 int fnlen = strlen(fn_ext); 130 return !strcmp(fn1, fn2);
131 int cnlen = strlen(fn_noext);
132 if (cnlen != (fnlen - 3))
133 return EINA_FALSE;
134 return !strncmp(fn_noext, fn_ext, cnlen);
135} 131}
136 132
137static void 133static void
diff --git a/src/lib/eolian/eolian_database.c b/src/lib/eolian/eolian_database.c
index b8ed8b55be..f1f6067a98 100644
--- a/src/lib/eolian/eolian_database.c
+++ b/src/lib/eolian/eolian_database.c
@@ -120,12 +120,10 @@ join_path(const char *path, const char *file)
120static void 120static void
121_scan_cb(const char *name, const char *path, void *data EINA_UNUSED) 121_scan_cb(const char *name, const char *path, void *data EINA_UNUSED)
122{ 122{
123 size_t len;
124 Eina_Bool is_eo = eina_str_has_suffix(name, EO_SUFFIX); 123 Eina_Bool is_eo = eina_str_has_suffix(name, EO_SUFFIX);
125 if (!is_eo && !eina_str_has_suffix(name, EOT_SUFFIX)) return; 124 if (!is_eo && !eina_str_has_suffix(name, EOT_SUFFIX)) return;
126 len = strlen(name) - (is_eo ? sizeof(EO_SUFFIX) : sizeof(EOT_SUFFIX)) + 1;
127 eina_hash_add(is_eo ? _filenames : _tfilenames, 125 eina_hash_add(is_eo ? _filenames : _tfilenames,
128 eina_stringshare_add_length(name, len), join_path(path, name)); 126 eina_stringshare_add(name), join_path(path, name));
129} 127}
130 128
131EAPI Eina_Bool 129EAPI Eina_Bool
@@ -155,6 +153,7 @@ database_class_to_filename(const char *cname)
155 Eina_Strbuf *strbuf = eina_strbuf_new(); 153 Eina_Strbuf *strbuf = eina_strbuf_new();
156 eina_strbuf_append(strbuf, cname); 154 eina_strbuf_append(strbuf, cname);
157 eina_strbuf_replace_all(strbuf, ".", "_"); 155 eina_strbuf_replace_all(strbuf, ".", "_");
156 eina_strbuf_append(strbuf, ".eo");
158 157
159 ret = eina_strbuf_string_steal(strbuf); 158 ret = eina_strbuf_string_steal(strbuf);
160 eina_strbuf_free(strbuf); 159 eina_strbuf_free(strbuf);