eolian: remove database_type_print (unused)

This commit is contained in:
Daniel Kolesa 2016-03-01 13:44:43 +00:00
parent 4c4fbfae0b
commit 5401c775ec
2 changed files with 0 additions and 81 deletions

View File

@ -291,83 +291,3 @@ database_type_to_str(const Eolian_Type *tp, Eina_Strbuf *buf, const char *name)
eina_strbuf_append(buf, name);
}
}
static void
_typedef_print(Eolian_Type *tp)
{
printf("type %s: ", tp->full_name);
database_type_print(tp->base_type);
}
void
database_expr_print(Eolian_Expression *exp)
{
Eolian_Value val = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
const char *ret = eolian_expression_value_to_literal(&val);
printf("%s", ret);
eina_stringshare_del(ret);
}
void
database_type_print(Eolian_Type *tp)
{
if (tp->type == EOLIAN_TYPE_ALIAS)
{
_typedef_print(tp);
return;
}
if (tp->is_own)
printf("own(");
if (tp->is_const)
printf("const(");
if (tp->type == EOLIAN_TYPE_REGULAR || tp->type == EOLIAN_TYPE_COMPLEX
|| tp->type == EOLIAN_TYPE_CLASS)
printf("%s", tp->full_name);
else if (tp->type == EOLIAN_TYPE_VOID)
printf("void");
else if (tp->type == EOLIAN_TYPE_STRUCT_OPAQUE)
printf("struct %s", tp->full_name);
else if (tp->type == EOLIAN_TYPE_POINTER)
{
database_type_print(tp->base_type);
putchar('*');
}
else if (tp->type == EOLIAN_TYPE_STRUCT)
{
Eolian_Struct_Type_Field *sf;
Eina_List *m;
printf("struct ");
if (tp->full_name) printf("%s ", tp->full_name);
printf("{ ");
EINA_LIST_FOREACH(tp->field_list, m, sf)
{
printf("%s: ", sf->name);
database_type_print(sf->type);
printf("; ");
}
printf("}");
}
else if (tp->type == EOLIAN_TYPE_ENUM)
{
Eolian_Enum_Type_Field *ef;
Eina_List *m;
printf("enum %s ", tp->full_name);
printf("{ ");
EINA_LIST_FOREACH(tp->field_list, m, ef)
{
printf("%s", ef->name);
if (ef->value)
{
printf(" = ");
database_expr_print(ef->value);
}
if (m != eina_list_last(tp->field_list))
printf(", ");
}
printf(" }");
}
if (tp->is_own)
putchar(')');
if (tp->is_const)
putchar(')');
}

View File

@ -310,7 +310,6 @@ void database_typedef_del(Eolian_Type *tp);
void database_typedecl_del(Eolian_Typedecl *tp);
void database_type_print(Eolian_Type *type);
void database_type_to_str(const Eolian_Type *tp, Eina_Strbuf *buf, const char *name);
/* expressions */