+ TRY {
+ return xbt_dictelm_get(dict->head, key);
+ } CATCH(e) {
+ if(e.category==not_found_error) {
+ return NULL;
+ }
+ RETHROW;
+ }
+ return NULL;
+}
+
+/**
+ * \brief like xbt_dict_get(), but returning NULL when not found
+ */
+void *
+xbt_dict_get_or_null(xbt_dict_t dict,
+ const char *key) {
+ xbt_ex_t e;
+ void *res;
+ TRY {
+ res = xbt_dictelm_get(dict->head, key);
+ } CATCH(e) {
+ if (e.category != not_found_error)
+ RETHROW;
+ xbt_ex_free(e);
+ res=NULL;
+ }
+ return res;