forked from enlightenment/efl
eolian: const correctness
This commit is contained in:
parent
dc1ea844a7
commit
133607936d
|
@ -737,7 +737,7 @@ EAPI Eolian_Type *eolian_type_struct_find_by_name(const char *name);
|
|||
*
|
||||
* @ingroup Eolian
|
||||
*/
|
||||
EAPI Eolian_Type_Type eolian_type_type_get(Eolian_Type *tp);
|
||||
EAPI Eolian_Type_Type eolian_type_type_get(const Eolian_Type *tp);
|
||||
|
||||
/*
|
||||
* @brief Get an iterator to all arguments of a function type.
|
||||
|
@ -747,7 +747,7 @@ EAPI Eolian_Type_Type eolian_type_type_get(Eolian_Type *tp);
|
|||
*
|
||||
* @ingroup Eolian
|
||||
*/
|
||||
EAPI Eina_Iterator *eolian_type_arguments_list_get(Eolian_Type *tp);
|
||||
EAPI Eina_Iterator *eolian_type_arguments_list_get(const Eolian_Type *tp);
|
||||
|
||||
/*
|
||||
* @brief Get an iterator to all subtypes of a type.
|
||||
|
@ -758,7 +758,7 @@ EAPI Eina_Iterator *eolian_type_arguments_list_get(Eolian_Type *tp);
|
|||
*
|
||||
* @ingroup Eolian
|
||||
*/
|
||||
EAPI Eina_Iterator *eolian_type_subtypes_list_get(Eolian_Type *tp);
|
||||
EAPI Eina_Iterator *eolian_type_subtypes_list_get(const Eolian_Type *tp);
|
||||
|
||||
/*
|
||||
* @brief Get an iterator to all field names of a struct type.
|
||||
|
@ -768,7 +768,7 @@ EAPI Eina_Iterator *eolian_type_subtypes_list_get(Eolian_Type *tp);
|
|||
*
|
||||
* @ingroup Eolian
|
||||
*/
|
||||
EAPI Eina_Iterator *eolian_type_struct_field_names_list_get(Eolian_Type *tp);
|
||||
EAPI Eina_Iterator *eolian_type_struct_field_names_list_get(const Eolian_Type *tp);
|
||||
|
||||
/*
|
||||
* @brief Get a field of a struct type.
|
||||
|
@ -780,7 +780,7 @@ EAPI Eina_Iterator *eolian_type_struct_field_names_list_get(Eolian_Type *tp);
|
|||
*
|
||||
* @ingroup Eolian
|
||||
*/
|
||||
EAPI Eolian_Type *eolian_type_struct_field_get(Eolian_Type *tp, const char *field);
|
||||
EAPI Eolian_Type *eolian_type_struct_field_get(const Eolian_Type *tp, const char *field);
|
||||
|
||||
/*
|
||||
* @brief Get the description of a field of a struct type.
|
||||
|
@ -792,7 +792,7 @@ EAPI Eolian_Type *eolian_type_struct_field_get(Eolian_Type *tp, const char *fiel
|
|||
*
|
||||
* @ingroup Eolian
|
||||
*/
|
||||
EAPI const char *eolian_type_struct_field_description_get(Eolian_Type *tp, const char *field);
|
||||
EAPI const char *eolian_type_struct_field_description_get(const Eolian_Type *tp, const char *field);
|
||||
|
||||
/*
|
||||
* @brief Get the description of a struct type.
|
||||
|
@ -802,7 +802,7 @@ EAPI const char *eolian_type_struct_field_description_get(Eolian_Type *tp, const
|
|||
*
|
||||
* @ingroup Eolian
|
||||
*/
|
||||
EAPI const char *eolian_type_struct_description_get(Eolian_Type *tp);
|
||||
EAPI const char *eolian_type_struct_description_get(const Eolian_Type *tp);
|
||||
|
||||
/*
|
||||
* @brief Get the return type of a function type.
|
||||
|
@ -812,7 +812,7 @@ EAPI const char *eolian_type_struct_description_get(Eolian_Type *tp);
|
|||
*
|
||||
* @ingroup Eolian
|
||||
*/
|
||||
EAPI Eolian_Type *eolian_type_return_type_get(Eolian_Type *tp);
|
||||
EAPI Eolian_Type *eolian_type_return_type_get(const Eolian_Type *tp);
|
||||
|
||||
/*
|
||||
* @brief Get the base type of a function type.
|
||||
|
@ -822,7 +822,7 @@ EAPI Eolian_Type *eolian_type_return_type_get(Eolian_Type *tp);
|
|||
*
|
||||
* @ingroup Eolian
|
||||
*/
|
||||
EAPI Eolian_Type *eolian_type_base_type_get(Eolian_Type *tp);
|
||||
EAPI Eolian_Type *eolian_type_base_type_get(const Eolian_Type *tp);
|
||||
|
||||
/*
|
||||
* @brief Get whether the given type is @own.
|
||||
|
@ -833,7 +833,7 @@ EAPI Eolian_Type *eolian_type_base_type_get(Eolian_Type *tp);
|
|||
*
|
||||
* @ingroup Eolian
|
||||
*/
|
||||
EAPI Eina_Bool eolian_type_is_own(Eolian_Type *tp);
|
||||
EAPI Eina_Bool eolian_type_is_own(const Eolian_Type *tp);
|
||||
|
||||
/*
|
||||
* @brief Get whether the given type is const.
|
||||
|
@ -844,7 +844,7 @@ EAPI Eina_Bool eolian_type_is_own(Eolian_Type *tp);
|
|||
*
|
||||
* @ingroup Eolian
|
||||
*/
|
||||
EAPI Eina_Bool eolian_type_is_const(Eolian_Type *tp);
|
||||
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.
|
||||
|
@ -864,7 +864,7 @@ EAPI Eina_Bool eolian_type_is_const(Eolian_Type *tp);
|
|||
*
|
||||
* @ingroup Eolian
|
||||
*/
|
||||
EAPI Eina_Stringshare *eolian_type_c_type_named_get(Eolian_Type *tp, const char *name);
|
||||
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.
|
||||
|
@ -880,7 +880,7 @@ EAPI Eina_Stringshare *eolian_type_c_type_named_get(Eolian_Type *tp, const char
|
|||
*
|
||||
* @ingroup Eolian
|
||||
*/
|
||||
EAPI Eina_Stringshare *eolian_type_c_type_get(Eolian_Type *tp);
|
||||
EAPI Eina_Stringshare *eolian_type_c_type_get(const Eolian_Type *tp);
|
||||
|
||||
/*
|
||||
* @brief Get the type name of the given type. You have to manually delete
|
||||
|
@ -892,7 +892,7 @@ EAPI Eina_Stringshare *eolian_type_c_type_get(Eolian_Type *tp);
|
|||
*
|
||||
* @ingroup Eolian
|
||||
*/
|
||||
EAPI Eina_Stringshare *eolian_type_name_get(Eolian_Type *tp);
|
||||
EAPI Eina_Stringshare *eolian_type_name_get(const Eolian_Type *tp);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1091,14 +1091,14 @@ eolian_class_dtor_enable_get(const Eolian_Class *cl)
|
|||
}
|
||||
|
||||
EAPI Eolian_Type_Type
|
||||
eolian_type_type_get(Eolian_Type *tp)
|
||||
eolian_type_type_get(const Eolian_Type *tp)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, EOLIAN_TYPE_UNKNOWN_TYPE);
|
||||
return tp->type;
|
||||
}
|
||||
|
||||
EAPI Eina_Iterator *
|
||||
eolian_type_arguments_list_get(Eolian_Type *tp)
|
||||
eolian_type_arguments_list_get(const Eolian_Type *tp)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(eolian_type_type_get(tp) == EOLIAN_TYPE_FUNCTION, NULL);
|
||||
|
@ -1107,7 +1107,7 @@ eolian_type_arguments_list_get(Eolian_Type *tp)
|
|||
}
|
||||
|
||||
EAPI Eina_Iterator *
|
||||
eolian_type_subtypes_list_get(Eolian_Type *tp)
|
||||
eolian_type_subtypes_list_get(const Eolian_Type *tp)
|
||||
{
|
||||
Eolian_Type_Type tpt;
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
|
||||
|
@ -1120,7 +1120,7 @@ eolian_type_subtypes_list_get(Eolian_Type *tp)
|
|||
}
|
||||
|
||||
EAPI Eina_Iterator *
|
||||
eolian_type_struct_field_names_list_get(Eolian_Type *tp)
|
||||
eolian_type_struct_field_names_list_get(const Eolian_Type *tp)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(tp->type == EOLIAN_TYPE_STRUCT, NULL);
|
||||
|
@ -1128,7 +1128,7 @@ eolian_type_struct_field_names_list_get(Eolian_Type *tp)
|
|||
}
|
||||
|
||||
EAPI Eolian_Type *
|
||||
eolian_type_struct_field_get(Eolian_Type *tp, const char *field)
|
||||
eolian_type_struct_field_get(const Eolian_Type *tp, const char *field)
|
||||
{
|
||||
_Struct_Field_Type *sf = NULL;
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
|
||||
|
@ -1140,7 +1140,7 @@ eolian_type_struct_field_get(Eolian_Type *tp, const char *field)
|
|||
}
|
||||
|
||||
EAPI const char *
|
||||
eolian_type_struct_field_description_get(Eolian_Type *tp, const char *field)
|
||||
eolian_type_struct_field_description_get(const Eolian_Type *tp, const char *field)
|
||||
{
|
||||
_Struct_Field_Type *sf = NULL;
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
|
||||
|
@ -1152,7 +1152,7 @@ eolian_type_struct_field_description_get(Eolian_Type *tp, const char *field)
|
|||
}
|
||||
|
||||
EAPI const char *
|
||||
eolian_type_struct_description_get(Eolian_Type *tp)
|
||||
eolian_type_struct_description_get(const Eolian_Type *tp)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(tp->type == EOLIAN_TYPE_STRUCT, NULL);
|
||||
|
@ -1160,7 +1160,7 @@ eolian_type_struct_description_get(Eolian_Type *tp)
|
|||
}
|
||||
|
||||
EAPI Eolian_Type *
|
||||
eolian_type_return_type_get(Eolian_Type *tp)
|
||||
eolian_type_return_type_get(const Eolian_Type *tp)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(eolian_type_type_get(tp) == EOLIAN_TYPE_FUNCTION, NULL);
|
||||
|
@ -1168,7 +1168,7 @@ eolian_type_return_type_get(Eolian_Type *tp)
|
|||
}
|
||||
|
||||
EAPI Eolian_Type *
|
||||
eolian_type_base_type_get(Eolian_Type *tp)
|
||||
eolian_type_base_type_get(const Eolian_Type *tp)
|
||||
{
|
||||
Eolian_Type_Type tpt;
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
|
||||
|
@ -1178,23 +1178,23 @@ eolian_type_base_type_get(Eolian_Type *tp)
|
|||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
eolian_type_is_own(Eolian_Type *tp)
|
||||
eolian_type_is_own(const Eolian_Type *tp)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, EINA_FALSE);
|
||||
return tp->is_own;
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
eolian_type_is_const(Eolian_Type *tp)
|
||||
eolian_type_is_const(const Eolian_Type *tp)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, EINA_FALSE);
|
||||
return tp->is_const;
|
||||
}
|
||||
|
||||
static void _type_to_str(Eolian_Type *tp, Eina_Strbuf *buf, const char *name);
|
||||
static void _type_to_str(const Eolian_Type *tp, Eina_Strbuf *buf, const char *name);
|
||||
|
||||
static void
|
||||
_ftype_to_str(Eolian_Type *tp, Eina_Strbuf *buf, const char *name)
|
||||
_ftype_to_str(const Eolian_Type *tp, Eina_Strbuf *buf, const char *name)
|
||||
{
|
||||
Eina_List *l;
|
||||
Eolian_Type *stp;
|
||||
|
@ -1225,7 +1225,7 @@ _stype_field_cb(const Eina_Hash *hash EINA_UNUSED, const void *key, void *data,
|
|||
}
|
||||
|
||||
static void
|
||||
_stype_to_str(Eolian_Type *tp, Eina_Strbuf *buf, const char *name)
|
||||
_stype_to_str(const Eolian_Type *tp, Eina_Strbuf *buf, const char *name)
|
||||
{
|
||||
eina_strbuf_append(buf, "struct ");
|
||||
if (tp->name)
|
||||
|
@ -1244,7 +1244,7 @@ _stype_to_str(Eolian_Type *tp, Eina_Strbuf *buf, const char *name)
|
|||
}
|
||||
|
||||
static void
|
||||
_type_to_str(Eolian_Type *tp, Eina_Strbuf *buf, const char *name)
|
||||
_type_to_str(const Eolian_Type *tp, Eina_Strbuf *buf, const char *name)
|
||||
{
|
||||
if (tp->type == EOLIAN_TYPE_FUNCTION)
|
||||
{
|
||||
|
@ -1289,7 +1289,7 @@ _type_to_str(Eolian_Type *tp, Eina_Strbuf *buf, const char *name)
|
|||
}
|
||||
|
||||
EAPI Eina_Stringshare *
|
||||
eolian_type_c_type_named_get(Eolian_Type *tp, const char *name)
|
||||
eolian_type_c_type_named_get(const Eolian_Type *tp, const char *name)
|
||||
{
|
||||
Eina_Stringshare *ret;
|
||||
Eina_Strbuf *buf;
|
||||
|
@ -1302,13 +1302,13 @@ eolian_type_c_type_named_get(Eolian_Type *tp, const char *name)
|
|||
}
|
||||
|
||||
EAPI Eina_Stringshare *
|
||||
eolian_type_c_type_get(Eolian_Type *tp)
|
||||
eolian_type_c_type_get(const Eolian_Type *tp)
|
||||
{
|
||||
return eolian_type_c_type_named_get(tp, NULL);
|
||||
}
|
||||
|
||||
EAPI Eina_Stringshare *
|
||||
eolian_type_name_get(Eolian_Type *tp)
|
||||
eolian_type_name_get(const Eolian_Type *tp)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
|
||||
eina_stringshare_ref(tp->name);
|
||||
|
|
Loading…
Reference in New Issue