eina: add a function return a reference to a copy of Eina_Value.

This commit is contained in:
Cedric BAIL 2017-11-03 15:19:25 -07:00
parent 624b960155
commit e891a01749
1 changed files with 16 additions and 0 deletions

View File

@ -994,6 +994,22 @@ eina_value_dup(const Eina_Value *val)
return v;
}
/**
* @brief Return a reference to #Eina_Value containing a copy of the passed parameter
* @param val The value to use
* @return The #Eina_Value
* @since 1.21
*/
static inline Eina_Value
eina_value_reference_copy(const Eina_Value *val)
{
Eina_Value v = EINA_VALUE_EMPTY;
eina_value_setup(&v, eina_value_type_get(val));
eina_value_copy(val, &v);
return v;
}
/**
* @brief Copy the stringshare in the passed #Eina_Value
* @param val The value to copy