SimGrid  3.21
Versatile Simulation of Distributed Systems

Detailed Description

The dictionary data structure (comparable to hash tables)

This section describes the API to a dictionary structure that associates as string to a void* key. It provides the same functionality than an hash table.

Deprecated:
If you are using C++, you might want to use std::unordered_map instead.
Here is a little example of use:
 xbt_dict_t mydict = xbt_dict_new_homogeneous(free);
 char buff[512];

 sprintf(buff,"some very precious data");
 xbt_dict_set(mydict,"my data", strdup(buff), NULL);

 sprintf(buff,"another good stuff");
 xbt_dict_set(mydict,"my data", strdup(buff), NULL); // previous data gets erased (and freed) by second add

Modules

 Dict constructor and destructor
 
 Dictionaries basic usage
 Careful, those functions assume that the key is null-terminated.
 
 Dictionaries with non-nul terminated keys
 Those functions work even with non-null terminated keys.
 
 Cursors on dictionaries
 
Don't get impressed, there is a lot of functions here, but traversing a dictionary is immediate with the
xbt_dict_foreach macro.