/**
* Returns the amount of elements in the dict
*/
-XBT_INLINE unsigned int xbt_dict_size(xbt_dict_t dict)
+inline unsigned int xbt_dict_size(xbt_dict_t dict)
{
return (dict ? (unsigned int) dict->count : (unsigned int) 0);
}
* Set the \a data in the structure under the \a key, which can be any kind
* of data, as long as its length is provided in \a key_len.
*/
-XBT_INLINE void xbt_dict_set_ext(xbt_dict_t dict,
+inline void xbt_dict_set_ext(xbt_dict_t dict,
const char *key, int key_len,
void *data, void_f_pvoid_t free_ctn)
{
* set the \a data in the structure under the \a key, which is a
* null terminated string.
*/
-XBT_INLINE void xbt_dict_set(xbt_dict_t dict,
+inline void xbt_dict_set(xbt_dict_t dict,
const char *key, void *data,
void_f_pvoid_t free_ctn)
{
*
* Search the given \a key. Throws not_found_error when not found.
*/
-XBT_INLINE void *xbt_dict_get_ext(xbt_dict_t dict, const char *key, int key_len)
+inline void *xbt_dict_get_ext(xbt_dict_t dict, const char *key, int key_len)
{
unsigned int hash_code = xbt_str_hash_ext(key, key_len);
xbt_dictelm_t current = dict->table[hash_code & dict->table_size];
* Check xbt_dict_get_or_null() for a version returning NULL without exception when
* not found.
*/
-XBT_INLINE void *xbt_dict_get(xbt_dict_t dict, const char *key)
+inline void *xbt_dict_get(xbt_dict_t dict, const char *key)
{
return xbt_dict_get_elm(dict, key)->content;
}
* Check xbt_dict_get_or_null() for a version returning NULL without exception when
* not found.
*/
-XBT_INLINE xbt_dictelm_t xbt_dict_get_elm(xbt_dict_t dict, const char *key)
+inline xbt_dictelm_t xbt_dict_get_elm(xbt_dict_t dict, const char *key)
{
xbt_dictelm_t current = xbt_dict_get_elm_or_null(dict, key);
/**
* \brief like xbt_dict_get(), but returning NULL when not found
*/
-XBT_INLINE void *xbt_dict_get_or_null(xbt_dict_t dict, const char *key)
+inline void *xbt_dict_get_or_null(xbt_dict_t dict, const char *key)
{
xbt_dictelm_t current = xbt_dict_get_elm_or_null(dict, key);
/**
* \brief like xbt_dict_get_elm(), but returning NULL when not found
*/
-XBT_INLINE xbt_dictelm_t xbt_dict_get_elm_or_null(xbt_dict_t dict, const char *key)
+inline xbt_dictelm_t xbt_dict_get_elm_or_null(xbt_dict_t dict, const char *key)
{
unsigned int hash_code = xbt_str_hash(key);
xbt_dictelm_t current = dict->table[hash_code & dict->table_size];
*
* Remove the entry associated with the given \a key (throws not_found)
*/
-XBT_INLINE void xbt_dict_remove_ext(xbt_dict_t dict, const char *key, int key_len)
+inline void xbt_dict_remove_ext(xbt_dict_t dict, const char *key, int key_len)
{
unsigned int hash_code = xbt_str_hash_ext(key, key_len);
xbt_dictelm_t previous = NULL;
*
* Remove the entry associated with the given \a key
*/
-XBT_INLINE void xbt_dict_remove(xbt_dict_t dict, const char *key)
+inline void xbt_dict_remove(xbt_dict_t dict, const char *key)
{
xbt_dict_remove_ext(dict, key, strlen(key));
}
* \brief Return the number of elements in the dict.
* \param dict a dictionary
*/
-XBT_INLINE int xbt_dict_length(xbt_dict_t dict)
+inline int xbt_dict_length(xbt_dict_t dict)
{
return dict->count;
}
/**
* \brief test if the dict is empty or not
*/
-XBT_INLINE int xbt_dict_is_empty(xbt_dict_t dict)
+inline int xbt_dict_is_empty(xbt_dict_t dict)
{
return !dict || (xbt_dict_length(dict) == 0);
}