diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-10-11 14:05:28 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-10-11 14:05:28 +0200 |
| commit | 783260a4c01ebfe4b4bcfc56d57a4d99603f904f (patch) | |
| tree | 6ba1739662577db701969e33a79676c8f0460413 /src/io/ft_printf/internals/list.c | |
| parent | c33343322ef66d96337533082313b1256862023a (diff) | |
| download | libft-783260a4c01ebfe4b4bcfc56d57a4d99603f904f.tar.gz libft-783260a4c01ebfe4b4bcfc56d57a4d99603f904f.tar.bz2 libft-783260a4c01ebfe4b4bcfc56d57a4d99603f904f.zip | |
Norming and removing ft_printf,heapsort
Diffstat (limited to 'src/io/ft_printf/internals/list.c')
| -rw-r--r-- | src/io/ft_printf/internals/list.c | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/src/io/ft_printf/internals/list.c b/src/io/ft_printf/internals/list.c deleted file mode 100644 index 37f8013..0000000 --- a/src/io/ft_printf/internals/list.c +++ /dev/null @@ -1,67 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* list.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2019/10/29 00:14:50 by cacharle #+# #+# */ -/* Updated: 2019/11/05 23:45:42 by cacharle ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "ft_vasprintf.h" - -t_flist *list_new(t_pformat *content) -{ - t_flist *lst; - - if ((lst = (t_flist*)malloc(sizeof(t_flist))) == NULL) - return (NULL); - lst->data = content; - lst->next = NULL; - return (lst); -} - -void *list_destroy(t_flist **lst) -{ - if (lst == NULL) - return (NULL); - while (*lst != NULL) - list_pop_front(lst); - return (NULL); -} - -void list_push_front(t_flist **lst, t_flist *new) -{ - if (lst == NULL || new == NULL) - return ; - new->next = *lst; - *lst = new; -} - -void list_pop_front(t_flist **lst) -{ - t_flist *tmp; - - if (lst == NULL || *lst == NULL) - return ; - tmp = (*lst)->next; - free((*lst)->data); - free(*lst); - *lst = tmp; -} - -t_flist *list_reverse(t_flist *lst) -{ - t_flist *tmp; - - if (lst == NULL) - return (NULL); - if (lst->next == NULL) - return (lst); - tmp = list_reverse(lst->next); - lst->next->next = lst; - lst->next = NULL; - return (tmp); -} |
