Eina_Bool eolian_typedecl_is_extern(const Eolian_Typedecl *tp);
- const char *eolian_type_c_type_named_get(const Eolian_Type *tp, const char *name);
- const char *eolian_typedecl_c_type_named_get(const Eolian_Typedecl *tp, const char *name);
-
const char *eolian_type_c_type_get(const Eolian_Type *tp);
const char *eolian_typedecl_c_type_get(const Eolian_Typedecl *tp);
return eolian.eolian_typedecl_is_extern(self) ~= 0
end,
- c_type_named_get = function(self, name)
- local v = eolian.eolian_typedecl_c_type_named_get(self, name)
- if v == nil then return nil end
- return ffi_stringshare(v)
- end,
-
c_type_get = function(self)
local v = eolian.eolian_typedecl_c_type_get(self)
if v == nil then return nil end
return eolian.eolian_type_is_const(self) ~= 0
end,
- c_type_named_get = function(self, name)
- local v = eolian.eolian_type_c_type_named_get(self, name)
- if v == nil then return nil end
- return ffi_stringshare(v)
- end,
-
c_type_get = function(self)
local v = eolian.eolian_type_c_type_get(self)
if v == nil then return nil end
EAPI Eina_Bool eolian_typedecl_is_extern(const Eolian_Typedecl *tp);
/*
- * @brief Get the full C type name of the given type declaration with a name.
+ * @brief Get the full C type name of the given type.
*
* @param[in] tp the type declaration.
- * @param[in] name the name.
* @return The C type name assuming @c tp is not NULL.
*
- * Name is ignored for alias types and they're turned into C typedefs.
- *
- * Keep in mind that if @c name is NULL, the name won't be included.
- * Also, you're responsible for deleting the stringshare.
- *
- * @see eolian_typedecl_c_type_get
- * @see eolian_type_c_type_named_get
- *
- * @ingroup Eolian
- */
-EAPI Eina_Stringshare *eolian_typedecl_c_type_named_get(const Eolian_Typedecl *tp, const char *name);
-
-/*
- * @brief Get the full C type name of the given type without a name.
- *
- * @param[in] tp the type declaration.
- * @return The C type name assuming @c tp is not NULL.
- *
- * This behaves exactly like eolian_typedecl_c_type_named_get when name is NULL.
+ * You're responsible for deleting the stringshare.
*
- * @see eolian_typedecl_c_type_named_get
* @see eolian_type_c_type_get
*
* @ingroup Eolian
EAPI Eina_Bool eolian_type_is_const(const Eolian_Type *tp);
/*
- * @brief Get the full C type name of the given type with a name.
- *
- * @param[in] tp the type.
- * @param[in] name the name.
- * @return The C type name assuming @c tp is not NULL.
- *
- * Keep in mind that if @c name is NULL, the name won't be included.
- * Also, you're responsible for deleting the stringshare.
- *
- * @see eolian_type_c_type_get
- * @see eolian_typedecl_c_type_named_get
- *
- * @ingroup Eolian
- */
-EAPI Eina_Stringshare *eolian_type_c_type_named_get(const Eolian_Type *tp, const char *name);
-
-/*
- * @brief Get the full C type name of the given type without a name.
+ * @brief Get the full C type name of the given type.
*
* @param[in] tp the type.
* @return The C type name assuming @c tp is not NULL.
*
- * This behaves exactly like eolian_type_c_type_named_get when name is NULL.
+ * You're responsible for the stringshare.
*
- * @see eolian_type_c_type_named_get
* @see eolian_typedecl_c_type_get
*
* @ingroup Eolian
}
static void
-_stype_to_str(const Eolian_Typedecl *tp, Eina_Strbuf *buf, const char *name)
+_stype_to_str(const Eolian_Typedecl *tp, Eina_Strbuf *buf)
{
Eolian_Struct_Type_Field *sf;
Eina_List *l;
eina_strbuf_append_char(buf, ' ');
}
if (tp->type == EOLIAN_TYPEDECL_STRUCT_OPAQUE)
- goto append_name;
+ return;
eina_strbuf_append(buf, "{ ");
EINA_LIST_FOREACH(tp->field_list, l, sf)
{
eina_strbuf_append(buf, "; ");
}
eina_strbuf_append(buf, "}");
-append_name:
- if (name)
- {
- eina_strbuf_append_char(buf, ' ');
- eina_strbuf_append(buf, name);
- }
}
static void
-_etype_to_str(const Eolian_Typedecl *tp, Eina_Strbuf *buf, const char *name)
+_etype_to_str(const Eolian_Typedecl *tp, Eina_Strbuf *buf)
{
Eolian_Enum_Type_Field *ef;
Eina_List *l;
eina_strbuf_append(buf, ", ");
}
eina_strbuf_append(buf, " }");
- if (name)
- {
- eina_strbuf_append_char(buf, ' ');
- eina_strbuf_append(buf, name);
- }
}
static void
}
void
-database_typedecl_to_str(const Eolian_Typedecl *tp, Eina_Strbuf *buf, const char *name)
+database_typedecl_to_str(const Eolian_Typedecl *tp, Eina_Strbuf *buf)
{
switch (tp->type)
{
_atype_to_str(tp, buf);
break;
case EOLIAN_TYPEDECL_ENUM:
- _etype_to_str(tp, buf, name);
+ _etype_to_str(tp, buf);
break;
case EOLIAN_TYPEDECL_STRUCT:
case EOLIAN_TYPEDECL_STRUCT_OPAQUE:
- _stype_to_str(tp, buf, name);
+ _stype_to_str(tp, buf);
break;
default:
break;
}
EAPI Eina_Stringshare *
-eolian_type_c_type_named_get(const Eolian_Type *tp, const char *name)
+eolian_type_c_type_get(const Eolian_Type *tp)
{
Eina_Stringshare *ret;
Eina_Strbuf *buf;
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
buf = eina_strbuf_new();
- database_type_to_str(tp, buf, name, EINA_FALSE);
+ database_type_to_str(tp, buf, NULL, EINA_FALSE);
ret = eina_stringshare_add(eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
return ret;
}
EAPI Eina_Stringshare *
-eolian_typedecl_c_type_named_get(const Eolian_Typedecl *tp, const char *name)
+eolian_typedecl_c_type_get(const Eolian_Typedecl *tp)
{
Eina_Stringshare *ret;
Eina_Strbuf *buf;
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
buf = eina_strbuf_new();
- database_typedecl_to_str(tp, buf, name);
+ database_typedecl_to_str(tp, buf);
ret = eina_stringshare_add(eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
return ret;
}
EAPI Eina_Stringshare *
-eolian_type_c_type_get(const Eolian_Type *tp)
-{
- return eolian_type_c_type_named_get(tp, NULL);
-}
-
-EAPI Eina_Stringshare *
-eolian_typedecl_c_type_get(const Eolian_Typedecl *tp)
-{
- return eolian_typedecl_c_type_named_get(tp, NULL);
-}
-
-EAPI Eina_Stringshare *
eolian_type_name_get(const Eolian_Type *tp)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
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_typedecl_to_str(const Eolian_Typedecl *tp, Eina_Strbuf *buf, const char *name);
+void database_typedecl_to_str(const Eolian_Typedecl *tp, Eina_Strbuf *buf);
/* expressions */