* @see eolian_object_file_get
* @see eolian_object_line_get
* @see eolian_object_column_get
+ * @see eolian_object_short_name_get
+ * @see eolian_object_namespaces_get
*
* @ingroup Eolian
*/
EAPI const char *eolian_object_name_get(const Eolian_Object *obj);
/*
+ * @brief Get the short name of an object.
+ *
+ * This means a name without namespaces. If the object's name is not
+ * namespaced in the first place, this is equivalent to getting the full name.
+ * So for `Foo.Bar.baz` this is `baz`, for `foo` it's again just `foo`.
+ *
+ * @see eolian_object_name_get
+ * @see eolian_object_namespaces_get
+ *
+ * @ingroup Eolian
+ */
+EAPI const char *eolian_object_short_name_get(const Eolian_Object *obj);
+
+/*
+ * @brief Get a list of namespaces for the object.
+ *
+ * Each item of the iterator is the next more inner namespace. So for
+ * example if the full name is `Foo.Bar.baz`, the iterator will first
+ * give you `Foo` and then `Bar`.
+ *
+ * @see eolian_object_name_get
+ * @see eolian_object_short_name_get
+ *
+ * @ingroup Eolian
+ */
+EAPI Eina_Iterator *eolian_object_namespaces_get(const Eolian_Object *obj);
+
+/*
* @brief Scan the given directory for .eo and .eot files.
*
* You need to add every directory you plan to use .eo/.eot files from.
EAPI Eina_Stringshare *
eolian_class_name_get(const Eolian_Class *cl)
{
- return database_object_short_name_get((const Eolian_Object *)cl);
+ return eolian_object_short_name_get((const Eolian_Object *)cl);
}
EAPI Eina_Iterator *
eolian_class_namespaces_get(const Eolian_Class *cl)
{
- return database_object_namespaces_get((const Eolian_Object *)cl);
+ return eolian_object_namespaces_get((const Eolian_Object *)cl);
}
EAPI Eolian_Class_Type
}
_eolian_log("function '%s' not found in class '%s'", func_name,
- database_object_short_name_get(&cl->base));
+ eolian_object_short_name_get(&cl->base));
return NULL;
}
static void
_append_name(const Eolian_Object *obj, Eina_Strbuf *buf)
{
- Eina_Iterator *itr = database_object_namespaces_get(obj);
+ Eina_Iterator *itr = eolian_object_namespaces_get(obj);
const char *sp;
EINA_ITERATOR_FOREACH(itr, sp)
{
eina_strbuf_append(buf, sp);
eina_strbuf_append_char(buf, '_');
}
- eina_strbuf_append(buf, database_object_short_name_get(obj));
+ eina_strbuf_append(buf, eolian_object_short_name_get(obj));
}
void
EAPI Eina_Stringshare *
eolian_type_name_get(const Eolian_Type *tp)
{
- return database_object_short_name_get((const Eolian_Object *)tp);
+ return eolian_object_short_name_get((const Eolian_Object *)tp);
}
EAPI Eina_Stringshare *
eolian_typedecl_name_get(const Eolian_Typedecl *tp)
{
- return database_object_short_name_get((const Eolian_Object *)tp);
+ return eolian_object_short_name_get((const Eolian_Object *)tp);
}
EAPI Eina_Stringshare *
EAPI Eina_Iterator *
eolian_type_namespaces_get(const Eolian_Type *tp)
{
- return database_object_namespaces_get((const Eolian_Object *)tp);
+ return eolian_object_namespaces_get((const Eolian_Object *)tp);
}
EAPI Eina_Iterator *
eolian_typedecl_namespaces_get(const Eolian_Typedecl *tp)
{
- return database_object_namespaces_get((const Eolian_Object *)tp);
+ return eolian_object_namespaces_get((const Eolian_Object *)tp);
}
EAPI Eina_Stringshare *
EAPI Eina_Stringshare *
eolian_variable_name_get(const Eolian_Variable *var)
{
- return database_object_short_name_get((const Eolian_Object *)var);
+ return eolian_object_short_name_get((const Eolian_Object *)var);
}
EAPI Eina_Stringshare *
EAPI Eina_Iterator *
eolian_variable_namespaces_get(const Eolian_Variable *var)
{
- return database_object_namespaces_get((const Eolian_Object *)var);
+ return eolian_object_namespaces_get((const Eolian_Object *)var);
}
EAPI Eina_Bool
meth->klass = NULL;
meth->type = EOLIAN_FUNCTION_POINTER;
meth->get_scope = meth->set_scope = EOLIAN_SCOPE_PUBLIC;
- meth->base.name = eina_stringshare_add(database_object_short_name_get(&def->base));
+ meth->base.name = eina_stringshare_add(eolian_object_short_name_get(&def->base));
def->function_pointer = meth;
eolian_object_ref(&meth->base);
((Eina_List *)eina_hash_find(unit->state->objects_f, obj->file), obj));
}
+EAPI Eolian_Object_Type
+eolian_object_type_get(const Eolian_Object *obj)
+{
+ if (!obj) return EOLIAN_OBJECT_UNKNOWN;
+ return obj->type;
+}
+
+EAPI const char *
+eolian_object_file_get(const Eolian_Object *obj)
+{
+ if (!obj) return NULL;
+ return obj->file;
+}
+
+EAPI int
+eolian_object_line_get(const Eolian_Object *obj)
+{
+ if (!obj) return 0;
+ return obj->line;
+}
+
+EAPI int
+eolian_object_column_get(const Eolian_Object *obj)
+{
+ if (!obj) return 0;
+ return obj->column;
+}
+
+EAPI const char *
+eolian_object_name_get(const Eolian_Object *obj)
+{
+ if (!obj) return NULL;
+ return obj->name;
+}
+
typedef struct _Eolian_Namespace_List
{
Eina_Iterator itr;
return NULL;
}
-Eina_Iterator *
-database_object_namespaces_get(const Eolian_Object *obj)
+EAPI const char *
+eolian_object_short_name_get(const Eolian_Object *obj)
+{
+ if (!obj || !obj->name) return NULL;
+ const char *ldot = strrchr(obj->name, '.');
+ if (ldot)
+ return ldot + 1;
+ return obj->name;
+}
+
+EAPI Eina_Iterator *
+eolian_object_namespaces_get(const Eolian_Object *obj)
{
if (!obj || !obj->name || !strchr(obj->name, '.')) return NULL;
return &it->itr;
}
-const char *
-database_object_short_name_get(const Eolian_Object *obj)
-{
- if (!obj || !obj->name) return NULL;
- const char *ldot = strrchr(obj->name, '.');
- if (ldot)
- return ldot + 1;
- return obj->name;
-}
-
void database_doc_del(Eolian_Documentation *doc)
{
if (!doc) return;
free(state);
}
-EAPI Eolian_Object_Type
-eolian_object_type_get(const Eolian_Object *obj)
-{
- if (!obj) return EOLIAN_OBJECT_UNKNOWN;
- return obj->type;
-}
-
-EAPI const char *
-eolian_object_file_get(const Eolian_Object *obj)
-{
- if (!obj) return NULL;
- return obj->file;
-}
-
-EAPI int
-eolian_object_line_get(const Eolian_Object *obj)
-{
- if (!obj) return 0;
- return obj->line;
-}
-
-EAPI int
-eolian_object_column_get(const Eolian_Object *obj)
-{
- if (!obj) return 0;
- return obj->column;
-}
-
-EAPI const char *
-eolian_object_name_get(const Eolian_Object *obj)
-{
- if (!obj) return NULL;
- return obj->name;
-}
-
#define EO_SUFFIX ".eo"
#define EOT_SUFFIX ".eot"
void database_object_add(Eolian_Unit *unit, const Eolian_Object *obj);
-Eina_Iterator *database_object_namespaces_get(const Eolian_Object *obj);
-const char *database_object_short_name_get(const Eolian_Object *obj);
-
void database_doc_del(Eolian_Documentation *doc);
void database_unit_init(Eolian_State *state, Eolian_Unit *unit, const char *file);