if (depth < 0)
{
ERR("%s: Cannot reopen < after >", save_buf);
- return NULL;
+ goto error;
}
depth++;
end_type = EINA_TRUE;
if (depth == 0)
{
ERR("%s: Too much >", save_buf);
- return NULL;
+ goto error;
}
if (d == tmp_type)
{
ERR("%s: empty type inside <>", save_buf);
- return NULL;
+ goto error;
}
if (depth > 0) depth *= -1;
depth++;
}
if (depth)
{
- types = NULL;
ERR("%s: < and > are not well used.", save_buf);
+ goto error;
}
+ goto success;
+error:
+ database_type_del(types);
+ types = NULL;
+success:
free(tmp_type);
return types;
}
if (depth < 0)
{
ERR("%s: Cannot reopen < after >", save_buf);
- return NULL;
+ goto error;
}
depth++;
end_type = EINA_TRUE;
if (depth == 0)
{
ERR("%s: Too much >", save_buf);
- return NULL;
+ goto error;
}
if (d == tmp_type)
{
ERR("%s: empty type inside <>", save_buf);
- return NULL;
+ goto error;
}
if (depth > 0) depth *= -1;
depth++;
}
if (depth)
{
- types = NULL;
ERR("%s: < and > are not well used.", save_buf);
+ goto error;
}
+ goto success;
+error:
+ database_type_del(types);
+ types = NULL;
+success:
free(tmp_type);
return types;
}
{
eina_stringshare_del(pdesc->name);
- while (pdesc->type)
- {
- _Parameter_Type *type = (_Parameter_Type *) pdesc->type;
- eina_stringshare_del(type->name);
- pdesc->type = eina_inlist_remove(pdesc->type, EINA_INLIST_GET(type));
- }
+ database_type_del(pdesc->type);
eina_stringshare_del(pdesc->description);
free(pdesc);
}
+void
+database_type_del(Eolian_Type type)
+{
+ while (type)
+ {
+ _Parameter_Type *ptype = (_Parameter_Type *) type;
+ eina_stringshare_del(ptype->name);
+ type = eina_inlist_remove(type, EINA_INLIST_GET(ptype));
+ }
+}
+
static void
_fid_del(_Function_Id *fid)
{
Eolian_Type database_type_append(Eolian_Type types, const char *name, Eina_Bool own);
+void database_type_del(Eolian_Type type);
+
void database_parameter_const_attribute_set(Eolian_Function_Parameter param_desc, Eina_Bool is_get, Eina_Bool is_const);
void database_parameter_nonull_set(Eolian_Function_Parameter, Eina_Bool nonull);