+/**
+ * \brief like xbt_dict_get_ext(), but returning NULL when not found
+ */
+void *xbt_dict_get_or_null_ext(xbt_dict_t dict, const char *key, int key_len)
+{
+ unsigned int hash_code = xbt_dict_hash_ext(key, key_len);
+ xbt_dictelm_t current;
+
+ xbt_assert(dict);
+
+ current = dict->table[hash_code & dict->table_size];
+ while (current != NULL &&
+ (hash_code != current->hash_code || key_len != current->key_len
+ || memcmp(key, current->key, key_len))) {
+ current = current->next;
+ }
+
+ if (current == NULL)
+ return NULL;
+
+ return current->content;
+}
+
+/**
+ * @brief retrieve the key associated to that object. Warning, that's a linear search
+ *
+ * Returns NULL if the object cannot be found
+ */
+char *xbt_dict_get_key(xbt_dict_t dict, const void*data) {
+ int i;
+ xbt_dictelm_t current;
+
+
+ for (i = 0; i <= dict->table_size; i++) {
+ current = dict->table[i];
+ while (current != NULL) {
+ if (current->content == data)
+ return current->key;
+ current = current->next;
+ }
+ }
+
+ return NULL;
+}
+