return fifo;
}
-
/** Destructor
* \param l poor victim
*
{
xbt_fifo_item_t current, current_next;
-
for (current = l->head; current; current = current_next) {
current_next = current->next;
if (current->content != t)
return 0;
}
-
/**
* \param l
* \param t an objet
* This function allows to search an item with a user provided function instead
* of the pointer comparison used elsewhere in this module. Assume for example that you have a fifo of
* strings. You cannot use xbt_fifo_remove() to remove, say, "TOTO" from it because internally, xbt_fifo_remove()
- * will do something like "if (item->content == "toto"), then remove it". And the pointer to the item content
- * and the pointer to "toto" will never match. As a solution, the current function provides a way to search elements
- * that are semanticaly equivalent instead of only syntaxically. So, removing "Toto" from a fifo can be
- * achieved this way:
+ * will do something like "if (item->content == "toto"), then remove it". And the pointer to the item content and the
+ * pointer to "toto" will never match. As a solution, the current function provides a way to search elements that are
+ * semantically equivalent instead of only syntactically. So, removing "Toto" from a fifo can be achieved this way:
*
* @verbatim
int my_comparison_function(void *searched, void *seen) {
return !strcmp(searched, seen);
}
- xbt_fifo_remove_item(fifo,
- xbt_fifo_search_item(fifo, my_comparison_function, "Toto"));
+ xbt_fifo_remove_item(fifo, xbt_fifo_search_item(fifo, my_comparison_function, "Toto"));
@endverbatim
*
* \param f a fifo list
item = item->next;
}
return NULL;
-
}
/**
*/
void xbt_fifo_preinit(void)
{
- item_mallocator = xbt_mallocator_new(65536,
- fifo_item_mallocator_new_f,
- fifo_item_mallocator_free_f,
- fifo_item_mallocator_reset_f);
+ item_mallocator = xbt_mallocator_new(65536, fifo_item_mallocator_new_f,
+ fifo_item_mallocator_free_f, fifo_item_mallocator_reset_f);
}
void xbt_fifo_postexit(void)
item_mallocator = NULL;
}
}
-
/* @} */