Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix copyright headers
[simgrid.git] / src / xbt / set.c
index 0e56152..c5d8465 100644 (file)
@@ -1,8 +1,7 @@
-/* $Id$ */
-
 /* set - data container consisting in dict+dynar                            */
 
-/* Copyright (c) 2004 Martin Quinson. All rights reserved.                  */
+/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -182,6 +181,18 @@ xbt_set_elm_t xbt_set_get_by_name(xbt_set_t set, const char *name)
   return xbt_dict_get(set->dict, name);
 }
 
+/** @brief Retrieve data by providing its name.
+ *
+ * \param set
+ * \param name Name of the searched cell
+ * \returns the data you're looking for, returns NULL if not found
+ */
+xbt_set_elm_t xbt_set_get_by_name_or_null(xbt_set_t set, const char *name)
+{
+  DEBUG1("Lookup key %s", name);
+  return xbt_dict_get_or_null(set->dict, name);
+}
+
 /** @brief Retrieve data by providing its name and the length of the name
  *
  * \param set