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)
downloadefl-2349e1ac41345ba73c2a2a1a0d8435114ba613ef.tar.gz
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)
}
static Eina_Bool
-compare_class_file(const char *fn_ext, const char *fn_noext)
+compare_class_file(const char *fn1, const char *fn2)
{
- int fnlen = strlen(fn_ext);
- int cnlen = strlen(fn_noext);
- if (cnlen != (fnlen - 3))
- return EINA_FALSE;
- return !strncmp(fn_noext, fn_ext, cnlen);
+ return !strcmp(fn1, fn2);
}
static 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)
static void
_scan_cb(const char *name, const char *path, void *data EINA_UNUSED)
{
- size_t len;
Eina_Bool is_eo = eina_str_has_suffix(name, EO_SUFFIX);
if (!is_eo && !eina_str_has_suffix(name, EOT_SUFFIX)) return;
- len = strlen(name) - (is_eo ? sizeof(EO_SUFFIX) : sizeof(EOT_SUFFIX)) + 1;
eina_hash_add(is_eo ? _filenames : _tfilenames,
- eina_stringshare_add_length(name, len), join_path(path, name));
+ eina_stringshare_add(name), join_path(path, name));
}
EAPI Eina_Bool
@@ -155,6 +153,7 @@ database_class_to_filename(const char *cname)
Eina_Strbuf *strbuf = eina_strbuf_new();
eina_strbuf_append(strbuf, cname);
eina_strbuf_replace_all(strbuf, ".", "_");
+ eina_strbuf_append(strbuf, ".eo");
ret = eina_strbuf_string_steal(strbuf);
eina_strbuf_free(strbuf);