xbt_dict_remove_ext(dict, key, strlen(key));
}
-#ifdef XBT_USE_DEPRECATED
-/**
- * \brief Add data to the dict (arbitrary key)
- * \param dict the container
- * \param key the key to set the new data
- * \param data the data to add in the dict
- *
- * Set the \a data in the structure under the \a key.
- * Both \a data and \a key are considered as uintptr_t.
- */
-XBT_INLINE void xbt_dicti_set(xbt_dict_t dict,
- uintptr_t key, uintptr_t data)
-{
- xbt_dict_set_ext(dict, (void *)&key, sizeof key, (void*)data, NULL);
-}
-
-/**
- * \brief Retrieve data from the dict (key considered as a uintptr_t)
- *
- * \param dict the dealer of data
- * \param key the key to find data
- * \return the data that we are looking for (or 0 if not found)
- *
- * Mixing uintptr_t keys with regular keys in the same dict is discouraged
- */
-XBT_INLINE uintptr_t xbt_dicti_get(xbt_dict_t dict, uintptr_t key)
-{
- return (uintptr_t)xbt_dict_get_or_null_ext(dict, (void *)&key, sizeof key);
-}
-
-/** Remove a uintptr_t key from the dict */
-XBT_INLINE void xbt_dicti_remove(xbt_dict_t dict, uintptr_t key)
-{
- xbt_dict_remove_ext(dict, (void *)&key, sizeof key);
-}
-#endif
-
/** @brief Remove all data from the dict */
void xbt_dict_reset(xbt_dict_t dict)
{
#include "xbt/ex.h"
#include "src/portable.h"
-#define PRINTF_STR(a) (a)?:"(null)"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(xbt_dict);
{
char *data = xbt_strdup(data_to_fill);
- xbt_test_log("Add %s under %s", PRINTF_STR(data_to_fill),
- PRINTF_STR(key));
+ xbt_test_log("Add %s under %s", data_to_fill, key);
xbt_dict_set(head, key, data, free_f);
if (XBT_LOG_ISENABLED(xbt_dict, xbt_log_priority_debug)) {
static void debuged_remove(xbt_dict_t head, const char *key)
{
- xbt_test_add("Remove '%s'", PRINTF_STR(key));
+ xbt_test_add("Remove '%s'", key);
xbt_dict_remove(head, key);
/* xbt_dict_dump(head,(void (*)(void*))&printf); */
}
xbt_dict_foreach(head, cursor, key, data) {
if (!key || !data || strcmp(key, data)) {
- xbt_test_log("Seen #%d: %s->%s", ++i, PRINTF_STR(key),
- PRINTF_STR(data));
+ xbt_test_log("Seen #%d: %s->%s", ++i, key, data);
} else {
- xbt_test_log("Seen #%d: %s", ++i, PRINTF_STR(key));
+ xbt_test_log("Seen #%d: %s", ++i, key);
}
xbt_test_assert(!data || !strcmp(key, data),
"Key(%s) != value(%s). Aborting", key, data);
xbt_dict_foreach(head, cursor, key, data) {
if (!key || !data || strcmp(key, data)) {
- xbt_test_log("Seen: %s->%s", PRINTF_STR(key), PRINTF_STR(data));
+ xbt_test_log("Seen: %s->%s", key, data);
} else {
- xbt_test_log("Seen: %s", PRINTF_STR(key));
+ xbt_test_log("Seen: %s", key);
}
if (!strcmp(key, "null"))