eina: add a function return a reference to a copy of Eina_Value.
authorCedric BAIL <cedric@osg.samsung.com>
Fri, 3 Nov 2017 22:19:25 +0000 (15:19 -0700)
committerCedric BAIL <cedric@osg.samsung.com>
Fri, 3 Nov 2017 22:31:30 +0000 (15:31 -0700)
src/lib/eina/eina_inline_value_util.x

index 3beca71..0104655 100644 (file)
@@ -995,6 +995,22 @@ eina_value_dup(const Eina_Value *val)
 }
 
 /**
+ * @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
  * @param str The pointer to copy the stringshare to