From: Daniel Kolesa Date: Wed, 27 May 2015 13:32:03 +0000 (+0100) Subject: eolian: allow a filename (rather than path) to be given to eolian_file_parse X-Git-Tag: v1.15.0-alpha1~442 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=742d7c394ca99587fbe01fb0da5fd744c7ffbaee;p=platform%2Fupstream%2Fefl.git eolian: allow a filename (rather than path) to be given to eolian_file_parse --- diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h index 0094ad0..c10db83 100644 --- a/src/lib/eolian/Eolian.h +++ b/src/lib/eolian/Eolian.h @@ -305,7 +305,13 @@ typedef enum /* * @brief Parse the given .eo or .eot file and fill the database. * + * The input can be either a full path to the file or only a filename. + * If it's a filename, it must be scanned for first. + * * @param[in] filepath Path to the file to parse. + * @return EINA_TRUE on success, EINA_FALSE on failure. + * + * @see eolian_directory_scan * * @ingroup Eolian */ diff --git a/src/lib/eolian/eolian_database.c b/src/lib/eolian/eolian_database.c index 94f6a9d..31a6d86 100644 --- a/src/lib/eolian/eolian_database.c +++ b/src/lib/eolian/eolian_database.c @@ -209,6 +209,7 @@ EAPI Eina_Bool eolian_file_parse(const char *filepath) { Eina_Bool is_eo; + const char *eopath; if (_database_init_count <= 0) return EINA_FALSE; is_eo = eina_str_has_suffix(filepath, EO_SUFFIX); @@ -217,7 +218,9 @@ eolian_file_parse(const char *filepath) fprintf(stderr, "eolian: file '%s' doesn't have a correct extension\n", filepath); return EINA_FALSE; } - return eo_parser_database_fill(filepath, !is_eo); + if (!(eopath = eina_hash_find(is_eo ? _filenames : _tfilenames, filepath))) + eopath = filepath; + return eo_parser_database_fill(eopath, !is_eo); } static Eina_Bool _tfile_parse(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, void *data, void *fdata)