+ * \brief Retrieve data from the dict (key considered as a uintptr_t)
+ *
+ * \param dict the dealer of data
+ * \param key the key to find data
+ * \return the data that we are looking for (or 0 if not found)
+ *
+ * Mixing uintptr_t keys with regular keys in the same dict is discouraged
+ */
+XBT_INLINE uintptr_t xbt_dicti_get(xbt_dict_t dict, uintptr_t key)
+{
+
+ unsigned int hash_code =
+ xbt_dict_hash_ext(((void *) &key), sizeof(uintptr_t));
+ xbt_dictelm_t current;
+
+ xbt_assert(dict);
+
+ current = dict->table[hash_code & dict->table_size];
+ while (current != NULL &&
+ (hash_code != current->hash_code
+ || sizeof(uintptr_t) != current->key_len
+ || (((uintptr_t) key) != ((uintptr_t) current->key)))) {
+ current = current->next;
+ }
+
+ if (current == NULL)
+ return 0;
+
+ return (uintptr_t) (current->content);
+}
+
+/** Remove a uintptr_t key from the dict */
+XBT_INLINE void xbt_dicti_remove(xbt_dict_t dict, uintptr_t key)
+{
+
+ unsigned int hash_code =
+ xbt_dict_hash_ext(((void *) &key), sizeof(uintptr_t));
+ xbt_dictelm_t current, previous = NULL;
+
+
+ current = dict->table[hash_code & dict->table_size];
+ while (current != NULL &&
+ (hash_code != current->hash_code
+ || sizeof(uintptr_t) != current->key_len
+ || (((uintptr_t) key) != ((uintptr_t) current->key)))) {
+ previous = current; /* save the previous node */
+ current = current->next;
+ }
+
+ if (current == NULL)
+ THROW1(not_found_error, 0, "key %zu not found", key);
+
+ if (previous != NULL) {
+ previous->next = current->next;
+ } else {
+ dict->table[hash_code & dict->table_size] = current->next;
+ }
+
+ if (!dict->table[hash_code & dict->table_size])
+ dict->fill--;
+
+ xbt_dictelm_free(current);
+ dict->count--;
+}
+
+
+/**
+ * \brief Remove all data from the dict
+ * \param dict the dict
+ */
+void xbt_dict_reset(xbt_dict_t dict)
+{
+
+ int i;
+ xbt_dictelm_t current, previous = NULL;
+
+ xbt_assert(dict);
+
+ if (dict->count == 0)
+ return;
+
+ for (i = 0; i <= dict->table_size; i++) {
+ current = dict->table[i];
+ while (current != NULL) {
+ previous = current;
+ current = current->next;
+ xbt_dictelm_free(previous);
+ }
+ dict->table[i] = NULL;
+ }
+
+ dict->count = 0;
+ dict->fill = 0;
+}
+
+/**
+ * \brief Return the number of elements in the dict.
+ * \param dict a dictionary
+ */
+XBT_INLINE int xbt_dict_length(xbt_dict_t dict)
+{
+ xbt_assert(dict);
+
+ return dict->count;
+}
+
+/** @brief function to be used in xbt_dict_dump as long as the stored values are strings */
+void xbt_dict_dump_output_string(void *s)
+{
+ fputs(s, stdout);
+}
+
+/**
+ * \brief test if the dict is empty or not
+ */
+XBT_INLINE int xbt_dict_is_empty(xbt_dict_t dict)
+{
+ return (xbt_dict_size(dict) == 0);
+}
+
+/**
+ * \brief Outputs the content of the structure (debugging purpose)