const char *
_get_add_star(Eolian_Function_Type ftype, Eolian_Parameter_Dir pdir)
{
- switch (ftype)
- {
- case EOLIAN_PROP_GET:
- if (pdir == EOLIAN_REF_PARAM)
- return "**";
- else
- return "*";
- case EOLIAN_PROP_SET:
- if (pdir == EOLIAN_REF_PARAM)
- return "*";
- else
- return "";
- default:
- if (pdir != EOLIAN_IN_PARAM)
- return "*";
- else
- return "";
- }
+ if (ftype == EOLIAN_PROP_GET)
+ return "*";
+ if ((pdir == EOLIAN_OUT_PARAM) || (pdir == EOLIAN_INOUT_PARAM))
+ return "*";
return "";
}
-
-Eina_Stringshare *
-_get_rettype(const Eolian_Type *tp, Eina_Bool add_star)
-{
- Eina_Stringshare *rtp = eolian_type_c_type_get(tp);
- if (!add_star || !rtp) return rtp;
- char buf[1024];
- snprintf(buf, sizeof(buf), "%s%s", rtp, (rtp[strlen(rtp) - 1] == '*') ? "*" : " *");
- eina_stringshare_del(rtp);
- return eina_stringshare_add(buf);
-}
void _class_func_env_create(const Eolian_Class *class, const char *funcname, Eolian_Function_Type ftype EINA_UNUSED, _eolian_class_func_vars *env);
const char *_get_add_star(Eolian_Function_Type ftype, Eolian_Parameter_Dir pdir);
-Eina_Stringshare *_get_rettype(const Eolian_Type *tp, Eina_Bool add_star);
#endif
switch (dir)
{
case EOLIAN_IN_PARAM:
- case EOLIAN_REF_PARAM:
eina_strbuf_append(buf, " * @param[in] ");
curl += sizeof(" * @param[in] ") - 1;
break;
_class_func_env_create(class, eolian_function_name_get(func), ftype, &func_env);
rettypet = eolian_function_return_type_get(func, ftype);
- Eina_Bool add_rstar = eolian_function_return_is_ref(func, ftype);
if (ftype == EOLIAN_PROP_GET && !rettypet)
{
itr = eolian_property_values_get(func, ftype);
eina_iterator_free(itr);
}
- if (rettypet) rettype = _get_rettype(rettypet, add_rstar);
+ if (rettypet) rettype = eolian_type_c_type_get(rettypet);
eina_strbuf_replace_all(str_func, "@#rettype", rettype ? rettype : "void");
if (!rettype || rettype[strlen(rettype) - 1] != '*')
Eina_Strbuf *params_init = eina_strbuf_new(); /* init of variables to default */
rettypet = eolian_function_return_type_get(funcid, ftype);
- Eina_Bool add_rstar = eolian_function_return_is_ref(funcid, ftype);
if (rettypet)
{
is_auto = EINA_FALSE; /* We block auto when the function has to return something */
eina_iterator_free(itr);
}
- if (rettypet) rettype = _get_rettype(rettypet, add_rstar);
+ if (rettypet) rettype = eolian_type_c_type_get(rettypet);
if (need_implementation)
{
printf("Generation of function %s\n", func_name);
const Eolian_Type *rettypet = eolian_function_return_type_get(foo, ftype);
- Eina_Bool add_rstar = eolian_function_return_is_ref(foo, ftype);
if (ftype == EOLIAN_PROP_GET && !rettypet)
{
Eina_Iterator *itr = eolian_property_values_get(foo, ftype);
}
const char *rettype = NULL;
- if (rettypet) rettype = _get_rettype(rettypet, add_rstar);
+ if (rettypet) rettype = eolian_type_c_type_get(rettypet);
eina_strbuf_append_printf(buffer,
"EOLIAN static %s\n%s(%sEo *obj, %s *pd%s%s)\n{\n%s\n}\n\n",
_class_func_env_create(class, funcname, ftype, &func_env);
rettypet = eolian_function_return_type_get(funcid, ftype);
- Eina_Bool add_rstar = eolian_function_return_is_ref(funcid, ftype);
if (ftype == EOLIAN_PROP_GET)
{
if (!rettypet)
if (!eina_strbuf_length_get(fparam)) eina_strbuf_append(fparam, "void");
if (flags) eina_strbuf_append_printf(flags, ")");
- if (rettypet) rettype = _get_rettype(rettypet, add_rstar);
+ if (rettypet) rettype = eolian_type_c_type_get(rettypet);
eina_strbuf_replace_all(fbody, "@#params", eina_strbuf_string_get(fparam));
eina_strbuf_reset(fparam);
_class_func_env_create(class, eolian_function_name_get(funcid), ftype, &func_env);
rettypet = eolian_function_return_type_get(funcid, ftype);
- Eina_Bool add_rstar = eolian_function_return_is_ref(funcid, ftype);
- if (rettypet) rettype = _get_rettype(rettypet, add_rstar);
+ if (rettypet) rettype = eolian_type_c_type_get(rettypet);
if (rettype && !strcmp(rettype, "void")) ret_is_void = EINA_TRUE;
retname = "ret";
if (ftype == EOLIAN_PROP_GET)
if (func_env.legacy_func[0] == '\0') goto end;
- if (!rettype && rettypet) rettype = _get_rettype(rettypet, add_rstar);
+ if (!rettype && rettypet) rettype = eolian_type_c_type_get(rettypet);
if (rettype && (!ret_is_void))
eina_strbuf_append(fbody, tmpl_eapi_body);
{
const Eolian_Type *type = eolian_typedecl_struct_field_type_get(member);
Eina_Stringshare *c_type = eolian_type_c_type_get(type);
- Eina_Bool is_ref = eolian_typedecl_struct_field_is_ref(member);
- eina_strbuf_append_printf(buf, " %s%s%s%s;",
- c_type, is_ref ? (strchr(c_type, '*') ? "*" : " *") : "", (is_ref || strchr(c_type, '*'))?"":" ",
+ eina_strbuf_append_printf(buf, " %s%s%s;",
+ c_type, strchr(c_type, '*')?"":" ",
eolian_typedecl_struct_field_name_get(member));
const Eolian_Documentation *fdoc
= eolian_typedecl_struct_field_documentation_get(member);
{
EOLIAN_IN_PARAM = 0,
EOLIAN_OUT_PARAM,
- EOLIAN_INOUT_PARAM,
- EOLIAN_REF_PARAM
+ EOLIAN_INOUT_PARAM
} Eolian_Parameter_Dir;
typedef enum
const char *eolian_typedecl_struct_field_name_get(const Eolian_Struct_Type_Field *fl);
const Eolian_Documentation *eolian_typedecl_struct_field_documentation_get(const Eolian_Struct_Type_Field *fl);
const Eolian_Type *eolian_typedecl_struct_field_type_get(const Eolian_Struct_Type_Field *fl);
- Eina_Bool eolian_typedecl_struct_field_is_ref(const Eolian_Struct_Type_Field *fl);
Eina_Iterator *eolian_typedecl_enum_fields_get(const Eolian_Typedecl *tp);
const Eolian_Enum_Type_Field *eolian_typedecl_enum_field_get(const Eolian_Typedecl *tp, const char *field);
const char *eolian_typedecl_enum_field_name_get(const Eolian_Enum_Type_Field *fl);
const Eolian_Class *eolian_type_class_get(const Eolian_Type *tp);
Eina_Bool eolian_type_is_own(const Eolian_Type *tp);
Eina_Bool eolian_type_is_const(const Eolian_Type *tp);
+ Eina_Bool eolian_type_is_ref(const Eolian_Type *tp);
Eina_Bool eolian_typedecl_is_extern(const Eolian_Typedecl *tp);
local v = eolian.eolian_typedecl_struct_field_type_get(self)
if v == nil then return nil end
return v
- end,
-
- is_ref = function(self)
- return eolian.eolian_typedecl_struct_field_is_ref(self) ~= 0
end
}
})
return eolian.eolian_type_is_const(self) ~= 0
end,
+ is_ref = function(self)
+ return eolian.eolian_type_is_ref(self) ~= 0
+ end,
+
c_type_get = function(self)
local v = eolian.eolian_type_c_type_get(self)
if v == nil then return nil end
M.parameter_dir = {
IN = 0,
OUT = 1,
- INOUT = 2,
- REF = 3
+ INOUT = 2
}
ffi.metatype("Eolian_Function_Parameter", {
{
EOLIAN_IN_PARAM = 0,
EOLIAN_OUT_PARAM,
- EOLIAN_INOUT_PARAM,
- EOLIAN_REF_PARAM
+ EOLIAN_INOUT_PARAM
} Eolian_Parameter_Dir;
typedef enum
EAPI Eina_Bool eolian_function_return_is_warn_unused(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
/*
- * @brief Indicates if a function returns a ref (pointer).
- *
- * @param[in] function_id id of the function
- * @param[in] ftype type of the function
- * @return EINA_TRUE is ref return, EINA_FALSE otherwise.
- *
- * The type of the function is needed because a given function can represent a
- * property, that can be set and get functions.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Bool eolian_function_return_is_ref(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
-
-/*
* @brief Indicates if a function object is const.
*
* @param[in] function_id id of the function
EAPI const Eolian_Type *eolian_typedecl_struct_field_type_get(const Eolian_Struct_Type_Field *fl);
/*
- * @brief Check if a struct field is a reference.
- *
- * @param[in] fl the field.
- * @return EINA_TRUE if it is, EINA_FALSE otherwise.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Bool eolian_typedecl_struct_field_is_ref(const Eolian_Struct_Type_Field *fl);
-
-/*
* @brief Get an iterator to all fields of an enum type.
*
* @param[in] tp the type declaration.
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_ref(const Eolian_Type *tp);
+
+/*
* @brief Get the full C type name of the given type.
*
* @param[in] tp the type.
}
EAPI Eina_Bool
-eolian_function_return_is_ref(const Eolian_Function *fid,
- Eolian_Function_Type ftype)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
- switch (ftype)
- {
- case EOLIAN_PROP_SET: return fid->set_return_is_ref;
- case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_PROP_GET: return fid->get_return_is_ref;
- default: return EINA_FALSE;
- }
-}
-
-EAPI Eina_Bool
eolian_function_object_is_const(const Eolian_Function *fid)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
}
void
-database_type_to_str(const Eolian_Type *tp, Eina_Strbuf *buf, const char *name, Eina_Bool is_ref)
+database_type_to_str(const Eolian_Type *tp, Eina_Strbuf *buf, const char *name)
{
if ((tp->type == EOLIAN_TYPE_REGULAR
|| tp->type == EOLIAN_TYPE_COMPLEX
else
{
Eolian_Type *btp = tp->base_type;
- database_type_to_str(tp->base_type, buf, NULL, EINA_FALSE);
+ database_type_to_str(tp->base_type, buf, NULL);
if (btp->type != EOLIAN_TYPE_POINTER || btp->is_const)
eina_strbuf_append_char(buf, ' ');
eina_strbuf_append_char(buf, '*');
}
if (tp->type == EOLIAN_TYPE_COMPLEX || tp->type == EOLIAN_TYPE_CLASS)
eina_strbuf_append(buf, " *");
- if (is_ref)
+ if (tp->is_ref)
{
if (eina_strbuf_string_get(buf)[eina_strbuf_length_get(buf) - 1] != '*')
eina_strbuf_append_char(buf, ' ');
eina_strbuf_append(buf, " { ");
EINA_LIST_FOREACH(tp->field_list, l, sf)
{
- database_type_to_str(sf->type, buf, sf->name, sf->is_ref);
+ database_type_to_str(sf->type, buf, sf->name);
eina_strbuf_append(buf, "; ");
}
eina_strbuf_append(buf, "}");
Eina_Strbuf *fulln = eina_strbuf_new();
_append_name(tp, fulln);
- database_type_to_str(tp->base_type, buf, eina_strbuf_string_get(fulln), EINA_FALSE);
+ database_type_to_str(tp->base_type, buf, eina_strbuf_string_get(fulln));
eina_strbuf_free(fulln);
}
return fl->type;
}
-EAPI Eina_Bool
-eolian_typedecl_struct_field_is_ref(const Eolian_Struct_Type_Field *fl)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(fl, EINA_FALSE);
- return fl->is_ref;
-}
-
EAPI Eina_Iterator *
eolian_typedecl_enum_fields_get(const Eolian_Typedecl *tp)
{
}
EAPI Eina_Bool
+eolian_type_is_ref(const Eolian_Type *tp)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(tp, EINA_FALSE);
+ return tp->is_ref;
+}
+
+EAPI Eina_Bool
eolian_typedecl_is_extern(const Eolian_Typedecl *tp)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, EINA_FALSE);
Eina_Strbuf *buf;
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
buf = eina_strbuf_new();
- database_type_to_str(tp, buf, NULL, EINA_FALSE);
+ database_type_to_str(tp, buf, NULL);
ret = eina_stringshare_add(eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
return ret;
KW(abstract), KW(constructor), KW(constructors), KW(data), \
KW(destructor), KW(eo), KW(eo_prefix), KW(event_prefix), KW(events), KW(free), \
KW(get), KW(implements), KW(import), KW(interface), KW(keys), KW(legacy), \
- KW(legacy_prefix), KW(methods), KW(mixin), KW(own), KW(params), \
+ KW(legacy_prefix), KW(methods), KW(mixin), KW(own), KW(params), KW(ref), \
KW(set), KW(type), KW(values), KW(var), KWAT(auto), KWAT(beta), \
KWAT(c_only), KWAT(class), KWAT(const), KWAT(empty), KWAT(extern), \
KWAT(free), KWAT(hot), KWAT(in), KWAT(inout), KWAT(nonull), KWAT(nullable), \
KWAT(optional), KWAT(out), KWAT(private), KWAT(property), \
- KWAT(protected), KWAT(ref), KWAT(restart), KWAT(virtual_pure), KWAT(warn_unused), \
+ KWAT(protected), KWAT(restart), KWAT(virtual_pure), KWAT(warn_unused), \
\
KW(byte), KW(ubyte), KW(char), KW(short), KW(ushort), KW(int), KW(uint), \
KW(long), KW(ulong), KW(llong), KW(ullong), \
return parse_expr_bin(ls, 1);
}
-static Eolian_Type *parse_type_void(Eo_Lexer *ls);
+static Eolian_Type *parse_type_void(Eo_Lexer *ls, Eina_Bool allow_ref);
static Eolian_Type *
-parse_type(Eo_Lexer *ls)
+parse_type(Eo_Lexer *ls, Eina_Bool allow_ref)
{
Eolian_Type *ret;
eo_lexer_context_push(ls);
- ret = parse_type_void(ls);
+ ret = parse_type_void(ls, allow_ref);
if (ret->type == EOLIAN_TYPE_VOID)
{
eo_lexer_context_restore(ls);
while (ls->t.token != '}')
{
const char *fname;
- Eina_Bool is_ref = EINA_FALSE;
Eolian_Struct_Type_Field *fdef;
Eolian_Type *tp;
int fline = ls->line_number, fcol = ls->column;
- if (ls->t.kw == KW_at_ref)
- {
- is_ref = EINA_TRUE;
- eo_lexer_get(ls);
- }
check(ls, TOK_VALUE);
if (eina_hash_find(def->fields, ls->t.value.s))
eo_lexer_syntax_error(ls, "double field definition");
def->field_list = eina_list_append(def->field_list, fdef);
eo_lexer_get(ls);
check_next(ls, ':');
- tp = parse_type(ls);
+ tp = parse_type(ls, EINA_TRUE);
FILL_BASE(fdef->base, ls, fline, fcol);
fdef->type = tp;
fdef->name = eina_stringshare_ref(fname);
- fdef->is_ref = is_ref;
pop_type(ls);
check_next(ls, ';');
FILL_DOC(ls, fdef, doc);
static Eina_Bool
_type_is_ownable(Eolian_Type *tp)
{
+ if (tp->is_ref)
+ return EINA_TRUE;
if (tp->type == EOLIAN_TYPE_REGULAR)
{
int kwid = eo_lexer_keyword_str_to_id(tp->name);
}
static Eolian_Type *
-parse_type_void(Eo_Lexer *ls)
+parse_type_void(Eo_Lexer *ls, Eina_Bool allow_ref)
{
Eolian_Type *def;
Eina_Strbuf *buf;
pline = ls->line_number;
pcol = ls->column;
check_next(ls, '(');
- def = parse_type_void(ls);
+ def = parse_type_void(ls, allow_ref);
FILL_BASE(def->base, ls, line, col);
def->is_const = EINA_TRUE;
check_match(ls, ')', '(', pline, pcol);
goto parse_ptr;
}
+ case KW_ref:
+ {
+ int pline, pcol;
+ eo_lexer_get(ls);
+ pline = ls->line_number;
+ pcol = ls->column;
+ check_next(ls, '(');
+ def = parse_type_void(ls, EINA_FALSE);
+ FILL_BASE(def->base, ls, line, col);
+ def->is_ref = EINA_TRUE;
+ check_match(ls, ')', '(', pline, pcol);
+ goto parse_ptr;
+ }
case KW_own:
{
int pline, pcolumn;
pcolumn = ls->column;
check_next(ls, '(');
eo_lexer_context_push(ls);
- def = parse_type_void(ls);
+ def = parse_type_void(ls, allow_ref);
if (!_type_is_ownable(def))
{
eo_lexer_context_restore(ls);
pcolumn = ls->column;
check_next(ls, '(');
eo_lexer_context_push(ls);
- def = parse_type_void(ls);
+ def = parse_type_void(ls, allow_ref);
if (!_type_is_ownable(def))
{
eo_lexer_context_restore(ls);
def->type = EOLIAN_TYPE_COMPLEX;
check_next(ls, '<');
def->subtypes = eina_list_append(def->subtypes,
- parse_type(ls));
+ parse_type(ls, EINA_FALSE));
pop_type(ls);
if (tpid == KW_hash)
{
check_next(ls, ',');
def->subtypes = eina_list_append(def->subtypes,
- parse_type(ls));
+ parse_type(ls, EINA_FALSE));
pop_type(ls);
}
else if(tpid == KW_promise && test_next(ls, ','))
{
def->subtypes = eina_list_append(def->subtypes,
- parse_type(ls));
+ parse_type(ls, EINA_FALSE));
pop_type(ls);
}
check_match(ls, '>', '<', bline, bcol);
}
eo_lexer_context_pop(ls);
check_next(ls, ':');
- def->base_type = parse_type(ls);
+ def->base_type = parse_type(ls, EINA_FALSE);
pop_type(ls);
check_next(ls, ';');
FILL_DOC(ls, def, doc);
}
eo_lexer_context_pop(ls);
check_next(ls, ':');
- def->base_type = parse_type(ls);
+ def->base_type = parse_type(ls, EINA_FALSE);
pop_type(ls);
if ((ls->t.token == '=') && !has_extern)
{
Eolian_Documentation *doc;
Eolian_Expression *default_ret_val;
Eina_Bool warn_unused: 1;
- Eina_Bool is_ref: 1;
} Eo_Ret_Def;
static void
eo_lexer_get(ls);
check_next(ls, ':');
if (allow_void)
- ret->type = parse_type_void(ls);
+ ret->type = parse_type_void(ls, EINA_TRUE);
else
- ret->type = parse_type(ls);
+ ret->type = parse_type(ls, EINA_TRUE);
ret->doc = NULL;
ret->default_ret_val = NULL;
ret->warn_unused = EINA_FALSE;
- ret->is_ref = EINA_FALSE;
if (ls->t.token == '(')
{
int line = ls->line_number, col = ls->column;
ls->expr_mode = EINA_FALSE;
check_match(ls, ')', '(', line, col);
}
- Eina_Bool has_warn_unused = EINA_FALSE, has_ref = EINA_FALSE;
+ Eina_Bool has_warn_unused = EINA_FALSE;
for (;;) switch (ls->t.kw)
{
case KW_at_warn_unused:
ret->warn_unused = EINA_TRUE;
eo_lexer_get(ls);
break;
- case KW_at_ref:
- CASE_LOCK(ls, ref, "ref qualifier");
- ret->is_ref = EINA_TRUE;
- eo_lexer_get(ls);
- break;
default:
goto end;
}
par->param_dir = EOLIAN_INOUT_PARAM;
eo_lexer_get(ls);
}
- else if (ls->t.kw == KW_at_ref)
- {
- par->param_dir = EOLIAN_REF_PARAM;
- eo_lexer_get(ls);
- }
else par->param_dir = EOLIAN_IN_PARAM;
check(ls, TOK_VALUE);
par->name = eina_stringshare_ref(ls->t.value.s);
eo_lexer_get(ls);
check_next(ls, ':');
if (par->param_dir == EOLIAN_OUT_PARAM || par->param_dir == EOLIAN_INOUT_PARAM)
- par->type = parse_type_void(ls);
+ par->type = parse_type_void(ls, EINA_TRUE);
else
- par->type = parse_type(ls);
+ par->type = parse_type(ls, EINA_TRUE);
pop_type(ls);
if ((is_vals || (par->param_dir == EOLIAN_OUT_PARAM)) && (ls->t.token == '('))
{
prop->get_return_doc = ret.doc;
prop->get_ret_val = ret.default_ret_val;
prop->get_return_warn_unused = ret.warn_unused;
- prop->get_return_is_ref = ret.is_ref;
}
else
{
prop->set_return_doc = ret.doc;
prop->set_ret_val = ret.default_ret_val;
prop->set_return_warn_unused = ret.warn_unused;
- prop->set_return_is_ref = ret.is_ref;
}
break;
case KW_legacy:
meth->get_return_doc = ret.doc;
meth->get_ret_val = ret.default_ret_val;
meth->get_return_warn_unused = ret.warn_unused;
- meth->get_return_is_ref = ret.is_ref;
break;
case KW_legacy:
CASE_LOCK(ls, legacy, "legacy name")
if (ls->t.token == ':')
{
eo_lexer_get(ls);
- ev->type = parse_type(ls);
+ ev->type = parse_type(ls, EINA_TRUE);
pop_type(ls);
}
check(ls, ';');
Eina_Bool set_empty :1;
Eina_Bool get_return_warn_unused :1; /* also used for methods */
Eina_Bool set_return_warn_unused :1;
- Eina_Bool get_return_is_ref: 1;
- Eina_Bool set_return_is_ref: 1;
Eina_Bool get_only_legacy: 1;
Eina_Bool set_only_legacy: 1;
Eina_Bool is_class :1;
Eina_Stringshare *freefunc;
Eina_Bool is_const :1;
Eina_Bool is_own :1;
+ Eina_Bool is_ref :1;
};
struct _Eolian_Typedecl
Eolian_Object base;
Eolian_Type *type;
Eolian_Documentation *doc;
- Eina_Bool is_ref: 1;
};
struct _Eolian_Enum_Type_Field
void database_type_del(Eolian_Type *tp);
void database_typedecl_del(Eolian_Typedecl *tp);
-void database_type_to_str(const Eolian_Type *tp, Eina_Strbuf *buf, const char *name, Eina_Bool is_ref);
+void database_type_to_str(const Eolian_Type *tp, Eina_Strbuf *buf, const char *name);
void database_typedecl_to_str(const Eolian_Typedecl *tp, Eina_Strbuf *buf);
/* expressions */
@in a: int; [[a]]
@inout b: char;
@out c: double (1337.6);
- @ref d: int;
+ @in d: ref(int);
}
return: char * (null); [[comment for method return]]
}
params {
x: int;
}
- return: int @ref;
+ return: ref(int);
}
}
}
struct Named {
- @ref field: int;
+ field: ref(int);
something: string;
}
/* Method */
fail_if(!(fid = eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD)));
fail_if(!eolian_function_is_beta(fid));
- fail_if(eolian_function_return_is_ref(fid, EOLIAN_METHOD));
+ fail_if(eolian_type_is_ref(eolian_function_return_type_get(fid, EOLIAN_METHOD)));
/* Function return */
tp = eolian_function_return_type_get(fid, EOLIAN_METHOD);
fail_if(!tp);
fail_if(v.type != EOLIAN_EXPR_DOUBLE);
fail_if(v.value.d != 1337.6);
fail_if(!(eina_iterator_next(iter, (void**)¶m)));
- fail_if(eolian_parameter_direction_get(param) != EOLIAN_REF_PARAM);
+ fail_if(eolian_parameter_direction_get(param) != EOLIAN_IN_PARAM);
fail_if(strcmp(eolian_type_name_get(eolian_parameter_type_get(param)), "int"));
+ fail_if(!eolian_type_is_ref(eolian_parameter_type_get(param)));
fail_if(strcmp(eolian_parameter_name_get(param), "d"));
fail_if(eina_iterator_next(iter, &dummy));
eina_iterator_free(iter);
fail_if(!eolian_function_is_legacy_only(fid, EOLIAN_METHOD));
fail_if(!eolian_function_is_c_only(fid));
fail_if(eolian_function_is_beta(fid));
- fail_if(!eolian_function_return_is_ref(fid, EOLIAN_METHOD));
+ fail_if(!eolian_type_is_ref(eolian_function_return_type_get(fid, EOLIAN_METHOD)));
eolian_shutdown();
}
fail_if(strcmp(file, "struct.eo"));
fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "field")));
fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field)));
- fail_if(!eolian_typedecl_struct_field_is_ref(field));
+ fail_if(!eolian_type_is_ref(ftype));
fail_if(!(type_name = eolian_type_name_get(ftype)));
fail_if(strcmp(type_name, "int"));
fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "something")));
fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field)));
- fail_if(eolian_typedecl_struct_field_is_ref(field));
+ fail_if(eolian_type_is_ref(ftype));
fail_if(!(type_name = eolian_type_c_type_get(ftype)));
fail_if(strcmp(type_name, "const char *"));
eina_stringshare_del(type_name);