summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuilherme Iscaro <iscaro@profusion.mobi>2017-08-17 14:36:47 -0300
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-08-23 18:32:13 -0300
commit6cbfe100d5f2d6771e9f68883a5c81ee8735e710 (patch)
tree475b0e418967ddc5f99807f91514abc01be6b1d0
parent3ed176370d077ede61c75d61e9f7ecf83d84cd11 (diff)
Eina_Value type EINA_value.
-rw-r--r--src/lib/eina/eina_value.c89
-rw-r--r--src/lib/eina/eina_value.h39
-rw-r--r--src/tests/eina/eina_test_value.c69
3 files changed, 197 insertions, 0 deletions
diff --git a/src/lib/eina/eina_value.c b/src/lib/eina/eina_value.c
index 3e8cff721b..cdc237d202 100644
--- a/src/lib/eina/eina_value.c
+++ b/src/lib/eina/eina_value.c
@@ -3796,6 +3796,91 @@ static const Eina_Value_Type _EINA_VALUE_TYPE_BLOB = {
3796 _eina_value_type_blob_pget 3796 _eina_value_type_blob_pget
3797}; 3797};
3798 3798
3799static Eina_Bool
3800_eina_value_type_value_setup(const Eina_Value_Type *type EINA_UNUSED, void *mem)
3801{
3802 Eina_Value *v = mem;
3803 memset(v, 0, sizeof(Eina_Value));
3804 return EINA_TRUE;
3805}
3806
3807static Eina_Bool
3808_eina_value_type_value_flush(const Eina_Value_Type *type EINA_UNUSED, void *mem)
3809{
3810 Eina_Value *v = mem;
3811 eina_value_flush(v);
3812 return EINA_TRUE;
3813}
3814
3815static Eina_Bool
3816_eina_value_type_value_copy(const Eina_Value_Type *type EINA_UNUSED, const void *src, void *dst)
3817{
3818 const Eina_Value *v_src = src;
3819 Eina_Value *v_dst = dst;
3820 return eina_value_copy(v_src, v_dst);
3821}
3822
3823static int
3824_eina_value_type_value_compare(const Eina_Value_Type *type EINA_UNUSED, const void *a, const void *b)
3825{
3826 const Eina_Value *v1 = a;
3827 const Eina_Value *v2 = b;
3828 return eina_value_compare(v1, v2);
3829}
3830
3831static Eina_Bool
3832_eina_value_type_value_convert_to(const Eina_Value_Type *type EINA_UNUSED, const Eina_Value_Type *convert, const void *type_mem, void *convert_mem)
3833{
3834 const Eina_Value *v = type_mem;
3835 return eina_value_type_convert_to(v->type, convert, eina_value_memory_get(v), convert_mem);
3836}
3837
3838static Eina_Bool
3839_eina_value_type_value_convert_from(const Eina_Value_Type *type EINA_UNUSED, const Eina_Value_Type *convert, void *type_mem, const void *convert_mem)
3840{
3841 Eina_Value *v = type_mem;
3842 return eina_value_type_convert_from(v->type, convert, eina_value_memory_get(v), convert_mem);
3843}
3844
3845static Eina_Bool
3846_eina_value_type_value_vset(const Eina_Value_Type *type EINA_UNUSED, void *mem, va_list args)
3847{
3848 Eina_Value *dst = mem;
3849 Eina_Value src = va_arg(args, Eina_Value);
3850 return eina_value_copy(&src, dst);
3851}
3852
3853static Eina_Bool
3854_eina_value_type_value_pset(const Eina_Value_Type *type EINA_UNUSED, void *mem, const void *ptr)
3855{
3856 Eina_Value *dst = mem;
3857 const Eina_Value *src = ptr;
3858 return eina_value_copy(src, dst);
3859}
3860
3861static Eina_Bool
3862_eina_value_type_value_pget(const Eina_Value_Type *type EINA_UNUSED, const void *mem, void *ptr)
3863{
3864 const Eina_Value *src = mem;
3865 Eina_Value *dst = ptr;
3866 return eina_value_copy(src, dst);
3867}
3868
3869static const Eina_Value_Type _EINA_VALUE_TYPE_VALUE = {
3870 EINA_VALUE_TYPE_VERSION,
3871 sizeof(Eina_Value),
3872 "Eina_Value",
3873 _eina_value_type_value_setup,
3874 _eina_value_type_value_flush,
3875 _eina_value_type_value_copy,
3876 _eina_value_type_value_compare,
3877 _eina_value_type_value_convert_to,
3878 _eina_value_type_value_convert_from,
3879 _eina_value_type_value_vset,
3880 _eina_value_type_value_pset,
3881 _eina_value_type_value_pget
3882};
3883
3799static int 3884static int
3800_eina_value_struct_operations_binsearch_cmp(const void *pa, const void *pb) 3885_eina_value_struct_operations_binsearch_cmp(const void *pa, const void *pb)
3801{ 3886{
@@ -5042,6 +5127,9 @@ eina_value_init(void)
5042 EINA_VALUE_STRUCT_OPERATIONS_BINSEARCH = &_EINA_VALUE_STRUCT_OPERATIONS_BINSEARCH; 5127 EINA_VALUE_STRUCT_OPERATIONS_BINSEARCH = &_EINA_VALUE_STRUCT_OPERATIONS_BINSEARCH;
5043 EINA_VALUE_STRUCT_OPERATIONS_STRINGSHARE = &_EINA_VALUE_STRUCT_OPERATIONS_STRINGSHARE; 5128 EINA_VALUE_STRUCT_OPERATIONS_STRINGSHARE = &_EINA_VALUE_STRUCT_OPERATIONS_STRINGSHARE;
5044 5129
5130 EINA_VALUE_TYPE_VALUE = &_EINA_VALUE_TYPE_VALUE;
5131
5132
5045 return EINA_TRUE; 5133 return EINA_TRUE;
5046 5134
5047 on_init_fail_hash: 5135 on_init_fail_hash:
@@ -5097,6 +5185,7 @@ eina_value_shutdown(void)
5097EAPI const Eina_Value_Type *_EINA_VALUE_TYPE_BASICS_START = NULL; 5185EAPI const Eina_Value_Type *_EINA_VALUE_TYPE_BASICS_START = NULL;
5098EAPI const Eina_Value_Type *_EINA_VALUE_TYPE_BASICS_END = NULL; 5186EAPI const Eina_Value_Type *_EINA_VALUE_TYPE_BASICS_END = NULL;
5099 5187
5188EAPI const Eina_Value_Type *EINA_VALUE_TYPE_VALUE = NULL;
5100EAPI const Eina_Value_Type *EINA_VALUE_TYPE_ERROR = NULL; 5189EAPI const Eina_Value_Type *EINA_VALUE_TYPE_ERROR = NULL;
5101EAPI const Eina_Value_Type *EINA_VALUE_TYPE_UCHAR = NULL; 5190EAPI const Eina_Value_Type *EINA_VALUE_TYPE_UCHAR = NULL;
5102EAPI const Eina_Value_Type *EINA_VALUE_TYPE_USHORT = NULL; 5191EAPI const Eina_Value_Type *EINA_VALUE_TYPE_USHORT = NULL;
diff --git a/src/lib/eina/eina_value.h b/src/lib/eina/eina_value.h
index 87354cd612..a1ed51df5f 100644
--- a/src/lib/eina/eina_value.h
+++ b/src/lib/eina/eina_value.h
@@ -362,6 +362,17 @@ union _Eina_Value_Union
362EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_ERROR; 362EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_ERROR;
363 363
364/** 364/**
365 * @var EINA_VALUE_TYPE_VALUE
366 * manages Eina_Value values.
367 * This value will hold an Eina_Value,
368 * which can be usefull for storing data
369 * inside an #Eina_Value_Array.
370 *
371 * @since 1.21
372 */
373EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_VALUE;
374
375/**
365 * @var EINA_VALUE_TYPE_UCHAR 376 * @var EINA_VALUE_TYPE_UCHAR
366 * manages unsigned char type. 377 * manages unsigned char type.
367 * 378 *
@@ -744,6 +755,7 @@ static inline int eina_value_compare(const Eina_Value *a,
744 * The variable argument is dependent on chosen type. The list for 755 * The variable argument is dependent on chosen type. The list for
745 * basic types: 756 * basic types:
746 * 757 *
758 * @li EINA_VALUE_TYPE_VALUE: Eina_Value
747 * @li EINA_VALUE_TYPE_ERROR: Eina_Error 759 * @li EINA_VALUE_TYPE_ERROR: Eina_Error
748 * @li EINA_VALUE_TYPE_UCHAR: unsigned char 760 * @li EINA_VALUE_TYPE_UCHAR: unsigned char
749 * @li EINA_VALUE_TYPE_USHORT: unsigned short 761 * @li EINA_VALUE_TYPE_USHORT: unsigned short
@@ -806,6 +818,7 @@ static inline Eina_Bool eina_value_set(Eina_Value *value,
806 * The variable argument is dependent on chosen type. The list for 818 * The variable argument is dependent on chosen type. The list for
807 * basic types: 819 * basic types:
808 * 820 *
821 * @li EINA_VALUE_TYPE_VALUE: Eina_Value*
809 * @li EINA_VALUE_TYPE_ERROR: Eina_Error* 822 * @li EINA_VALUE_TYPE_ERROR: Eina_Error*
810 * @li EINA_VALUE_TYPE_UCHAR: unsigned char* 823 * @li EINA_VALUE_TYPE_UCHAR: unsigned char*
811 * @li EINA_VALUE_TYPE_USHORT: unsigned short* 824 * @li EINA_VALUE_TYPE_USHORT: unsigned short*
@@ -910,6 +923,7 @@ static inline Eina_Bool eina_value_vget(const Eina_Value *value,
910 * The pointer type is dependent on chosen value type. The list for 923 * The pointer type is dependent on chosen value type. The list for
911 * basic types: 924 * basic types:
912 * 925 *
926 * @li EINA_VALUE_TYPE_VALUE: Eina_Value*
913 * @li EINA_VALUE_TYPE_ERROR: Eina_Error* 927 * @li EINA_VALUE_TYPE_ERROR: Eina_Error*
914 * @li EINA_VALUE_TYPE_UCHAR: unsigned char* 928 * @li EINA_VALUE_TYPE_UCHAR: unsigned char*
915 * @li EINA_VALUE_TYPE_USHORT: unsigned short* 929 * @li EINA_VALUE_TYPE_USHORT: unsigned short*
@@ -977,6 +991,7 @@ static inline Eina_Bool eina_value_pset(Eina_Value *value,
977 * The pointer type is dependent on chosen value type. The list for 991 * The pointer type is dependent on chosen value type. The list for
978 * basic types: 992 * basic types:
979 * 993 *
994 * @li EINA_VALUE_TYPE_VALUE: Eina_Value*
980 * @li EINA_VALUE_TYPE_ERROR: Eina_Error* 995 * @li EINA_VALUE_TYPE_ERROR: Eina_Error*
981 * @li EINA_VALUE_TYPE_UCHAR: unsigned char* 996 * @li EINA_VALUE_TYPE_UCHAR: unsigned char*
982 * @li EINA_VALUE_TYPE_USHORT: unsigned short* 997 * @li EINA_VALUE_TYPE_USHORT: unsigned short*
@@ -1186,6 +1201,7 @@ static inline Eina_Bool eina_value_array_remove(Eina_Value *value,
1186 * The variable argument is dependent on chosen subtype. The list for 1201 * The variable argument is dependent on chosen subtype. The list for
1187 * basic types: 1202 * basic types:
1188 * 1203 *
1204 * @li EINA_VALUE_TYPE_VALUE: Eina_Value
1189 * @li EINA_VALUE_TYPE_ERROR: Eina_Error 1205 * @li EINA_VALUE_TYPE_ERROR: Eina_Error
1190 * @li EINA_VALUE_TYPE_UCHAR: unsigned char 1206 * @li EINA_VALUE_TYPE_UCHAR: unsigned char
1191 * @li EINA_VALUE_TYPE_USHORT: unsigned short 1207 * @li EINA_VALUE_TYPE_USHORT: unsigned short
@@ -1248,6 +1264,7 @@ static inline Eina_Bool eina_value_array_set(Eina_Value *value,
1248 * The variable argument is dependent on chosen subtype. The list for 1264 * The variable argument is dependent on chosen subtype. The list for
1249 * basic types: 1265 * basic types:
1250 * 1266 *
1267 * @li EINA_VALUE_TYPE_VALUE: Eina_Value*
1251 * @li EINA_VALUE_TYPE_ERROR: Eina_Error* 1268 * @li EINA_VALUE_TYPE_ERROR: Eina_Error*
1252 * @li EINA_VALUE_TYPE_UCHAR: unsigned char* 1269 * @li EINA_VALUE_TYPE_UCHAR: unsigned char*
1253 * @li EINA_VALUE_TYPE_USHORT: unsigned short* 1270 * @li EINA_VALUE_TYPE_USHORT: unsigned short*
@@ -1298,6 +1315,7 @@ static inline Eina_Bool eina_value_array_get(const Eina_Value *value,
1298 * The variable argument is dependent on chosen subtype. The list for 1315 * The variable argument is dependent on chosen subtype. The list for
1299 * basic types: 1316 * basic types:
1300 * 1317 *
1318 * @li EINA_VALUE_TYPE_VALUE: Eina_Value
1301 * @li EINA_VALUE_TYPE_ERROR: Eina_Error 1319 * @li EINA_VALUE_TYPE_ERROR: Eina_Error
1302 * @li EINA_VALUE_TYPE_UCHAR: unsigned char 1320 * @li EINA_VALUE_TYPE_UCHAR: unsigned char
1303 * @li EINA_VALUE_TYPE_USHORT: unsigned short 1321 * @li EINA_VALUE_TYPE_USHORT: unsigned short
@@ -1354,6 +1372,7 @@ static inline Eina_Bool eina_value_array_insert(Eina_Value *value,
1354 * The variable argument is dependent on chosen subtype. The list for 1372 * The variable argument is dependent on chosen subtype. The list for
1355 * basic types: 1373 * basic types:
1356 * 1374 *
1375 * @li EINA_VALUE_TYPE_VALUE: Eina_Value
1357 * @li EINA_VALUE_TYPE_ERROR: Eina_Error 1376 * @li EINA_VALUE_TYPE_ERROR: Eina_Error
1358 * @li EINA_VALUE_TYPE_UCHAR: unsigned char 1377 * @li EINA_VALUE_TYPE_UCHAR: unsigned char
1359 * @li EINA_VALUE_TYPE_USHORT: unsigned short 1378 * @li EINA_VALUE_TYPE_USHORT: unsigned short
@@ -1496,6 +1515,7 @@ static inline Eina_Bool eina_value_array_vappend(Eina_Value *value,
1496 * The pointer type is dependent on chosen value type. The list for 1515 * The pointer type is dependent on chosen value type. The list for
1497 * basic types: 1516 * basic types:
1498 * 1517 *
1518 * @li EINA_VALUE_TYPE_VALUE: Eina_Value*
1499 * @li EINA_VALUE_TYPE_ERROR: Eina_Error* 1519 * @li EINA_VALUE_TYPE_ERROR: Eina_Error*
1500 * @li EINA_VALUE_TYPE_UCHAR: unsigned char* 1520 * @li EINA_VALUE_TYPE_UCHAR: unsigned char*
1501 * @li EINA_VALUE_TYPE_USHORT: unsigned short* 1521 * @li EINA_VALUE_TYPE_USHORT: unsigned short*
@@ -1562,6 +1582,7 @@ static inline Eina_Bool eina_value_array_pset(Eina_Value *value,
1562 * The pointer type is dependent on chosen value type. The list for 1582 * The pointer type is dependent on chosen value type. The list for
1563 * basic types: 1583 * basic types:
1564 * 1584 *
1585 * @li EINA_VALUE_TYPE_VALUE: Eina_Value*
1565 * @li EINA_VALUE_TYPE_ERROR: Eina_Error* 1586 * @li EINA_VALUE_TYPE_ERROR: Eina_Error*
1566 * @li EINA_VALUE_TYPE_UCHAR: unsigned char* 1587 * @li EINA_VALUE_TYPE_UCHAR: unsigned char*
1567 * @li EINA_VALUE_TYPE_USHORT: unsigned short* 1588 * @li EINA_VALUE_TYPE_USHORT: unsigned short*
@@ -1613,6 +1634,7 @@ static inline Eina_Bool eina_value_array_pget(const Eina_Value *value,
1613 * The pointer type is dependent on chosen value type. The list for 1634 * The pointer type is dependent on chosen value type. The list for
1614 * basic types: 1635 * basic types:
1615 * 1636 *
1637 * @li EINA_VALUE_TYPE_VALUE: Eina_Value*
1616 * @li EINA_VALUE_TYPE_ERROR: Eina_Error* 1638 * @li EINA_VALUE_TYPE_ERROR: Eina_Error*
1617 * @li EINA_VALUE_TYPE_UCHAR: unsigned char* 1639 * @li EINA_VALUE_TYPE_UCHAR: unsigned char*
1618 * @li EINA_VALUE_TYPE_USHORT: unsigned short* 1640 * @li EINA_VALUE_TYPE_USHORT: unsigned short*
@@ -1672,6 +1694,7 @@ static inline Eina_Bool eina_value_array_pinsert(Eina_Value *value,
1672 * The pointer type is dependent on chosen value type. The list for 1694 * The pointer type is dependent on chosen value type. The list for
1673 * basic types: 1695 * basic types:
1674 * 1696 *
1697 * @li EINA_VALUE_TYPE_VALUE: Eina_Value*
1675 * @li EINA_VALUE_TYPE_ERROR: Eina_Error* 1698 * @li EINA_VALUE_TYPE_ERROR: Eina_Error*
1676 * @li EINA_VALUE_TYPE_UCHAR: unsigned char* 1699 * @li EINA_VALUE_TYPE_UCHAR: unsigned char*
1677 * @li EINA_VALUE_TYPE_USHORT: unsigned short* 1700 * @li EINA_VALUE_TYPE_USHORT: unsigned short*
@@ -1841,6 +1864,7 @@ static inline Eina_Bool eina_value_list_remove(Eina_Value *value,
1841 * The variable argument is dependent on chosen subtype. The list for 1864 * The variable argument is dependent on chosen subtype. The list for
1842 * basic types: 1865 * basic types:
1843 * 1866 *
1867 * @li EINA_VALUE_TYPE_VALUE: Eina_Value
1844 * @li EINA_VALUE_TYPE_ERROR: Eina_Error 1868 * @li EINA_VALUE_TYPE_ERROR: Eina_Error
1845 * @li EINA_VALUE_TYPE_UCHAR: unsigned char 1869 * @li EINA_VALUE_TYPE_UCHAR: unsigned char
1846 * @li EINA_VALUE_TYPE_USHORT: unsigned short 1870 * @li EINA_VALUE_TYPE_USHORT: unsigned short
@@ -1902,6 +1926,7 @@ static inline Eina_Bool eina_value_list_set(Eina_Value *value,
1902 * The variable argument is dependent on chosen subtype. The list for 1926 * The variable argument is dependent on chosen subtype. The list for
1903 * basic types: 1927 * basic types:
1904 * 1928 *
1929 * @li EINA_VALUE_TYPE_VALUE: Eina_Value*
1905 * @li EINA_VALUE_TYPE_ERROR: Eina_Error* 1930 * @li EINA_VALUE_TYPE_ERROR: Eina_Error*
1906 * @li EINA_VALUE_TYPE_UCHAR: unsigned char* 1931 * @li EINA_VALUE_TYPE_UCHAR: unsigned char*
1907 * @li EINA_VALUE_TYPE_USHORT: unsigned short* 1932 * @li EINA_VALUE_TYPE_USHORT: unsigned short*
@@ -1951,6 +1976,7 @@ static inline Eina_Bool eina_value_list_get(const Eina_Value *value,
1951 * The variable argument is dependent on chosen subtype. The list for 1976 * The variable argument is dependent on chosen subtype. The list for
1952 * basic types: 1977 * basic types:
1953 * 1978 *
1979 * @li EINA_VALUE_TYPE_VALUE: Eina_Value
1954 * @li EINA_VALUE_TYPE_ERROR: Eina_Error 1980 * @li EINA_VALUE_TYPE_ERROR: Eina_Error
1955 * @li EINA_VALUE_TYPE_UCHAR: unsigned char 1981 * @li EINA_VALUE_TYPE_UCHAR: unsigned char
1956 * @li EINA_VALUE_TYPE_USHORT: unsigned short 1982 * @li EINA_VALUE_TYPE_USHORT: unsigned short
@@ -2006,6 +2032,7 @@ static inline Eina_Bool eina_value_list_insert(Eina_Value *value,
2006 * The variable argument is dependent on chosen subtype. The list for 2032 * The variable argument is dependent on chosen subtype. The list for
2007 * basic types: 2033 * basic types:
2008 * 2034 *
2035 * @li EINA_VALUE_TYPE_VALUE: Eina_Value
2009 * @li EINA_VALUE_TYPE_ERROR: Eina_Error 2036 * @li EINA_VALUE_TYPE_ERROR: Eina_Error
2010 * @li EINA_VALUE_TYPE_UCHAR: unsigned char 2037 * @li EINA_VALUE_TYPE_UCHAR: unsigned char
2011 * @li EINA_VALUE_TYPE_USHORT: unsigned short 2038 * @li EINA_VALUE_TYPE_USHORT: unsigned short
@@ -2147,6 +2174,7 @@ static inline Eina_Bool eina_value_list_vappend(Eina_Value *value,
2147 * The pointer type is dependent on chosen value type. The list for 2174 * The pointer type is dependent on chosen value type. The list for
2148 * basic types: 2175 * basic types:
2149 * 2176 *
2177 * @li EINA_VALUE_TYPE_VALUE: Eina_Value*
2150 * @li EINA_VALUE_TYPE_ERROR: Eina_Error* 2178 * @li EINA_VALUE_TYPE_ERROR: Eina_Error*
2151 * @li EINA_VALUE_TYPE_UCHAR: unsigned char* 2179 * @li EINA_VALUE_TYPE_UCHAR: unsigned char*
2152 * @li EINA_VALUE_TYPE_USHORT: unsigned short* 2180 * @li EINA_VALUE_TYPE_USHORT: unsigned short*
@@ -2212,6 +2240,7 @@ static inline Eina_Bool eina_value_list_pset(Eina_Value *value,
2212 * The pointer type is dependent on chosen value type. The list for 2240 * The pointer type is dependent on chosen value type. The list for
2213 * basic types: 2241 * basic types:
2214 * 2242 *
2243 * @li EINA_VALUE_TYPE_VALUE: Eina_Value*
2215 * @li EINA_VALUE_TYPE_ERROR: Eina_Error* 2244 * @li EINA_VALUE_TYPE_ERROR: Eina_Error*
2216 * @li EINA_VALUE_TYPE_UCHAR: unsigned char* 2245 * @li EINA_VALUE_TYPE_UCHAR: unsigned char*
2217 * @li EINA_VALUE_TYPE_USHORT: unsigned short* 2246 * @li EINA_VALUE_TYPE_USHORT: unsigned short*
@@ -2262,6 +2291,7 @@ static inline Eina_Bool eina_value_list_pget(const Eina_Value *value,
2262 * The pointer type is dependent on chosen value type. The list for 2291 * The pointer type is dependent on chosen value type. The list for
2263 * basic types: 2292 * basic types:
2264 * 2293 *
2294 * @li EINA_VALUE_TYPE_VALUE: Eina_Value*
2265 * @li EINA_VALUE_TYPE_ERROR: Eina_Error* 2295 * @li EINA_VALUE_TYPE_ERROR: Eina_Error*
2266 * @li EINA_VALUE_TYPE_UCHAR: unsigned char* 2296 * @li EINA_VALUE_TYPE_UCHAR: unsigned char*
2267 * @li EINA_VALUE_TYPE_USHORT: unsigned short* 2297 * @li EINA_VALUE_TYPE_USHORT: unsigned short*
@@ -2320,6 +2350,7 @@ static inline Eina_Bool eina_value_list_pinsert(Eina_Value *value,
2320 * The pointer type is dependent on chosen value type. The list for 2350 * The pointer type is dependent on chosen value type. The list for
2321 * basic types: 2351 * basic types:
2322 * 2352 *
2353 * @li EINA_VALUE_TYPE_VALUE: Eina_Value*
2323 * @li EINA_VALUE_TYPE_ERROR: Eina_Error* 2354 * @li EINA_VALUE_TYPE_ERROR: Eina_Error*
2324 * @li EINA_VALUE_TYPE_UCHAR: unsigned char* 2355 * @li EINA_VALUE_TYPE_UCHAR: unsigned char*
2325 * @li EINA_VALUE_TYPE_USHORT: unsigned short* 2356 * @li EINA_VALUE_TYPE_USHORT: unsigned short*
@@ -2476,6 +2507,7 @@ static inline Eina_Bool eina_value_hash_del(Eina_Value *value,
2476 * The variable argument is dependent on chosen subtype. The list for 2507 * The variable argument is dependent on chosen subtype. The list for
2477 * basic types: 2508 * basic types:
2478 * 2509 *
2510 * @li EINA_VALUE_TYPE_VALUE: Eina_Value
2479 * @li EINA_VALUE_TYPE_ERROR: Eina_Error 2511 * @li EINA_VALUE_TYPE_ERROR: Eina_Error
2480 * @li EINA_VALUE_TYPE_UCHAR: unsigned char 2512 * @li EINA_VALUE_TYPE_UCHAR: unsigned char
2481 * @li EINA_VALUE_TYPE_USHORT: unsigned short 2513 * @li EINA_VALUE_TYPE_USHORT: unsigned short
@@ -2530,6 +2562,7 @@ static inline Eina_Bool eina_value_hash_set(Eina_Value *value,
2530 * The variable argument is dependent on chosen subtype. The list for 2562 * The variable argument is dependent on chosen subtype. The list for
2531 * basic types: 2563 * basic types:
2532 * 2564 *
2565 * @li EINA_VALUE_TYPE_VALUE: Eina_Value*
2533 * @li EINA_VALUE_TYPE_ERROR: Eina_Error* 2566 * @li EINA_VALUE_TYPE_ERROR: Eina_Error*
2534 * @li EINA_VALUE_TYPE_UCHAR: unsigned char* 2567 * @li EINA_VALUE_TYPE_UCHAR: unsigned char*
2535 * @li EINA_VALUE_TYPE_USHORT: unsigned short* 2568 * @li EINA_VALUE_TYPE_USHORT: unsigned short*
@@ -2617,6 +2650,7 @@ static inline Eina_Bool eina_value_hash_vget(const Eina_Value *value,
2617 * The pointer type is dependent on chosen value type. The list for 2650 * The pointer type is dependent on chosen value type. The list for
2618 * basic types: 2651 * basic types:
2619 * 2652 *
2653 * @li EINA_VALUE_TYPE_VALUE: Eina_Value*
2620 * @li EINA_VALUE_TYPE_ERROR: Eina_Error* 2654 * @li EINA_VALUE_TYPE_ERROR: Eina_Error*
2621 * @li EINA_VALUE_TYPE_UCHAR: unsigned char* 2655 * @li EINA_VALUE_TYPE_UCHAR: unsigned char*
2622 * @li EINA_VALUE_TYPE_USHORT: unsigned short* 2656 * @li EINA_VALUE_TYPE_USHORT: unsigned short*
@@ -2674,6 +2708,7 @@ static inline Eina_Bool eina_value_hash_pset(Eina_Value *value,
2674 * The pointer type is dependent on chosen value type. The list for 2708 * The pointer type is dependent on chosen value type. The list for
2675 * basic types: 2709 * basic types:
2676 * 2710 *
2711 * @li EINA_VALUE_TYPE_VALUE: Eina_Value*
2677 * @li EINA_VALUE_TYPE_ERROR: Eina_Error* 2712 * @li EINA_VALUE_TYPE_ERROR: Eina_Error*
2678 * @li EINA_VALUE_TYPE_UCHAR: unsigned char* 2713 * @li EINA_VALUE_TYPE_UCHAR: unsigned char*
2679 * @li EINA_VALUE_TYPE_USHORT: unsigned short* 2714 * @li EINA_VALUE_TYPE_USHORT: unsigned short*
@@ -3020,6 +3055,7 @@ static inline Eina_Bool eina_value_struct_setup(Eina_Value *value,
3020 * The variable argument is dependent on chosen member type. The list 3055 * The variable argument is dependent on chosen member type. The list
3021 * for basic types: 3056 * for basic types:
3022 * 3057 *
3058 * @li EINA_VALUE_TYPE_VALUE: Eina_Value
3023 * @li EINA_VALUE_TYPE_ERROR: Eina_Error 3059 * @li EINA_VALUE_TYPE_ERROR: Eina_Error
3024 * @li EINA_VALUE_TYPE_UCHAR: unsigned char 3060 * @li EINA_VALUE_TYPE_UCHAR: unsigned char
3025 * @li EINA_VALUE_TYPE_USHORT: unsigned short 3061 * @li EINA_VALUE_TYPE_USHORT: unsigned short
@@ -3089,6 +3125,7 @@ static inline Eina_Bool eina_value_struct_set(Eina_Value *value,
3089 * The variable argument is dependent on chosen member type. The list 3125 * The variable argument is dependent on chosen member type. The list
3090 * for basic types: 3126 * for basic types:
3091 * 3127 *
3128 * @li EINA_VALUE_TYPE_VALUE: Eina_Value*
3092 * @li EINA_VALUE_TYPE_ERROR: Eina_Error* 3129 * @li EINA_VALUE_TYPE_ERROR: Eina_Error*
3093 * @li EINA_VALUE_TYPE_UCHAR: unsigned char* 3130 * @li EINA_VALUE_TYPE_UCHAR: unsigned char*
3094 * @li EINA_VALUE_TYPE_USHORT: unsigned short* 3131 * @li EINA_VALUE_TYPE_USHORT: unsigned short*
@@ -3192,6 +3229,7 @@ static inline Eina_Bool eina_value_struct_vget(const Eina_Value *value,
3192 * The pointer type is dependent on chosen value type. The list for 3229 * The pointer type is dependent on chosen value type. The list for
3193 * basic types: 3230 * basic types:
3194 * 3231 *
3232 * @li EINA_VALUE_TYPE_VALUE: Eina_Value*
3195 * @li EINA_VALUE_TYPE_ERROR: Eina_Error* 3233 * @li EINA_VALUE_TYPE_ERROR: Eina_Error*
3196 * @li EINA_VALUE_TYPE_UCHAR: unsigned char* 3234 * @li EINA_VALUE_TYPE_UCHAR: unsigned char*
3197 * @li EINA_VALUE_TYPE_USHORT: unsigned short* 3235 * @li EINA_VALUE_TYPE_USHORT: unsigned short*
@@ -3265,6 +3303,7 @@ static inline Eina_Bool eina_value_struct_pset(Eina_Value *value,
3265 * The pointer type is dependent on chosen value type. The list for 3303 * The pointer type is dependent on chosen value type. The list for
3266 * basic types: 3304 * basic types:
3267 * 3305 *
3306 * @li EINA_VALUE_TYPE_VALUE: Eina_Value*
3268 * @li EINA_VALUE_TYPE_ERROR: Eina_Error* 3307 * @li EINA_VALUE_TYPE_ERROR: Eina_Error*
3269 * @li EINA_VALUE_TYPE_UCHAR: unsigned char* 3308 * @li EINA_VALUE_TYPE_UCHAR: unsigned char*
3270 * @li EINA_VALUE_TYPE_USHORT: unsigned short* 3309 * @li EINA_VALUE_TYPE_USHORT: unsigned short*
diff --git a/src/tests/eina/eina_test_value.c b/src/tests/eina/eina_test_value.c
index df0771008c..9bdcc4c120 100644
--- a/src/tests/eina/eina_test_value.c
+++ b/src/tests/eina/eina_test_value.c
@@ -2873,6 +2873,73 @@ START_TEST(eina_value_test_optional_struct_members)
2873} 2873}
2874END_TEST 2874END_TEST
2875 2875
2876START_TEST(eina_value_test_value)
2877{
2878 Eina_Value composed, v;
2879 const int ivalue = 3500;
2880 int i;
2881 const char *str;
2882
2883 eina_init();
2884
2885 fail_if(!eina_value_setup(&composed, EINA_VALUE_TYPE_VALUE));
2886 fail_if(!eina_value_setup(&v, EINA_VALUE_TYPE_INT));
2887 fail_if(!eina_value_set(&v, ivalue));
2888 fail_if(!eina_value_set(&composed, v));
2889
2890 fail_if(!eina_value_get(&composed, &v));
2891 fail_if(!eina_value_get(&v, &i));
2892 fail_if(i != ivalue);
2893
2894 eina_value_flush(&v);
2895 fail_if(!eina_value_setup(&v, EINA_VALUE_TYPE_STRING));
2896 fail_if(!eina_value_convert(&composed, &v));
2897 fail_if(!eina_value_get(&v, &str));
2898 ck_assert_str_eq(str, "3500");
2899
2900 eina_value_flush(&v);
2901 fail_if(!eina_value_copy(&composed, &v));
2902 fail_if(eina_value_compare(&composed, &v));
2903
2904 eina_value_flush(&v);
2905 eina_value_flush(&composed);
2906 eina_shutdown();
2907}
2908END_TEST
2909
2910START_TEST(eina_value_test_value_string)
2911{
2912 Eina_Value composed, v, str_v;
2913 const char *msg = "A string", *str;
2914
2915 eina_init();
2916
2917 fail_if(!eina_value_setup(&composed, EINA_VALUE_TYPE_VALUE));
2918 fail_if(!eina_value_setup(&v, EINA_VALUE_TYPE_STRING));
2919 fail_if(!eina_value_set(&v, msg));
2920 fail_if(!eina_value_set(&composed, v));
2921
2922 eina_value_flush(&v);
2923 fail_if(!eina_value_copy(&composed, &v));
2924 fail_if(eina_value_compare(&composed, &v));
2925
2926 fail_if(!eina_value_get(&composed, &str_v));
2927 fail_if(!eina_value_get(&str_v, &str));
2928 ck_assert_str_eq(str, msg);
2929 eina_value_flush(&str_v);
2930
2931 str = NULL;
2932 fail_if(!eina_value_get(&v, &str_v));
2933 fail_if(!eina_value_get(&str_v, &str));
2934 ck_assert_str_eq(str, msg);
2935
2936 eina_value_flush(&str_v);
2937 eina_value_flush(&composed);
2938 eina_value_flush(&v);
2939 eina_shutdown();
2940}
2941END_TEST
2942
2876void 2943void
2877eina_test_value(TCase *tc) 2944eina_test_value(TCase *tc)
2878{ 2945{
@@ -2901,4 +2968,6 @@ eina_test_value(TCase *tc)
2901 tcase_add_test(tc, eina_value_test_optional_int); 2968 tcase_add_test(tc, eina_value_test_optional_int);
2902 tcase_add_test(tc, eina_value_test_optional_string); 2969 tcase_add_test(tc, eina_value_test_optional_string);
2903 tcase_add_test(tc, eina_value_test_optional_struct_members); 2970 tcase_add_test(tc, eina_value_test_optional_struct_members);
2971 tcase_add_test(tc, eina_value_test_value);
2972 tcase_add_test(tc, eina_value_test_value_string);
2904} 2973}