SimGrid
3.12
Versatile Simulation of Distributed Systems
|
The dictionary data structure (comparable to hash tables) More...
Modules | |
Dict constructor and destructor | |
Dictionaries basic usage | |
Dictionaries with non-nul terminated keys | |
Cursors on dictionaries | |
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.
Here is a little example of use:
xbt_dict_t mydict = xbt_dict_new(); char buff[512]; sprintf(buff,"some very precious data"); xbt_dict_set(mydict,"my data", strdup(buff), free); sprintf(buff,"another good stuff"); xbt_dict_set(mydict,"my data", strdup(buff), free); // previous data gets erased (and freed) by second add