|
Eina_Value * | eina_value_hash_new (const Eina_Value_Type *subtype, unsigned int buckets_power_size) |
| Create generic value storage of type hash. More...
|
|
static Eina_Bool | eina_value_hash_setup (Eina_Value *value, const Eina_Value_Type *subtype, unsigned int buckets_power_size) |
| Initialize generic value storage of type hash. More...
|
|
static unsigned int | eina_value_hash_population (const Eina_Value *value) |
| Query number of elements in value of hash type. More...
|
|
static Eina_Bool | eina_value_hash_del (Eina_Value *value, const char *key) |
| Remove element at given position in value of hash type. More...
|
|
static Eina_Bool | eina_value_hash_set (Eina_Value *value, const char *key,...) |
| Set the generic value in an hash member. More...
|
|
static Eina_Bool | eina_value_hash_get (const Eina_Value *value, const char *key,...) |
| Get the generic value from an hash member. More...
|
|
static Eina_Bool | eina_value_hash_vset (Eina_Value *value, const char *key, va_list args) |
| Set the generic value in an hash member. More...
|
|
static Eina_Bool | eina_value_hash_vget (const Eina_Value *value, const char *key, va_list args) |
| Get the generic value from an hash member. More...
|
|
static Eina_Bool | eina_value_hash_pset (Eina_Value *value, const char *key, const void *ptr) |
| Set the generic value in an hash member from pointer. More...
|
|
static Eina_Bool | eina_value_hash_pget (const Eina_Value *value, const char *key, void *ptr) |
| Get the generic value to pointer from an hash member. More...
|
|
Get the generic value from an hash member.
- Parameters
-
value | source value object |
key | key to find the member |
- Returns
- EINA_TRUE on success, EINA_FALSE otherwise.
The value is returned in the variable argument parameter, the actual value is type-dependent, but usually it will be what is stored inside the object. There shouldn't be any memory allocation, thus the contents should not be freed.
The variable argument is dependent on chosen subtype. The list for basic types:
- EINA_VALUE_TYPE_UCHAR: unsigned char*
- EINA_VALUE_TYPE_USHORT: unsigned short*
- EINA_VALUE_TYPE_UINT: unsigned int*
- EINA_VALUE_TYPE_ULONG: unsigned long*
- EINA_VALUE_TYPE_UINT64: uint64_t*
- EINA_VALUE_TYPE_CHAR: char*
- EINA_VALUE_TYPE_SHORT: short*
- EINA_VALUE_TYPE_INT: int*
- EINA_VALUE_TYPE_LONG: long*
- EINA_VALUE_TYPE_INT64: int64_t*
- EINA_VALUE_TYPE_FLOAT: float*
- EINA_VALUE_TYPE_DOUBLE: double*
- EINA_VALUE_TYPE_STRINGSHARE: const char **
- EINA_VALUE_TYPE_STRING: const char **
- EINA_VALUE_TYPE_HASH: Eina_Value_Hash*
- EINA_VALUE_TYPE_TIMEVAL: struct timeval*
- EINA_VALUE_TYPE_BLOB: Eina_Value_Blob*
- EINA_VALUE_TYPE_STRUCT: Eina_Value_Struct*
1 Eina_Value *value = eina_value_hash_new(EINA_VALUE_TYPE_INT, 0);
4 eina_value_hash_set(value, "abc", 1234);
5 eina_value_hash_get(value, "abc", &x);
6 eina_value_free(value);
- See also
- eina_value_hash_set()
-
eina_value_hash_vset()
-
eina_value_hash_pset()
- Since
- 1.2
static Eina_Bool eina_value_hash_pget |
( |
const Eina_Value * |
value, |
|
|
const char * |
key, |
|
|
void * |
ptr |
|
) |
| |
|
inlinestatic |
Get the generic value to pointer from an hash member.
- Parameters
-
value | source value object |
key | key to find the member |
ptr | pointer to receive the contents. |
- Returns
- EINA_TRUE on success, EINA_FALSE otherwise.
The value is returned in pointer contents, the actual value is type-dependent, but usually it will be what is stored inside the object. There shouldn't be any memory allocation, thus the contents should not be freed.
The pointer type is dependent on chosen value type. The list for basic types:
- EINA_VALUE_TYPE_UCHAR: unsigned char*
- EINA_VALUE_TYPE_USHORT: unsigned short*
- EINA_VALUE_TYPE_UINT: unsigned int*
- EINA_VALUE_TYPE_ULONG: unsigned long*
- EINA_VALUE_TYPE_UINT64: uint64_t*
- EINA_VALUE_TYPE_CHAR: char*
- EINA_VALUE_TYPE_SHORT: short*
- EINA_VALUE_TYPE_INT: int*
- EINA_VALUE_TYPE_LONG: long*
- EINA_VALUE_TYPE_INT64: int64_t*
- EINA_VALUE_TYPE_FLOAT: float*
- EINA_VALUE_TYPE_DOUBLE: double*
- EINA_VALUE_TYPE_STRINGSHARE: const char **
- EINA_VALUE_TYPE_STRING: const char **
- EINA_VALUE_TYPE_HASH: Eina_Value_Hash*
- EINA_VALUE_TYPE_TIMEVAL: struct timeval*
- EINA_VALUE_TYPE_BLOB: Eina_Value_Blob*
- EINA_VALUE_TYPE_STRUCT: Eina_Value_Struct*
1 Eina_Value *value = eina_value_hash_new(EINA_VALUE_TYPE_INT, 0);
4 eina_value_hash_set(value, "abc", 1234);
5 eina_value_hash_pget(value, "abc", &x);
6 eina_value_free(value);
- See also
- eina_value_hash_set()
-
eina_value_hash_vset()
-
eina_value_hash_pset()
- Since
- 1.2