ft_lstdelone.c 1.0 KB

1234567891011121314151617181920212223
  1. /* ************************************************************************** */
  2. /* */
  3. /* ::: :::::::: */
  4. /* ft_lstdelone.c :+: :+: :+: */
  5. /* +:+ +:+ +:+ */
  6. /* By: mazimi <mazimi@student.42.fr> +#+ +:+ +#+ */
  7. /* +#+#+#+#+#+ +#+ */
  8. /* Created: 2014/12/09 19:19:06 by mazimi #+# #+# */
  9. /* Updated: 2015/02/18 21:58:36 by mazimi ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #include "../libft.h"
  13. void ft_lstdelone(t_list **alst, void (*del)(void*, size_t))
  14. {
  15. if (alst)
  16. {
  17. del((*alst), (*alst)->content_size);
  18. free(*alst);
  19. *alst = NULL;
  20. }
  21. }