eolian: eolian_file_parse -> eolian_state_file_parse
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Tue, 27 Feb 2018 14:59:53 +0000 (15:59 +0100)
committerWonki Kim <wonki_.kim@samsung.com>
Tue, 10 Apr 2018 11:10:41 +0000 (20:10 +0900)
src/lib/eolian/Eolian.h
src/lib/eolian/eolian_database.c

index 1afe024..a1e89b3 100644 (file)
@@ -531,6 +531,22 @@ EAPI Eina_Bool eolian_state_directory_add(Eolian_State *state, const char *dir);
 EAPI Eina_Bool eolian_state_system_directory_add(Eolian_State *state);
 
 /*
+ * @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] state The Eolian state.
+ * @param[in] filepath Path to the file to parse.
+ * @return The unit corresponding to the parsed file or NULL.
+ *
+ * @see eolian_state_directory_add
+ *
+ * @ingroup Eolian
+ */
+EAPI const Eolian_Unit *eolian_state_file_parse(Eolian_State *state, const char *filepath);
+
+/*
  * @brief Get an Eolian unit by file name.
  *
  * For any .eo or .eot file (must be within a directory previously scanned
@@ -583,22 +599,6 @@ EAPI Eina_Iterator *eolian_unit_children_get(const Eolian_Unit *unit);
 EAPI const char *eolian_unit_file_get(const Eolian_Unit *unit);
 
 /*
- * @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] state The Eolian state.
- * @param[in] filepath Path to the file to parse.
- * @return The unit corresponding to the parsed file or NULL.
- *
- * @see eolian_directory_scan
- *
- * @ingroup Eolian
- */
-EAPI const Eolian_Unit *eolian_file_parse(Eolian_State *state, const char *filepath);
-
-/*
  * @brief Get an iterator to all .eo file names with paths.
  *
  * @param[in] state The Eolian state.
@@ -2668,6 +2668,10 @@ EAPI Eina_Bool eolian_directory_scan(Eolian_State *state, const char *dir);
 /* DEPRECATED */
 EAPI Eina_Bool eolian_system_directory_scan(Eolian_State *state);
 
+/* DEPRECATED */
+EAPI const Eolian_Unit *eolian_file_parse(Eolian_State *state, const char *filepath);
+
+
 #endif
 
 /**
index 42c3881..3d5dedc 100644 (file)
@@ -662,54 +662,6 @@ eolian_system_directory_scan(Eolian_State *state)
    return eolian_state_system_directory_add(state);
 }
 
-EAPI const Eolian_Unit *
-eolian_state_unit_by_file_get(const Eolian_State *state, const char *file_name)
-{
-   if (!state) return NULL;
-   Eina_Stringshare *shr = eina_stringshare_add(file_name);
-   Eolian_Unit *unit = eina_hash_find(state->units, shr);
-   eina_stringshare_del(shr);
-   return unit;
-}
-
-EAPI Eina_Iterator *
-eolian_state_units_get(const Eolian_State *state)
-{
-   if (!state) return NULL;
-   return eina_hash_iterator_data_new(state->units);
-}
-
-EAPI Eina_Iterator *
-eolian_unit_children_get(const Eolian_Unit *unit)
-{
-   if (!unit) return NULL;
-   return eina_hash_iterator_data_new(unit->children);
-}
-
-EAPI const char *
-eolian_unit_file_get(const Eolian_Unit *unit)
-{
-   if (!unit) return NULL;
-   return unit->file;
-}
-
-char *
-database_class_to_filename(const char *cname)
-{
-   char *ret;
-   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);
-
-   eina_str_tolower(&ret);
-
-   return ret;
-}
-
 static Eolian_Unit *
 _eolian_file_parse_nodep(Eolian_Unit *parent, const char *filepath)
 {
@@ -814,7 +766,7 @@ _merge_units(Eolian_Unit *unit)
 }
 
 EAPI const Eolian_Unit *
-eolian_file_parse(Eolian_State *state, const char *filepath)
+eolian_state_file_parse(Eolian_State *state, const char *filepath)
 {
    if (!state)
      return NULL;
@@ -831,6 +783,12 @@ eolian_file_parse(Eolian_State *state, const char *filepath)
    return &state->unit;
 }
 
+EAPI const Eolian_Unit *
+eolian_file_parse(Eolian_State *state, const char *filepath)
+{
+   return eolian_state_file_parse(state, filepath);
+}
+
 typedef struct _Parse_Data
 {
    Eolian_State *state;
@@ -895,6 +853,54 @@ eolian_all_eo_files_parse(Eolian_State *state)
    return pd.ret;
 }
 
+EAPI const Eolian_Unit *
+eolian_state_unit_by_file_get(const Eolian_State *state, const char *file_name)
+{
+   if (!state) return NULL;
+   Eina_Stringshare *shr = eina_stringshare_add(file_name);
+   Eolian_Unit *unit = eina_hash_find(state->units, shr);
+   eina_stringshare_del(shr);
+   return unit;
+}
+
+EAPI Eina_Iterator *
+eolian_state_units_get(const Eolian_State *state)
+{
+   if (!state) return NULL;
+   return eina_hash_iterator_data_new(state->units);
+}
+
+EAPI Eina_Iterator *
+eolian_unit_children_get(const Eolian_Unit *unit)
+{
+   if (!unit) return NULL;
+   return eina_hash_iterator_data_new(unit->children);
+}
+
+EAPI const char *
+eolian_unit_file_get(const Eolian_Unit *unit)
+{
+   if (!unit) return NULL;
+   return unit->file;
+}
+
+char *
+database_class_to_filename(const char *cname)
+{
+   char *ret;
+   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);
+
+   eina_str_tolower(&ret);
+
+   return ret;
+}
+
 EAPI Eina_Iterator *
 eolian_all_eot_files_get(const Eolian_State *state)
 {