Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Stupid me. I hadn't noticed the xbt_dict_get_or_null function...
[simgrid.git] / src / xbt / dict.c
index 5dcb9e6..37bc175 100644 (file)
@@ -100,10 +100,9 @@ xbt_dict_set(xbt_dict_t     dict,
  * \param dict the dealer of data
  * \param key the key to find data
  * \param key_len the size of the \a key
- * \param data the data that we are looking for
- * \return xbt_error
+ * \returns the data that we are looking for
  *
- * Search the given \a key. mismatch_error when not found.
+ * Search the given \a key. throws not_found_error when not found.
  */
 void *
 xbt_dict_get_ext(xbt_dict_t      dict,
@@ -120,8 +119,7 @@ xbt_dict_get_ext(xbt_dict_t      dict,
  *
  * \param dict the dealer of data
  * \param key the key to find data
- * \param data the data that we are looking for
- * \return xbt_error
+ * \returns the data that we are looking for
  *
  * Search the given \a key. THROWs mismatch_error when not found. 
  * Check xbt_dict_get_or_null() for a version returning NULL without exception when 
@@ -146,7 +144,7 @@ xbt_dict_get_or_null(xbt_dict_t     dict,
   TRY {
     res = xbt_dictelm_get(dict->head, key);
   } CATCH(e) {
-    if (e.category != mismatch_error) 
+    if (e.category != not_found_error) 
       RETHROW;
     xbt_ex_free(e);
     res=NULL;
@@ -161,17 +159,17 @@ xbt_dict_get_or_null(xbt_dict_t     dict,
  * \param dict the trash can
  * \param key the key of the data to be removed
  * \param key_len the size of the \a key
- * \return xbt_error_t
+ * 
  *
- * Remove the entry associated with the given \a key
+ * Remove the entry associated with the given \a key (throws not_found)
  */
-xbt_error_t
+void
 xbt_dict_remove_ext(xbt_dict_t  dict,
                      const char  *key,
                      int          key_len) {
   xbt_assert(dict);
   
-  return xbt_dictelm_remove_ext(dict->head, key, key_len);
+  xbt_dictelm_remove_ext(dict->head, key, key_len);
 }
 
 /**
@@ -182,13 +180,13 @@ xbt_dict_remove_ext(xbt_dict_t  dict,
  *
  * Remove the entry associated with the given \a key
  */
-xbt_error_t
+void
 xbt_dict_remove(xbt_dict_t  dict,
                 const char  *key) {
   if (!dict)
     THROW1(arg_error,0,"Asked to remove key %s from NULL dict",key);
 
-  return xbt_dictelm_remove(dict->head, key);
+  xbt_dictelm_remove(dict->head, key);
 }