#ifdef EFL_BETA_API_SUPPORT
+/* State information
+ *
+ * @ingroup Eolian
+ */
+typedef struct _Eolian Eolian;
+
/* Class type used to extract information on classes
*
* @ingroup Eolian
EAPI int eolian_shutdown(void);
/*
- * @brief Create a new primary unit for Eolian state.
+ * @brief Create a new Eolian state.
+ *
+ * This creates a new Eolian state that consists of a "master unit" with
+ * the same address (therefore, you can cast it to Eolian_Unit) plus extra
+ * state information.
*
- * This creates a nameless "master unit" which holds all Eolian state.
* You need to free this with eolian_free once you're done.
*
- * @return A new master unit (or NULL on failure).
+ * @return A new state (or NULL on failure).
*
* @ingroup Eolian
*/
-EAPI Eolian_Unit *eolian_new(void);
+EAPI Eolian *eolian_new(void);
/*
- * @brief Free a master unit.
+ * @brief Free an Eolian state.
*
- * You can use this to free an Eolian state. Do not EVER use this to free
- * any unit other than master unit, as these are managed by the master unit
- * and freeing them would result in incorrect behavior.
+ * You can use this to free an Eolian state.
*
* If the input is NULL, this function has no effect.
*
- * @param[in] unit the master unit to free
+ * @param[in] unit the state to free
*
*/
-EAPI void eolian_free(Eolian_Unit *unit);
+EAPI void eolian_free(Eolian *state);
/*
* @brief Scan the given directory (recursively) and search for .eo and
eina_hash_free(unit->enums);
}
-EAPI Eolian_Unit *
+EAPI Eolian *
eolian_new(void)
{
- Eolian_Unit *nunit = calloc(1, sizeof(Eolian_Unit));
- if (!nunit)
+ Eolian *state = calloc(1, sizeof(Eolian));
+ if (!state)
return NULL;
- database_unit_init(nunit, NULL);
- return nunit;
+ database_unit_init(&state->unit, NULL);
+ return state;
}
EAPI void
-eolian_free(Eolian_Unit *unit)
+eolian_free(Eolian *state)
{
- database_unit_del(unit);
+ if (!state)
+ return;
+
+ database_unit_del(&state->unit);
+ free(state);
}
#define EO_SUFFIX ".eo"