storage = MSG_storage_get_by_name(storage_name);
display_storage_properties(storage);
}
+ xbt_dict_free(&storage_list);
}
void display_storage_properties(msg_storage_t storage){
{
dump_storage_by_name(storage_name);
}
+ xbt_dict_free(&storage_list);
}
void dump_storage_by_name(char *name){
XBT_INFO("Print the content of the storage element: %s",MSG_storage_get_name(storage));
xbt_dict_cursor_t cursor = NULL;
char *file;
- sg_storage_size_t size;
+ sg_storage_size_t *psize;
xbt_dict_t content = MSG_storage_get_content(storage);
if (content){
- xbt_dict_foreach(content, cursor, file, size)
- XBT_INFO("%s size: %" PRIu64 " bytes", file, size);
+ xbt_dict_foreach(content, cursor, file, psize)
+ XBT_INFO("%s size: %" PRIu64 " bytes", file, *psize);
} else {
XBT_INFO("No content.");
}
+ xbt_dict_free(&content);
}
void get_set_storage_data(const char *storage_name){
- XBT_INFO("*** GET/SET DATA for storage element: %s ***",storage_name);
- msg_storage_t storage = MSG_storage_get_by_name(storage_name);
- char *data = MSG_storage_get_data(storage);
- XBT_INFO("Get data: '%s'", data);
- MSG_storage_set_data(storage,strdup("Some data"));
- data = MSG_storage_get_data(storage);
- XBT_INFO("Set and get data: '%s'", data);
+ XBT_INFO("*** GET/SET DATA for storage element: %s ***",storage_name);
+ msg_storage_t storage = MSG_storage_get_by_name(storage_name);
+ char *data = MSG_storage_get_data(storage);
+ XBT_INFO("Get data: '%s'", data);
+
+ MSG_storage_set_data(storage,strdup("Some data"));
+ data = MSG_storage_get_data(storage);
+ XBT_INFO("Set and get data: '%s'", data);
}
int client(int argc, char *argv[])