typedef struct _Eolian_Declaration Eolian_Declaration;
typedef struct _Eolian_Documentation Eolian_Documentation;
typedef struct _Eolian_Value Eolian_Value;
+ typedef struct _Eolian_Unit Eolian_Unit;
typedef enum
{
const char *text, *text_end;
} Eolian_Doc_Token;
- Eina_Bool eolian_file_parse(const char *filepath);
+ const Eolian_Unit *eolian_file_parse(const char *filepath);
Eina_Iterator *eolian_all_eo_file_paths_get(void);
Eina_Iterator *eolian_all_eot_file_paths_get(void);
Eina_Iterator *eolian_all_eo_files_get(void);
end
M.file_parse = function(fpath)
- return eolian.eolian_file_parse(fpath) ~= 0
+ return eolian.eolian_file_parse(fpath)
end
M.all_eo_files_parse = function()
* 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.
+ * @return The unit corresponding to the parsed file or NULL.
*
* @see eolian_directory_scan
*
* @ingroup Eolian
*/
-EAPI Eina_Bool eolian_file_parse(const char *filepath);
+EAPI const Eolian_Unit *eolian_file_parse(const char *filepath);
/*
* @brief Get an iterator to all .eo file names with paths.
return eo_parser_database_fill(eopath, !is_eo);
}
-EAPI Eina_Bool
+static Eolian_Unit unit_tmp;
+
+EAPI const Eolian_Unit *
eolian_file_parse(const char *filepath)
{
const char *dep;
if (!_eolian_file_parse_nodep(filepath))
- return EINA_FALSE;
+ return NULL;
/* parse doc dependencies (deferred eo files) */
Eina_Iterator *itr = eina_hash_iterator_data_new(_defereos);
EINA_ITERATOR_FOREACH(itr, dep)
{
eina_iterator_free(itr);
eina_hash_free_buckets(_defereos);
- return EINA_FALSE;
+ return NULL;
}
}
eina_iterator_free(itr);
eina_hash_free_buckets(_defereos);
- return EINA_TRUE;
+ return &unit_tmp;
}
static Eina_Bool _tfile_parse(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, void *data, void *fdata)
end
M.generate = function(fname, fstream)
- if not eolian.file_parse(fname) then
+ if eolian.file_parse(fname) == nil then
error("Failed parsing file: " .. fname)
end
if not eolian.database_validate() then