+/**
+ * \brief Remove all data from the dict
+ * \param dict the dict
+ */
+void xbt_dict_reset(xbt_dict_t dict) {
+ xbt_assert(dict);
+
+ int i;
+ xbt_dictelm_t current, previous = NULL;
+ 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;
+}
+
+/**
+ * \brief Return the number of elements in the dict.
+ * \param dict a dictionary
+ */
+int xbt_dict_length(xbt_dict_t dict) {
+ xbt_assert(dict);
+
+ return dict->count;
+}
+