Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
The change Arnaud wanted so much: Big Star Eradication (plus some more, check the...
[simgrid.git] / src / xbt / dict.c
index 101a08a..2a79ff1 100644 (file)
@@ -30,9 +30,9 @@ GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(dict,xbt,
  *
  * Creates and initialize a new dictionnary
  */
-gras_dict_t *
+gras_dict_t 
 gras_dict_new(void) {
-  gras_dict_t *res= gras_new(gras_dict_t,1);
+  gras_dict_t res= gras_new(s_gras_dict_t,1);
   res->head=NULL;
   return res;
 }
@@ -43,13 +43,13 @@ gras_dict_new(void) {
  * Frees a cache structure with all its childs.
  */
 void
-gras_dict_free(gras_dict_t **dict)  {
+gras_dict_free(gras_dict_t *dict)  {
   if (dict && *dict) {
     if ((*dict)->head) {
       gras_dictelm_free( &( (*dict)->head ) );
       (*dict)->head = NULL;
     }
-    free(*dict);
+    gras_free(*dict);
     *dict=NULL;
   }
 }
@@ -66,15 +66,15 @@ gras_dict_free(gras_dict_t **dict)  {
  * of data, as long as its length is provided in @key_len.
  */
 void
-gras_dict_set_ext(gras_dict_t     *p_dict,
+gras_dict_set_ext(gras_dict_t      dict,
                  const char      *key,
                  int              key_len,
                  void            *data,
                  void_f_pvoid_t  *free_ctn) {
 
-  gras_assert(p_dict);
+  gras_assert(dict);
 
-  gras_dictelm_set_ext(&(p_dict->head),
+  gras_dictelm_set_ext(&(dict->head),
                       key, key_len, data, free_ctn);
 }
 
@@ -90,14 +90,14 @@ gras_dict_set_ext(gras_dict_t     *p_dict,
  * null terminated string.
  */
 void
-gras_dict_set(gras_dict_t    *p_dict,
-                const char     *key,
-                void           *data,
-                void_f_pvoid_t *free_ctn) {
+gras_dict_set(gras_dict_t     dict,
+             const char     *key,
+             void           *data,
+             void_f_pvoid_t *free_ctn) {
 
-  gras_assert(p_dict);
+  gras_assert(dict);
   
-  gras_dictelm_set(&(p_dict->head), key, data, free_ctn);
+  gras_dictelm_set(&(dict->head), key, data, free_ctn);
 }
 
 /**
@@ -111,10 +111,10 @@ gras_dict_set(gras_dict_t    *p_dict,
  * Search the given @key. mismatch_error when not found.
  */
 gras_error_t
-gras_dict_get_ext(gras_dict_t    *dict,
-                      const char     *key,
-                      int             key_len,
-                      /* OUT */void **data) {
+gras_dict_get_ext(gras_dict_t     dict,
+                 const char     *key,
+                 int             key_len,
+                 /* OUT */void **data) {
 
   gras_assert(dict);
 
@@ -132,9 +132,9 @@ gras_dict_get_ext(gras_dict_t    *dict,
  * Search the given @key. mismatch_error when not found.
  */
 gras_error_t
-gras_dict_get(gras_dict_t    *dict,
-                   const char     *key,
-                   /* OUT */void **data) {
+gras_dict_get(gras_dict_t     dict,
+             const char     *key,
+             /* OUT */void **data) {
   gras_assert(dict);
 
   return gras_dictelm_get(dict->head, key, data);
@@ -151,7 +151,7 @@ gras_dict_get(gras_dict_t    *dict,
  * Remove the entry associated with the given @key
  */
 gras_error_t
-gras_dict_remove_ext(gras_dict_t *dict,
+gras_dict_remove_ext(gras_dict_t  dict,
                      const char  *key,
                      int          key_len) {
   gras_assert(dict);
@@ -169,7 +169,7 @@ gras_dict_remove_ext(gras_dict_t *dict,
  * Remove the entry associated with the given @key
  */
 gras_error_t
-gras_dict_remove(gras_dict_t *dict,
+gras_dict_remove(gras_dict_t  dict,
                 const char  *key) {
   if (!dict) 
      RAISE1(mismatch_error,"Asked to remove key %s from NULL dict",key);
@@ -190,7 +190,7 @@ gras_dict_remove(gras_dict_t *dict,
  */
 
 void
-gras_dict_dump(gras_dict_t    *dict,
+gras_dict_dump(gras_dict_t     dict,
                void_f_pvoid_t *output) {
 
   printf("Dict %p:\n", (void*)dict);