Eolian_Class_Type eolian_class_type_get(const Eolian_Class *klass);
const Eolian_Documentation *eolian_class_documentation_get(const Eolian_Class *klass);
- const char *eolian_class_eo_prefix_get(const Eolian_Class *klass);
+ const char *eolian_class_c_prefix_get(const Eolian_Class *klass);
const char *eolian_class_event_prefix_get(const Eolian_Class *klass);
const char *eolian_class_data_type_get(const Eolian_Class *klass);
const Eolian_Class *eolian_class_parent_get(const Eolian_Class *klass);
const Eolian_Expression *eolian_expression_unary_expression_get(const Eolian_Expression *expr);
Eolian_Value_t eolian_expression_value_get(const Eolian_Expression *expr);
const Eolian_Documentation *eolian_constant_documentation_get(const Eolian_Constant *var);
- const Eolian_Type *eolian_constant_base_type_get(const Eolian_Constant *var);
+ const Eolian_Type *eolian_constant_type_get(const Eolian_Constant *var);
const Eolian_Expression *eolian_constant_value_get(const Eolian_Constant *var);
Eina_Bool eolian_constant_is_extern(const Eolian_Constant *var);
const char *eolian_documentation_summary_get(const Eolian_Documentation *doc);
return v
end,
- eo_prefix_get = function(self)
- local v = eolian.eolian_class_eo_prefix_get(self)
+ c_prefix_get = function(self)
+ local v = eolian.eolian_class_c_prefix_get(self)
if v == nil then
local buf = self:namespaces_get()
buf[#buf + 1] = self:short_name_get()
event_prefix_get = function(self)
local v = eolian.eolian_class_event_prefix_get(self)
if v == nil then
- return self:eo_prefix_get()
+ return self:c_prefix_get()
end
return ffi.string(v)
end,
return v
end,
- base_type_get = function(self)
- local v = eolian.eolian_constant_base_type_get(self)
+ type_get = function(self)
+ local v = eolian.eolian_constant_type_get(self)
if v == nil then return nil end
return v
end,
#include <Eina.h>
/**
- * @page eolian_main Eolian (BETA)
+ * @page eolian_main Eolian
*
* @date 2014 (created)
*
* @{
*/
-#ifdef EFL_BETA_API_SUPPORT
-
/* The maximum format version supported by this version of Eolian */
#define EOLIAN_FILE_FORMAT_VERSION 1
EOLIAN_TYPE_REGULAR,
EOLIAN_TYPE_CLASS,
EOLIAN_TYPE_ERROR,
+#ifdef EFL_BETA_API_SUPPORT
EOLIAN_TYPE_UNDEFINED
+#endif
} Eolian_Type_Type;
typedef enum
EOLIAN_TYPE_BUILTIN_ARRAY,
EOLIAN_TYPE_BUILTIN_FUTURE,
EOLIAN_TYPE_BUILTIN_ITERATOR,
- EOLIAN_TYPE_BUILTIN_HASH,
+ EOLIAN_TYPE_BUILTIN_HASH, /* FIXME: beta */
EOLIAN_TYPE_BUILTIN_LIST,
EOLIAN_TYPE_BUILTIN_ANY_VALUE,
EOLIAN_TYPE_BUILTIN_STRINGSHARE,
EOLIAN_TYPE_BUILTIN_STRBUF,
+#ifdef EOLIAN_BETA_API_SUPPORT
EOLIAN_TYPE_BUILTIN_VOID_PTR
+#endif
} Eolian_Type_Builtin_Type;
typedef enum
EAPI const Eolian_Documentation *eolian_class_documentation_get(const Eolian_Class *klass);
/*
- * @brief Returns the eo prefix of a class
+ * @brief Returns the C function prefix of a class
*
* @param[in] klass the class
* @return the eo prefix
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare* eolian_class_eo_prefix_get(const Eolian_Class *klass);
+EAPI Eina_Stringshare* eolian_class_c_prefix_get(const Eolian_Class *klass);
/*
* @brief Returns the event prefix of a class
EAPI Eina_Bool eolian_function_is_constructor(const Eolian_Function *function_id, const Eolian_Class *klass);
/*
- * @brief Get whether a function is a function pointer.
- *
- * @param[in] function_id Id of the function
- * @return EINA_TRUE and EINA_FALSE respectively
- *
- * @ingroup Eolian
- */
-EAPI Eina_Bool eolian_function_is_function_pointer(const Eolian_Function *function_id);
-
-/*
* @brief Returns an iterator to the parameter handles for a method/ctor/dtor.
*
* @param[in] function_id Id of the function
EAPI const Eolian_Expression *eolian_typedecl_enum_field_value_get(const Eolian_Enum_Type_Field *fl, Eina_Bool force);
/*
- * @brief Get the legacy prefix of enum field names. When not specified,
- * enum name is used.
- *
- * @param[in] tp the type declaration.
- * @return the legacy prefix or NULL.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Stringshare *eolian_typedecl_enum_legacy_prefix_get(const Eolian_Typedecl *tp);
-
-/*
* @brief Get the documentation of a struct/alias type.
*
* @param[in] tp the type declaration.
EAPI const Eolian_Error *eolian_type_error_get(const Eolian_Type *tp);
/*
- * @brief Get whether the given type is owned.
- *
- * This is true when a parameter, return or whatever is marked as @owned.
- *
- * @param[in] tp the type.
- * @return EINA_TRUE when the type is marked owned, EINA_FALSE otherwise.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Bool eolian_type_is_owned(const Eolian_Type *tp);
-
-/*
* @brief Get whether the given type is moved with its parent type.
*
* This is only used for inner types of complex types, i.e. the types
EAPI Eina_Bool eolian_type_is_const(const Eolian_Type *tp);
/*
- * @brief Get whether the given type is a reference.
- *
- * @param[in] tp the type.
- * @return EINA_TRUE when the type is marked ref, EINA_FALSE otherwise.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Bool eolian_type_is_ptr(const Eolian_Type *tp);
-
-/*
* @brief Get the full C type name of the given type.
*
* @param[in] tp the type.
*
* @ingroup Eolian
*/
-EAPI const Eolian_Type *eolian_constant_base_type_get(const Eolian_Constant *var);
+EAPI const Eolian_Type *eolian_constant_type_get(const Eolian_Constant *var);
/*
* @brief Get the value of a constant.
*/
EAPI Eolian_Object_Type eolian_doc_token_ref_resolve(const Eolian_Doc_Token *tok, const Eolian_State *state, const Eolian_Object **data, const Eolian_Object **data2);
-#endif
+#ifdef EFL_BETA_API_SUPPORT
+
+/*
+ * @brief Get the legacy prefix of enum field names. When not specified,
+ * enum name is used. (BETA)
+ *
+ * @param[in] tp the type declaration.
+ * @return the legacy prefix or NULL.
+ *
+ * @ingroup Eolian
+ */
+EAPI Eina_Stringshare *eolian_typedecl_enum_legacy_prefix_get(const Eolian_Typedecl *tp);
+
+/*
+ * @brief Get whether the given type is a reference.
+ *
+ * @param[in] tp the type.
+ * @return EINA_TRUE when the type is marked ref, EINA_FALSE otherwise.
+ *
+ * @ingroup Eolian
+ */
+EAPI Eina_Bool eolian_type_is_ptr(const Eolian_Type *tp);
+
+#endif /* EFL_BETA_API_SUPPORT */
/**
* @}
}
EAPI Eina_Stringshare*
-eolian_class_eo_prefix_get(const Eolian_Class *cl)
+eolian_class_c_prefix_get(const Eolian_Class *cl)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(cl, NULL);
return cl->c_prefix;
}
EAPI Eina_Bool
-eolian_type_is_owned(const Eolian_Type *tp)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(tp, EINA_FALSE);
- return tp->owned;
-}
-
-EAPI Eina_Bool
eolian_type_is_move(const Eolian_Type *tp)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, EINA_FALSE);
}
EAPI const Eolian_Type *
-eolian_constant_base_type_get(const Eolian_Constant *var)
+eolian_constant_type_get(const Eolian_Constant *var)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(var, NULL);
return var->base_type;
FILL_BASE(fdef->base, ls, fline, fcol, STRUCT_FIELD);
fdef->type = eo_lexer_type_release(ls, tp);
fdef->base.name = eina_stringshare_ref(fname);
- Eina_Bool has_owned = EINA_FALSE, has_by_ref = EINA_FALSE;
+ Eina_Bool has_move = EINA_FALSE, has_by_ref = EINA_FALSE;
for (;;) switch (ls->t.kw)
{
case KW_at_by_ref:
eo_lexer_get(ls);
break;
case KW_at_move:
- CASE_LOCK(ls, owned, "owned qualifier");
- fdef->type->owned = fdef->move = EINA_TRUE;
+ CASE_LOCK(ls, move, "move qualifier");
+ fdef->move = EINA_TRUE;
eo_lexer_get(ls);
break;
default:
def->base_type = eo_lexer_type_release(ls, parse_type(ls, EINA_TRUE));
/* view-only types are not allowed to own the contents */
if (tpid == KW_array || tpid == KW_hash || tpid == KW_list || tpid == KW_future)
- if ((def->base_type->owned = def->base_type->move = ls->t.kw == KW_at_move))
+ if ((def->base_type->move = ls->t.kw == KW_at_move))
eo_lexer_get(ls);
if (tpid == KW_hash)
{
check_next(ls, ',');
def->base_type->next_type =
eo_lexer_type_release(ls, parse_type(ls, EINA_TRUE));
- if ((def->base_type->next_type->owned = def->base_type->next_type->move = ls->t.kw == KW_at_move))
+ if ((def->base_type->next_type->move = ls->t.kw == KW_at_move))
eo_lexer_get(ls);
}
check_match(ls, '>', '<', bline, bcol);
Eolian_Documentation *doc;
Eolian_Expression *default_ret_val;
Eina_Bool no_unused: 1;
- Eina_Bool owned: 1;
+ Eina_Bool move: 1;
Eina_Bool by_ref: 1;
} Eo_Ret_Def;
ret->doc = NULL;
ret->default_ret_val = NULL;
ret->no_unused = EINA_FALSE;
- ret->owned = EINA_FALSE;
+ ret->move = EINA_FALSE;
ret->by_ref = EINA_FALSE;
if (allow_def && (ls->t.token == '('))
{
ls->expr_mode = EINA_FALSE;
check_match(ls, ')', '(', line, col);
}
- Eina_Bool has_no_unused = EINA_FALSE, has_owned = EINA_FALSE,
+ Eina_Bool has_no_unused = EINA_FALSE, has_move = EINA_FALSE,
has_by_ref = EINA_FALSE;
if (!is_funcptr) for (;;) switch (ls->t.kw)
{
eo_lexer_get(ls);
break;
case KW_at_move:
- CASE_LOCK(ls, owned, "owned qualifier");
- ret->owned = EINA_TRUE;
+ CASE_LOCK(ls, move, "move qualifier");
+ ret->move = EINA_TRUE;
eo_lexer_get(ls);
break;
case KW_at_by_ref:
Eina_Bool is_vals, const Eolian_Function *func)
{
Eina_Bool has_optional = EINA_FALSE,
- has_owned = EINA_FALSE,
+ has_move = EINA_FALSE,
has_by_ref = EINA_FALSE;
Eolian_Function_Parameter *par = calloc(1, sizeof(Eolian_Function_Parameter));
par->param_dir = EOLIAN_IN_PARAM;
eo_lexer_get(ls);
break;
case KW_at_move:
- CASE_LOCK(ls, owned, "owned qualifier");
- par->type->owned = par->move = EINA_TRUE;
+ CASE_LOCK(ls, move, "move qualifier");
+ par->move = EINA_TRUE;
eo_lexer_get(ls);
break;
case KW_at_by_ref:
prop->get_ret_val = ret.default_ret_val;
prop->get_return_no_unused = ret.no_unused;
prop->get_return_by_ref = ret.by_ref;
- prop->get_return_move = prop->get_ret_type->owned = ret.owned;
+ prop->get_return_move = ret.move;
}
else
{
prop->set_ret_val = ret.default_ret_val;
prop->set_return_no_unused = ret.no_unused;
prop->set_return_by_ref = ret.by_ref;
- prop->set_return_move = prop->set_ret_type->owned = ret.owned;
+ prop->set_return_move = ret.move;
}
break;
case KW_keys:
meth->get_ret_val = ret.default_ret_val;
meth->get_return_no_unused = ret.no_unused;
meth->get_return_by_ref = ret.by_ref;
- meth->get_return_move = meth->get_ret_type->owned = ret.owned;
+ meth->get_return_move = ret.move;
break;
case KW_params:
CASE_LOCK(ls, params, "params definition")
Eina_Bool is_const :1;
Eina_Bool is_ptr :1;
Eina_Bool move :1;
- Eina_Bool owned :1;
Eina_Bool ownable :1;
};
constant_def(Eolian_Constant const* constant, Eolian_Unit const* unit)
: name(::eolian_constant_short_name_get(constant))
, full_name(::eolian_constant_name_get(constant))
- , base_type(::eolian_constant_base_type_get(constant)
+ , base_type(::eolian_constant_type_get(constant)
, unit
- , ::eolian_type_c_type_get(eolian_constant_base_type_get(constant))
+ , ::eolian_type_c_type_get(eolian_constant_type_get(constant))
, value_ownership::unmoved
, is_by::value)
, documentation(::eolian_constant_documentation_get(constant))
return ret
@cached_property
- def eo_prefix(self):
- return _str_to_py(lib.eolian_class_eo_prefix_get(self))
+ def c_prefix(self):
+ return _str_to_py(lib.eolian_class_c_prefix_get(self))
@cached_property
def event_prefix(self):
return Class(c_cls) if c_cls else None
@cached_property
- def is_owned(self):
- return bool(lib.eolian_type_is_owned(self))
-
- @cached_property
def is_const(self):
return bool(lib.eolian_type_is_const(self))
return Expression(c_expr) if c_expr else None
@cached_property
- def base_type(self):
- c_type = lib.eolian_constant_base_type_get(self)
+ def type(self):
+ c_type = lib.eolian_constant_type_get(self)
return Type(c_type) if c_type else None
@cached_property
lib.eolian_class_documentation_get.argtypes = (c_void_p,)
lib.eolian_class_documentation_get.restype = c_void_p
-# EAPI Eina_Stringshare *eolian_class_eo_prefix_get(const Eolian_Class *klass);
-lib.eolian_class_eo_prefix_get.argtypes = (c_void_p,)
-lib.eolian_class_eo_prefix_get.restype = c_char_p
+# EAPI Eina_Stringshare *eolian_class_c_prefix_get(const Eolian_Class *klass);
+lib.eolian_class_c_prefix_get.argtypes = (c_void_p,)
+lib.eolian_class_c_prefix_get.restype = c_char_p
# EAPI Eina_Stringshare* eolian_class_event_prefix_get(const Eolian_Class *klass);
lib.eolian_class_event_prefix_get.argtypes = (c_void_p,)
lib.eolian_type_class_get.argtypes = (c_void_p,)
lib.eolian_type_class_get.restype = c_void_p
-# EAPI Eina_Bool eolian_type_is_owned(const Eolian_Type *tp);
-lib.eolian_type_is_owned.argtypes = (c_void_p,)
-lib.eolian_type_is_owned.restype = c_bool
-
# EAPI Eina_Bool eolian_type_is_const(const Eolian_Type *tp);
lib.eolian_type_is_const.argtypes = (c_void_p,)
lib.eolian_type_is_const.restype = c_bool
lib.eolian_constant_documentation_get.argtypes = (c_void_p,)
lib.eolian_constant_documentation_get.restype = c_void_p
-# EAPI const Eolian_Type *eolian_constant_base_type_get(const Eolian_Constant *var);
-lib.eolian_constant_base_type_get.argtypes = (c_void_p,)
-lib.eolian_constant_base_type_get.restype = c_void_p
+# EAPI const Eolian_Type *eolian_constant_type_get(const Eolian_Constant *var);
+lib.eolian_constant_type_get.argtypes = (c_void_p,)
+lib.eolian_constant_type_get.restype = c_void_p
# EAPI const Eolian_Expression *eolian_constant_value_get(const Eolian_Constant *var);
lib.eolian_constant_value_get.argtypes = (c_void_p,)
self.assertEqual(list(cls.namespaces), ['Efl'])
self.assertEqual(cls.type, eolian.Eolian_Class_Type.REGULAR)
self.assertIsInstance(cls.documentation, eolian.Documentation)
- self.assertIsNone(cls.eo_prefix) # TODO fin a class with a value
+ self.assertIsNone(cls.c_prefix) # TODO fin a class with a value
self.assertIsNone(cls.event_prefix) # TODO same as above
self.assertIsNone(cls.data_type) # TODO same as above
self.assertEqual(cls.parent.name, 'Efl.Loop_Consumer')
self.assertFalse(var.is_extern)
self.assertEqual(list(var.namespaces), ['Efl','Gfx'])
self.assertIsInstance(var.documentation, eolian.Documentation)
- self.assertIsInstance(var.base_type, eolian.Type)
+ self.assertIsInstance(var.type, eolian.Type)
self.assertIsInstance(var.value, eolian.Expression)
self.assertEqual(float(var.value.serialize), +1.0)
self.assertEqual(t.file, 'efl_loop_timer.eo') # TODO is this correct ?
self.assertIsNone(t.base_type) # TODO find a better test
self.assertIsNone(t.next_type) # TODO find a better test
- self.assertFalse(t.is_owned)
self.assertFalse(t.is_const)
self.assertFalse(t.is_ptr)
self.assertEqual(list(t.namespaces), [])
fail_if(eolian_class_type_get(class) != EOLIAN_CLASS_REGULAR);
fail_if(eolian_class_parent_get(class) != NULL);
fail_if(eolian_class_extensions_get(class) != NULL);
- fail_if(strcmp(eolian_class_eo_prefix_get(class), "efl_canvas_object_simple"));
+ fail_if(strcmp(eolian_class_c_prefix_get(class), "efl_canvas_object_simple"));
fail_if(strcmp(eolian_class_data_type_get(class), "Evas_Simple_Data"));
Eina_Stringshare *dt = eolian_class_c_data_type_get(class);
fail_if(strcmp(dt, "Evas_Simple_Data"));
/* regular constant */
fail_if(!(var = eolian_unit_constant_by_name_get(unit, "Foo")));
fail_if(eolian_constant_is_extern(var));
- fail_if(!(type = eolian_constant_base_type_get(var)));
+ fail_if(!(type = eolian_constant_type_get(var)));
fail_if(!(name = eolian_type_short_name_get(type)));
fail_if(strcmp(name, "int"));
fail_if(!(exp = eolian_constant_value_get(var)));
eina_stringshare_del(cname);
fail_if(!(var = eolian_unit_constant_by_name_get(unit, "Bah")));
- fail_if(!(type = eolian_constant_base_type_get(var)));
+ fail_if(!(type = eolian_constant_type_get(var)));
fail_if(!(name = eolian_type_short_name_get(type)));
fail_if(strcmp(name, "Baz"));
fail_if(!(exp = eolian_constant_value_get(var)));