3 #include "e_hal_private.h"
7 * @brief free a property structure
8 * @param prop the property to free
11 e_hal_property_free(E_Hal_Property *prop)
13 if (prop->type == E_HAL_PROPERTY_TYPE_STRLIST)
14 eina_list_free(prop->val.strlist);
19 * @brief Retrive a string from an element of a property hash
20 * @param properties the E_Hal_Properties structure
21 * @param key the key of the property to retrieve
22 * @param err a pointer to an int, which if supplied, will be set to 0 on success and 1 on an error
25 e_hal_property_string_get(E_Hal_Properties *properties, const char *key, int *err)
29 if (!properties->properties) return NULL;
30 prop = eina_hash_find(properties->properties, key);
31 if (prop) return prop->val.s;
38 e_hal_property_bool_get(E_Hal_Properties *properties, const char *key, int *err)
42 if (!properties->properties) return 0;
43 prop = eina_hash_find(properties->properties, key);
44 if (prop) return prop->val.b;
51 e_hal_property_int_get(E_Hal_Properties *properties, const char *key, int *err)
55 if (!properties->properties) return 0;
56 prop = eina_hash_find(properties->properties, key);
57 if (prop) return prop->val.i;
64 e_hal_property_uint64_get(E_Hal_Properties *properties, const char *key, int *err)
68 if (!properties->properties) return 0;
69 prop = eina_hash_find(properties->properties, key);
70 if (prop) return prop->val.u64;
77 e_hal_property_double_get(E_Hal_Properties *properties, const char *key, int *err)
81 if (!properties->properties) return 0;
82 prop = eina_hash_find(properties->properties, key);
83 if (prop) return prop->val.d;
89 EAPI const Eina_List *
90 e_hal_property_strlist_get(E_Hal_Properties *properties, const char *key, int *err)
94 if (!properties->properties) return NULL;
95 prop = eina_hash_find(properties->properties, key);
96 if (prop) return prop->val.strlist;