2014-09-23 12:48:16 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2014-07-10 05:13:46 -07:00
|
|
|
#include <Eina.h>
|
|
|
|
#include "eolian_database.h"
|
|
|
|
|
2014-08-13 03:53:33 -07:00
|
|
|
EAPI Eolian_Object_Scope
|
2016-06-09 08:54:43 -07:00
|
|
|
eolian_function_scope_get(const Eolian_Function *fid, Eolian_Function_Type ftype)
|
2014-07-10 05:13:46 -07:00
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EOLIAN_SCOPE_PUBLIC);
|
2016-06-09 08:54:43 -07:00
|
|
|
switch (ftype)
|
|
|
|
{
|
|
|
|
case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_PROP_GET: return fid->get_scope; break;
|
|
|
|
case EOLIAN_PROP_SET: return fid->set_scope; break;
|
|
|
|
default: return EOLIAN_SCOPE_PUBLIC;
|
|
|
|
}
|
2014-07-10 05:13:46 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eolian_Function_Type
|
|
|
|
eolian_function_type_get(const Eolian_Function *fid)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EOLIAN_UNRESOLVED);
|
|
|
|
return fid->type;
|
|
|
|
}
|
|
|
|
|
2014-07-10 06:04:13 -07:00
|
|
|
EAPI Eina_Stringshare *
|
2014-07-10 05:13:46 -07:00
|
|
|
eolian_function_name_get(const Eolian_Function *fid)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL);
|
|
|
|
return fid->name;
|
|
|
|
}
|
|
|
|
|
2014-09-25 07:37:18 -07:00
|
|
|
static const char *
|
2015-07-08 04:09:56 -07:00
|
|
|
_get_eo_prefix(const Eolian_Function *foo_id, char *buf, Eina_Bool use_legacy)
|
2014-09-25 07:37:18 -07:00
|
|
|
{
|
|
|
|
char *tmp = buf;
|
2016-05-12 08:28:19 -07:00
|
|
|
if (use_legacy)
|
|
|
|
return foo_id->klass->legacy_prefix;
|
|
|
|
else if (foo_id->klass->eo_prefix)
|
2014-09-25 07:37:18 -07:00
|
|
|
return foo_id->klass->eo_prefix;
|
|
|
|
strcpy(buf, foo_id->klass->full_name);
|
|
|
|
eina_str_tolower(&buf);
|
|
|
|
while ((tmp = strchr(tmp, '.'))) *tmp = '_';
|
|
|
|
return buf;
|
|
|
|
}
|
|
|
|
|
2016-11-28 10:55:27 -08:00
|
|
|
static char *
|
|
|
|
_get_abbreviated_name(const char *prefix, const char *fname)
|
|
|
|
{
|
|
|
|
Eina_Strbuf *buf = eina_strbuf_new();
|
|
|
|
|
|
|
|
const char *last_p = strrchr(prefix, '_');
|
|
|
|
last_p = (last_p) ? (last_p + 1) : prefix;
|
|
|
|
|
|
|
|
const char *tmp = strstr(fname, last_p);
|
|
|
|
int len = strlen(last_p);
|
|
|
|
|
|
|
|
if ((tmp) &&
|
|
|
|
((tmp == fname) || (*(tmp - 1) == '_')) &&
|
|
|
|
((*(tmp + len) == '\0') || (*(tmp + len) == '_')))
|
|
|
|
{
|
|
|
|
int plen = strlen(prefix);
|
|
|
|
len += (tmp - fname);
|
|
|
|
|
|
|
|
if ((plen >= len) && !strncmp(prefix + plen - len, fname, len))
|
|
|
|
{
|
|
|
|
eina_strbuf_append_n(buf, prefix, plen - len);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (eina_strbuf_length_get(buf) == 0)
|
|
|
|
eina_strbuf_append_printf(buf, "%s_", prefix);
|
|
|
|
eina_strbuf_append(buf, fname);
|
|
|
|
|
|
|
|
char *ret = eina_strbuf_string_steal(buf);
|
|
|
|
eina_strbuf_free(buf);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2014-07-10 06:04:13 -07:00
|
|
|
EAPI Eina_Stringshare *
|
2015-07-08 04:09:56 -07:00
|
|
|
eolian_function_full_c_name_get(const Eolian_Function *foo_id,
|
|
|
|
Eolian_Function_Type ftype,
|
|
|
|
Eina_Bool use_legacy)
|
2014-07-10 05:13:46 -07:00
|
|
|
{
|
2015-07-08 04:09:56 -07:00
|
|
|
switch (ftype)
|
|
|
|
{
|
|
|
|
case EOLIAN_UNRESOLVED:
|
|
|
|
case EOLIAN_METHOD:
|
|
|
|
case EOLIAN_PROPERTY:
|
|
|
|
case EOLIAN_PROP_GET:
|
|
|
|
if (foo_id->get_legacy && use_legacy)
|
|
|
|
{
|
|
|
|
if (!strcmp(foo_id->get_legacy, "null"))
|
|
|
|
return NULL;
|
|
|
|
return eina_stringshare_ref(foo_id->get_legacy);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case EOLIAN_PROP_SET:
|
|
|
|
if (foo_id->set_legacy && use_legacy)
|
|
|
|
{
|
|
|
|
if (!strcmp(foo_id->set_legacy, "null"))
|
|
|
|
return NULL;
|
|
|
|
return eina_stringshare_ref(foo_id->set_legacy);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2014-09-25 07:37:18 -07:00
|
|
|
char tbuf[512];
|
2015-07-08 04:09:56 -07:00
|
|
|
const char *prefix = _get_eo_prefix(foo_id, tbuf, use_legacy);
|
|
|
|
|
|
|
|
if (!prefix)
|
|
|
|
return NULL;
|
|
|
|
|
2014-07-10 05:13:46 -07:00
|
|
|
const char *funcn = eolian_function_name_get(foo_id);
|
|
|
|
Eina_Strbuf *buf = eina_strbuf_new();
|
|
|
|
Eina_Stringshare *ret;
|
|
|
|
|
2016-11-28 10:55:27 -08:00
|
|
|
if (use_legacy)
|
2014-07-10 05:13:46 -07:00
|
|
|
{
|
|
|
|
eina_strbuf_append(buf, prefix);
|
|
|
|
eina_strbuf_append_char(buf, '_');
|
|
|
|
eina_strbuf_append(buf, funcn);
|
2015-07-08 04:09:56 -07:00
|
|
|
|
|
|
|
if ((ftype == EOLIAN_PROP_GET) || (ftype == EOLIAN_PROPERTY))
|
|
|
|
eina_strbuf_append(buf, "_get");
|
|
|
|
else if (ftype == EOLIAN_PROP_SET)
|
|
|
|
eina_strbuf_append(buf, "_set");
|
|
|
|
|
2014-07-10 05:13:46 -07:00
|
|
|
ret = eina_stringshare_add(eina_strbuf_string_get(buf));
|
|
|
|
eina_strbuf_free(buf);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-11-28 10:55:27 -08:00
|
|
|
char *abbr = _get_abbreviated_name(prefix, funcn);
|
|
|
|
eina_strbuf_append(buf, abbr);
|
|
|
|
free(abbr);
|
2015-07-08 04:09:56 -07:00
|
|
|
|
|
|
|
if ((ftype == EOLIAN_PROP_GET) || (ftype == EOLIAN_PROPERTY))
|
|
|
|
eina_strbuf_append(buf, "_get");
|
|
|
|
else if (ftype == EOLIAN_PROP_SET)
|
|
|
|
eina_strbuf_append(buf, "_set");
|
|
|
|
|
2014-07-10 05:13:46 -07:00
|
|
|
ret = eina_stringshare_add(eina_strbuf_string_get(buf));
|
|
|
|
eina_strbuf_free(buf);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2014-08-15 03:52:11 -07:00
|
|
|
EAPI Eina_Stringshare *
|
|
|
|
eolian_function_legacy_get(const Eolian_Function *fid, Eolian_Function_Type ftype)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL);
|
|
|
|
switch (ftype)
|
|
|
|
{
|
2014-08-27 07:38:28 -07:00
|
|
|
case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_PROP_GET: return fid->get_legacy; break;
|
2014-08-15 03:52:11 -07:00
|
|
|
case EOLIAN_PROP_SET: return fid->set_legacy; break;
|
|
|
|
default: return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-03 08:16:53 -07:00
|
|
|
EAPI const Eolian_Documentation *
|
|
|
|
eolian_function_documentation_get(const Eolian_Function *fid, Eolian_Function_Type ftype)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL);
|
|
|
|
switch (ftype)
|
|
|
|
{
|
|
|
|
case EOLIAN_PROP_GET: return fid->get_doc; break;
|
|
|
|
case EOLIAN_PROP_SET: return fid->set_doc; break;
|
|
|
|
default: return fid->common_doc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-07-10 05:13:46 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
eolian_function_is_virtual_pure(const Eolian_Function *fid, Eolian_Function_Type ftype)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
|
|
|
|
switch (ftype)
|
|
|
|
{
|
2014-08-27 07:38:28 -07:00
|
|
|
case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_PROP_GET: return fid->get_virtual_pure; break;
|
2014-07-10 05:13:46 -07:00
|
|
|
case EOLIAN_PROP_SET: return fid->set_virtual_pure; break;
|
|
|
|
default: return EINA_FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-03 06:25:50 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
eolian_function_is_auto(const Eolian_Function *fid, Eolian_Function_Type ftype)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
|
|
|
|
switch (ftype)
|
|
|
|
{
|
|
|
|
case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_PROP_GET: return fid->get_auto; break;
|
|
|
|
case EOLIAN_PROP_SET: return fid->set_auto; break;
|
|
|
|
default: return EINA_FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
eolian_function_is_empty(const Eolian_Function *fid, Eolian_Function_Type ftype)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
|
|
|
|
switch (ftype)
|
|
|
|
{
|
|
|
|
case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_PROP_GET: return fid->get_empty; break;
|
|
|
|
case EOLIAN_PROP_SET: return fid->set_empty; break;
|
|
|
|
default: return EINA_FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-18 06:51:03 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
eolian_function_is_legacy_only(const Eolian_Function *fid, Eolian_Function_Type ftype)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
|
|
|
|
switch (ftype)
|
|
|
|
{
|
2014-08-27 07:38:28 -07:00
|
|
|
case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_PROP_GET: return fid->get_only_legacy; break;
|
2014-08-18 06:51:03 -07:00
|
|
|
case EOLIAN_PROP_SET: return fid->set_only_legacy; break;
|
|
|
|
default: return EINA_FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-07-24 04:05:12 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
eolian_function_is_class(const Eolian_Function *fid)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
|
|
|
|
return fid->is_class;
|
|
|
|
}
|
|
|
|
|
2014-09-12 12:51:37 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
eolian_function_is_constructor(const Eolian_Function *fid, const Eolian_Class *klass)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
|
|
|
|
Eina_Stringshare *s = eina_stringshare_ref(klass->full_name);
|
|
|
|
Eina_Bool r = !!eina_list_search_sorted_list
|
|
|
|
(fid->ctor_of, EINA_COMPARE_CB(strcmp), s);
|
|
|
|
eina_stringshare_del(s);
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
2015-05-20 09:42:00 -07:00
|
|
|
static Eina_List *
|
|
|
|
_get_prop_keys(const Eolian_Function *fid, Eolian_Function_Type ftype)
|
2014-07-10 05:13:46 -07:00
|
|
|
{
|
2015-05-20 09:42:00 -07:00
|
|
|
Eina_List *l = fid->prop_keys_get;
|
|
|
|
if (ftype == EOLIAN_PROP_SET) l = fid->prop_keys_set;
|
|
|
|
if (!l) return fid->prop_keys;
|
|
|
|
return l;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_List *
|
|
|
|
_get_prop_values(const Eolian_Function *fid, Eolian_Function_Type ftype)
|
|
|
|
{
|
|
|
|
Eina_List *l = fid->prop_values_get;
|
|
|
|
if (ftype == EOLIAN_PROP_SET) l = fid->prop_values_set;
|
|
|
|
if (!l) return fid->prop_values;
|
|
|
|
return l;
|
2014-07-10 05:13:46 -07:00
|
|
|
}
|
|
|
|
|
2014-07-23 00:24:59 -07:00
|
|
|
EAPI Eina_Iterator *
|
2015-05-20 09:03:14 -07:00
|
|
|
eolian_property_keys_get(const Eolian_Function *fid, Eolian_Function_Type ftype)
|
2014-07-10 05:13:46 -07:00
|
|
|
{
|
2015-05-20 09:42:00 -07:00
|
|
|
Eina_List *l = NULL;
|
2014-07-10 05:13:46 -07:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL);
|
2015-05-20 09:03:14 -07:00
|
|
|
if (ftype != EOLIAN_PROP_GET && ftype != EOLIAN_PROP_SET)
|
|
|
|
return NULL;
|
2015-05-20 09:42:00 -07:00
|
|
|
l = _get_prop_keys(fid, ftype);
|
|
|
|
return (l ? eina_list_iterator_new(l) : NULL);
|
2014-07-10 05:13:46 -07:00
|
|
|
}
|
|
|
|
|
2014-07-23 00:24:59 -07:00
|
|
|
EAPI Eina_Iterator *
|
2015-05-20 09:03:14 -07:00
|
|
|
eolian_property_values_get(const Eolian_Function *fid, Eolian_Function_Type ftype)
|
2014-07-10 05:13:46 -07:00
|
|
|
{
|
2015-05-20 09:42:00 -07:00
|
|
|
Eina_List *l = NULL;
|
2015-05-20 09:03:14 -07:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL);
|
|
|
|
if (ftype != EOLIAN_PROP_GET && ftype != EOLIAN_PROP_SET)
|
|
|
|
return NULL;
|
2015-05-20 09:42:00 -07:00
|
|
|
l = _get_prop_values(fid, ftype);
|
|
|
|
return (l ? eina_list_iterator_new(l) : NULL);
|
2014-07-10 05:13:46 -07:00
|
|
|
}
|
|
|
|
|
2014-07-23 00:24:59 -07:00
|
|
|
EAPI Eina_Iterator *
|
2014-07-23 06:17:19 -07:00
|
|
|
eolian_function_parameters_get(const Eolian_Function *fid)
|
2014-07-10 05:13:46 -07:00
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL);
|
2015-05-20 09:03:14 -07:00
|
|
|
if (fid->type != EOLIAN_METHOD)
|
|
|
|
return NULL;
|
2014-07-23 05:44:42 -07:00
|
|
|
return (fid->params ? eina_list_iterator_new(fid->params) : NULL);
|
2014-07-10 05:13:46 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI const Eolian_Type *
|
|
|
|
eolian_function_return_type_get(const Eolian_Function *fid, Eolian_Function_Type ftype)
|
|
|
|
{
|
|
|
|
switch (ftype)
|
|
|
|
{
|
|
|
|
case EOLIAN_PROP_SET: return fid->set_ret_type;
|
2014-08-27 07:38:28 -07:00
|
|
|
case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROP_GET: return fid->get_ret_type;
|
2014-07-10 05:13:46 -07:00
|
|
|
default: return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-07 07:15:07 -07:00
|
|
|
EAPI const Eolian_Expression *
|
2014-07-11 06:30:22 -07:00
|
|
|
eolian_function_return_default_value_get(const Eolian_Function *fid, Eolian_Function_Type ftype)
|
2014-07-10 05:13:46 -07:00
|
|
|
{
|
|
|
|
switch (ftype)
|
|
|
|
{
|
2014-08-07 07:15:07 -07:00
|
|
|
case EOLIAN_PROP_SET: return fid->set_ret_val;
|
2014-08-27 07:38:28 -07:00
|
|
|
case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_PROP_GET: return fid->get_ret_val;
|
2014-07-10 05:13:46 -07:00
|
|
|
default: return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-03 08:16:53 -07:00
|
|
|
EAPI const Eolian_Documentation *
|
|
|
|
eolian_function_return_documentation_get(const Eolian_Function *fid, Eolian_Function_Type ftype)
|
|
|
|
{
|
|
|
|
switch (ftype)
|
|
|
|
{
|
|
|
|
case EOLIAN_PROP_SET: return fid->set_return_doc; break;
|
|
|
|
case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_PROP_GET: return fid->get_return_doc; break;
|
|
|
|
default: return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-07-10 05:13:46 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
eolian_function_return_is_warn_unused(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_warn_unused;
|
2016-06-07 06:59:36 -07:00
|
|
|
case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_PROP_GET: return fid->get_return_warn_unused;
|
|
|
|
default: return EINA_FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-07-10 05:13:46 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
eolian_function_object_is_const(const Eolian_Function *fid)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
|
|
|
|
return fid->obj_is_const;
|
|
|
|
}
|
2014-12-03 06:59:24 -08:00
|
|
|
|
2015-03-16 08:04:44 -07:00
|
|
|
EAPI const Eolian_Class *
|
|
|
|
eolian_function_class_get(const Eolian_Function *fid)
|
|
|
|
{
|
2015-04-21 02:41:48 -07:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL);
|
2015-03-16 08:04:44 -07:00
|
|
|
return fid->klass;
|
|
|
|
}
|
|
|
|
|
2014-12-03 06:59:24 -08:00
|
|
|
EAPI Eina_Bool
|
|
|
|
eolian_function_is_c_only(const Eolian_Function *fid)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
|
|
|
|
return fid->is_c_only;
|
|
|
|
}
|
2015-03-17 04:11:41 -07:00
|
|
|
|
2015-05-08 06:12:27 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
eolian_function_is_beta(const Eolian_Function *fid)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
|
|
|
|
return fid->is_beta;
|
|
|
|
}
|
|
|
|
|
2015-03-17 04:11:41 -07:00
|
|
|
EAPI Eina_Bool eolian_function_is_implemented(
|
|
|
|
const Eolian_Function *function_id, Eolian_Function_Type func_type,
|
|
|
|
const Eolian_Class *klass)
|
|
|
|
{
|
|
|
|
Eina_Iterator *impl_itr = NULL;
|
|
|
|
Eolian_Function_Type found_type = EOLIAN_UNRESOLVED;
|
|
|
|
Eina_Bool found = EINA_TRUE;
|
|
|
|
if (!function_id || !klass) return EINA_FALSE;
|
|
|
|
Eina_List *list = eina_list_append(NULL, klass), *list2, *itr;
|
|
|
|
EINA_LIST_FOREACH(list, itr, klass)
|
|
|
|
{
|
|
|
|
const char *inherit_name;
|
|
|
|
const Eolian_Implement *impl;
|
|
|
|
if (eolian_class_type_get(klass) == EOLIAN_CLASS_INTERFACE) continue;
|
|
|
|
impl_itr = eolian_class_implements_get(klass);
|
|
|
|
EINA_ITERATOR_FOREACH(impl_itr, impl)
|
|
|
|
{
|
|
|
|
if (eolian_implement_is_virtual(impl)) continue;
|
|
|
|
Eolian_Function_Type impl_type = EOLIAN_UNRESOLVED;
|
|
|
|
const Eolian_Function *impl_func = eolian_implement_function_get(impl, &impl_type);
|
|
|
|
if (impl_func == function_id)
|
|
|
|
{
|
|
|
|
/* The type matches the requested or is not important for the caller */
|
|
|
|
if (func_type == EOLIAN_UNRESOLVED || impl_type == func_type) goto end;
|
|
|
|
if (impl_type == EOLIAN_METHOD) continue;
|
|
|
|
/* In case we search for a property type */
|
|
|
|
if (impl_type == EOLIAN_PROPERTY &&
|
|
|
|
(func_type == EOLIAN_PROP_GET || func_type == EOLIAN_PROP_SET))
|
|
|
|
goto end;
|
|
|
|
/* Property may be splitted on multiple implements */
|
|
|
|
if (func_type == EOLIAN_PROPERTY)
|
|
|
|
{
|
|
|
|
if (found_type == EOLIAN_UNRESOLVED) found_type = impl_type;
|
|
|
|
if ((found_type == EOLIAN_PROP_SET && impl_type == EOLIAN_PROP_GET) ||
|
|
|
|
(found_type == EOLIAN_PROP_GET && impl_type == EOLIAN_PROP_SET))
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
eina_iterator_free(impl_itr);
|
|
|
|
impl_itr = NULL;
|
|
|
|
|
|
|
|
Eina_Iterator *inherits_itr = eolian_class_inherits_get(klass);
|
|
|
|
EINA_ITERATOR_FOREACH(inherits_itr, inherit_name)
|
|
|
|
{
|
|
|
|
const Eolian_Class *inherit = eolian_class_get_by_name(inherit_name);
|
|
|
|
/* Avoid duplicates. */
|
|
|
|
if (!eina_list_data_find(list, inherit))
|
|
|
|
{
|
|
|
|
list2 = eina_list_append(list, inherit);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
eina_iterator_free(inherits_itr);
|
|
|
|
}
|
|
|
|
(void) list2;
|
|
|
|
found = EINA_FALSE;
|
|
|
|
end:
|
|
|
|
if (impl_itr) eina_iterator_free(impl_itr);
|
|
|
|
eina_list_free(list);
|
|
|
|
return found;
|
|
|
|
}
|
|
|
|
|