aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-09-18 16:39:52 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-09-18 16:39:52 +0200
commitdd0c485ac4975b7dd6d2e230213be1da50d0a065 (patch)
tree5fbd967f8b95c72fbb696bb089c2cc349d28b61f /src
parent3c3f1115f6e9a9b914e2dcbd796501ca7ce85342 (diff)
downloadlibft-malloc.tar.gz
libft-malloc.tar.bz2
libft-malloc.zip
Removing unnecessary stuffmalloc
Diffstat (limited to 'src')
-rw-r--r--src/algo/ft_bsearch.c32
-rw-r--r--src/algo/ft_compar_int.c18
-rw-r--r--src/algo/ft_heapsort.c54
-rw-r--r--src/algo/ft_is_set.c32
-rw-r--r--src/algo/ft_lfind.c28
-rw-r--r--src/algo/ft_lsearch.c23
-rw-r--r--src/algo/ft_mergesort.c76
-rw-r--r--src/algo/ft_qsort.c64
-rw-r--r--src/algo/ft_reverse.c27
-rw-r--r--src/bt/ft_btdestroy.c23
-rw-r--r--src/bt/ft_btnew.c25
-rw-r--r--src/ctype/ft_isalnum.c18
-rw-r--r--src/ctype/ft_isalpha.c16
-rw-r--r--src/ctype/ft_isascii.c16
-rw-r--r--src/ctype/ft_isblank.c16
-rw-r--r--src/ctype/ft_isdigit.c16
-rw-r--r--src/ctype/ft_isprint.c16
-rw-r--r--src/ctype/ft_isspace.c19
-rw-r--r--src/ctype/ft_todigit.c20
-rw-r--r--src/ctype/ft_tolower.c24
-rw-r--r--src/ctype/ft_toupper.c20
-rw-r--r--src/ft_bzero.c (renamed from src/mem/ft_bzero.c)0
-rw-r--r--src/ft_memcpy.c (renamed from src/mem/ft_memcpy.c)4
-rw-r--r--src/ft_memset.c (renamed from src/mem/ft_memset.c)4
-rw-r--r--src/ft_putchar.c (renamed from src/io/ft_putchar.c)0
-rw-r--r--src/ft_putchar_fd.c (renamed from src/io/ft_putchar_fd.c)0
-rw-r--r--src/ft_putendl.c (renamed from src/io/ft_putendl.c)0
-rw-r--r--src/ft_putendl_fd.c (renamed from src/io/ft_putendl_fd.c)0
-rw-r--r--src/ft_putnbr.c (renamed from src/io/ft_putnbr.c)0
-rw-r--r--src/ft_putnbr_fd.c (renamed from src/io/ft_putnbr_fd.c)0
-rw-r--r--src/ft_putstr.c (renamed from src/io/ft_putstr.c)0
-rw-r--r--src/ft_putstr_fd.c (renamed from src/io/ft_putstr_fd.c)0
-rw-r--r--src/ft_strlen.c (renamed from src/lst/ft_lstsize.c)16
-rw-r--r--src/ht/ft_htcontent_new.c31
-rw-r--r--src/ht/ft_htdelone.c21
-rw-r--r--src/ht/ft_htdestroy.c24
-rw-r--r--src/ht/ft_htget.c29
-rw-r--r--src/ht/ft_hthash.c28
-rw-r--r--src/ht/ft_htnew.c32
-rw-r--r--src/ht/ft_htset.c45
-rw-r--r--src/ht/ft_inter_htkey_cmp.c21
-rw-r--r--src/io/ft_getchar.c22
-rw-r--r--src/io/ft_next_line.c113
-rw-r--r--src/io/ft_printf/ft_asprintf.c24
-rw-r--r--src/io/ft_printf/ft_dprintf.c24
-rw-r--r--src/io/ft_printf/ft_printf.c24
-rw-r--r--src/io/ft_printf/ft_snprintf.c24
-rw-r--r--src/io/ft_printf/ft_sprintf.c24
-rw-r--r--src/io/ft_printf/ft_vasprintf.c21
-rw-r--r--src/io/ft_printf/ft_vasprintf.h155
-rw-r--r--src/io/ft_printf/ft_vdprintf.c24
-rw-r--r--src/io/ft_printf/ft_vprintf.c18
-rw-r--r--src/io/ft_printf/ft_vsnprintf.c26
-rw-r--r--src/io/ft_printf/ft_vsprintf.c18
-rw-r--r--src/io/ft_printf/internals/convert.c122
-rw-r--r--src/io/ft_printf/internals/convert_char.c53
-rw-r--r--src/io/ft_printf/internals/convert_hex.c34
-rw-r--r--src/io/ft_printf/internals/convert_int.c40
-rw-r--r--src/io/ft_printf/internals/convert_none.c25
-rw-r--r--src/io/ft_printf/internals/convert_percent.c23
-rw-r--r--src/io/ft_printf/internals/convert_ptr.c29
-rw-r--r--src/io/ft_printf/internals/convert_str.c25
-rw-r--r--src/io/ft_printf/internals/convert_uint.c34
-rw-r--r--src/io/ft_printf/internals/convert_written.c28
-rw-r--r--src/io/ft_printf/internals/extract.c98
-rw-r--r--src/io/ft_printf/internals/length_modifier.c39
-rw-r--r--src/io/ft_printf/internals/list.c67
-rw-r--r--src/io/ft_printf/internals/parse.c61
-rw-r--r--src/io/ft_printf/internals/utils.c115
-rw-r--r--src/lst/ft_lstadd_back.c26
-rw-r--r--src/lst/ft_lstadd_front.c22
-rw-r--r--src/lst/ft_lstbsearch.c65
-rw-r--r--src/lst/ft_lstclear.c25
-rw-r--r--src/lst/ft_lstdelone.c23
-rw-r--r--src/lst/ft_lstiter.c25
-rw-r--r--src/lst/ft_lstlast.c23
-rw-r--r--src/lst/ft_lstlfind.c22
-rw-r--r--src/lst/ft_lstlsearch.c27
-rw-r--r--src/lst/ft_lstmap.c49
-rw-r--r--src/lst/ft_lstnew.c25
-rw-r--r--src/lst/ft_lstpop_front.c25
-rw-r--r--src/lst/ft_lstremove_if.c32
-rw-r--r--src/lst/ft_lstreverse.c19
-rw-r--r--src/lst/ft_lstreverse_ret.c28
-rw-r--r--src/lst/ft_lstsort.c40
-rw-r--r--src/lst/ft_lstsorted_merge.c35
-rw-r--r--src/mem/ft_calloc.c23
-rw-r--r--src/mem/ft_memalloc.c18
-rw-r--r--src/mem/ft_memccpy.c31
-rw-r--r--src/mem/ft_memchr.c26
-rw-r--r--src/mem/ft_memcmp.c30
-rw-r--r--src/mem/ft_memdel.c21
-rw-r--r--src/mem/ft_memmem.c58
-rw-r--r--src/mem/ft_memmove.c35
-rw-r--r--src/mem/ft_memset_pattern4.c26
-rw-r--r--src/mem/ft_memswap.c29
-rw-r--r--src/str/ft_atoi.c18
-rw-r--r--src/str/ft_atoi_strict.c38
-rw-r--r--src/str/ft_itoa.c40
-rw-r--r--src/str/ft_split.c73
-rw-r--r--src/str/ft_strcasecmp.c24
-rw-r--r--src/str/ft_strcat.c19
-rw-r--r--src/str/ft_strchr.c18
-rw-r--r--src/str/ft_strclr.c20
-rw-r--r--src/str/ft_strcmp.c23
-rw-r--r--src/str/ft_strcount.c24
-rw-r--r--src/str/ft_strcpy.c18
-rw-r--r--src/str/ft_strcspn.c23
-rw-r--r--src/str/ft_strdel.c18
-rw-r--r--src/str/ft_strdup.c22
-rw-r--r--src/str/ft_strequ.c20
-rw-r--r--src/str/ft_striter.c21
-rw-r--r--src/str/ft_striteri.c27
-rw-r--r--src/str/ft_strjoin.c25
-rw-r--r--src/str/ft_strjoinf.c35
-rw-r--r--src/str/ft_strlcat.c32
-rw-r--r--src/str/ft_strlcpy.c28
-rw-r--r--src/str/ft_strlen.c41
-rw-r--r--src/str/ft_strmap.c34
-rw-r--r--src/str/ft_strmapi.c34
-rw-r--r--src/str/ft_strncasecmp.c26
-rw-r--r--src/str/ft_strncat.c29
-rw-r--r--src/str/ft_strncmp.c26
-rw-r--r--src/str/ft_strncpy.c24
-rw-r--r--src/str/ft_strndup.c23
-rw-r--r--src/str/ft_strnequ.c20
-rw-r--r--src/str/ft_strnew.c18
-rw-r--r--src/str/ft_strnlen.c25
-rw-r--r--src/str/ft_strnstr.c29
-rw-r--r--src/str/ft_strpbrk.c24
-rw-r--r--src/str/ft_strrchr.c24
-rw-r--r--src/str/ft_strsep.c27
-rw-r--r--src/str/ft_strspn.c23
-rw-r--r--src/str/ft_strstr.c29
-rw-r--r--src/str/ft_strtol.c80
-rw-r--r--src/str/ft_strtolower.c26
-rw-r--r--src/str/ft_strtoupper.c26
-rw-r--r--src/str/ft_strtrim.c31
-rw-r--r--src/str/ft_substr.c26
139 files changed, 10 insertions, 4157 deletions
diff --git a/src/algo/ft_bsearch.c b/src/algo/ft_bsearch.c
deleted file mode 100644
index 5132fa2..0000000
--- a/src/algo/ft_bsearch.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_bsearch.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/10 05:29:05 by cacharle #+# #+# */
-/* Updated: 2020/02/13 23:14:48 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_algo.h"
-
-void *ft_bsearch(const void *base, size_t nel, size_t width,
- t_ftsearch_const *consts)
-{
- int res;
- size_t mid;
-
- if (nel < 1)
- return (NULL);
- mid = nel / 2;
- res = (consts->compar)(consts->key, base + mid * width);
- if (res == 0)
- return ((void*)base + mid * width);
- if (res < 0)
- return (ft_bsearch(base, mid, width, consts));
- else
- return (ft_bsearch(base + (mid + 1) * width, nel - mid - 1,
- width, consts));
-}
diff --git a/src/algo/ft_compar_int.c b/src/algo/ft_compar_int.c
deleted file mode 100644
index 848dc71..0000000
--- a/src/algo/ft_compar_int.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_compar_int.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/01/19 08:24:43 by cacharle #+# #+# */
-/* Updated: 2020/01/19 08:27:38 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-int ft_compar_int(const void *a, const void *b)
-{
- return (*(int*)a - *(int*)b);
-}
diff --git a/src/algo/ft_heapsort.c b/src/algo/ft_heapsort.c
deleted file mode 100644
index d309624..0000000
--- a/src/algo/ft_heapsort.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_heapsort.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/10 02:59:22 by cacharle #+# #+# */
-/* Updated: 2020/02/10 04:22:19 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_algo.h"
-
-/* static void st_build_max_heap(void *base, size_t nel, size_t width, */
-/* int (*compar)(const void *, const void *)) */
-/* { */
-/* int i; */
-/* */
-/* i = 1; */
-/* while (i < nel) */
-/* { */
-/* compar(base + i * width, base + 2 * i * width) */
-/* */
-/* i++; */
-/* } */
-/* } */
-/* */
-/* static void st_heapify(void *base, size_t nel, size_t width, */
-/* int (*compar)(const void *, const void *)) */
-/* { */
-/* */
-/* } */
-
-int ft_heapsort(void *base, size_t nel, size_t width,
- int (*compar)(const void *, const void *))
-{
- (void)base;
- (void)nel;
- (void)width;
- (void)compar;
- /* size_t i; */
- /* */
- /* if (nel < 2) */
- /* return (0); */
- /* st_build_max_heap(base, nel, width, compar); */
- /* i = -1; */
- /* while (++i < nel) */
- /* { */
- /* ft_memswap(base, base + (nel - i - 1) * width); */
- /* st_heapify(base, nel - i - 1, width, compar); */
- /* } */
- return (0);
-}
diff --git a/src/algo/ft_is_set.c b/src/algo/ft_is_set.c
deleted file mode 100644
index 3e7ae31..0000000
--- a/src/algo/ft_is_set.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_is_set.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/01/19 07:17:15 by cacharle #+# #+# */
-/* Updated: 2020/02/10 02:51:41 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_algo.h"
-
-t_ftbool ft_is_set(void *base, size_t nel, size_t width,
- t_ftcompar_func compar)
-{
- size_t i;
-
- if (nel < 2)
- return (TRUE);
- ft_qsort(base, nel, width, compar);
- i = 0;
- while (i < nel - 1)
- {
- if (compar(base + (i * width), base + ((i + 1) * width)) == 0)
- return (FALSE);
- i++;
- }
- return (TRUE);
-}
diff --git a/src/algo/ft_lfind.c b/src/algo/ft_lfind.c
deleted file mode 100644
index 8538f50..0000000
--- a/src/algo/ft_lfind.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_lfind.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/10 05:49:19 by cacharle #+# #+# */
-/* Updated: 2020/02/10 05:58:19 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_algo.h"
-
-void *ft_lfind(const void *base, size_t *nelp, size_t width,
- t_ftsearch_const *consts)
-{
- size_t i;
-
- i = 0;
- while (i < *nelp)
- {
- if ((consts->compar)(consts->key, base + i * width) == 0)
- return ((void*)base + i * width);
- i++;
- }
- return (NULL);
-}
diff --git a/src/algo/ft_lsearch.c b/src/algo/ft_lsearch.c
deleted file mode 100644
index 4c77bca..0000000
--- a/src/algo/ft_lsearch.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_lsearch.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/10 05:53:57 by cacharle #+# #+# */
-/* Updated: 2020/02/10 05:59:33 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_algo.h"
-
-void *ft_lsearch(const void *base, size_t *nelp, size_t width,
- t_ftsearch_const *consts)
-{
- void *found;
-
- if ((found = ft_lfind(base, nelp, width, consts)) != NULL)
- return (found);
- return (ft_memcpy((void*)base + (*nelp)++ * width, consts->key, width));
-}
diff --git a/src/algo/ft_mergesort.c b/src/algo/ft_mergesort.c
deleted file mode 100644
index 25b4255..0000000
--- a/src/algo/ft_mergesort.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_mergesort.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/10 02:26:41 by cacharle #+# #+# */
-/* Updated: 2020/02/13 23:14:21 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_algo.h"
-
-static int st_mergesort_error(void *left, void *right)
-{
- free(left);
- free(right);
- return (-1);
-}
-
-static void st_merge_sorted(struct s_merge_sorted_arrays *arrays, size_t nel,
- size_t width, int (*compar)(const void *, const void *))
-{
- size_t bi;
- size_t li;
- size_t ri;
- size_t mid;
-
- mid = nel / 2;
- bi = 0;
- li = 0;
- ri = 0;
- while (li < mid && ri < nel - mid)
- {
- if (compar(arrays->left + li * width, arrays->right + ri * width) < 0)
- ft_memcpy(arrays->base + bi * width,
- arrays->left + li++ * width, width);
- else
- ft_memcpy(arrays->base + bi * width,
- arrays->right + ri++ * width, width);
- bi++;
- }
- while (li < mid)
- ft_memcpy(arrays->base + bi++ * width,
- arrays->left + li++ * width, width);
- while (ri < nel - mid)
- ft_memcpy(arrays->base + bi++ * width,
- arrays->right + ri++ * width, width);
-}
-
-int ft_mergesort(void *base, size_t nel, size_t width,
- int (*compar)(const void *, const void *))
-{
- size_t mid;
- struct s_merge_sorted_arrays arrays;
-
- if (nel < 2)
- return (0);
- mid = nel / 2;
- if ((arrays.left = malloc(mid * width)) == NULL)
- return (-1);
- if ((arrays.right = malloc((nel - mid) * width)) == NULL)
- return (st_mergesort_error(arrays.left, NULL));
- ft_memcpy(arrays.left, base, mid * width);
- ft_memcpy(arrays.right, base + mid * width, (nel - mid) * width);
- if (ft_mergesort(arrays.left, mid, width, compar) == -1)
- return (st_mergesort_error(arrays.left, arrays.right));
- if (ft_mergesort(arrays.right, nel - mid, width, compar) == -1)
- return (st_mergesort_error(arrays.left, arrays.right));
- arrays.base = base;
- st_merge_sorted(&arrays, nel, width, compar);
- free(arrays.left);
- free(arrays.right);
- return (0);
-}
diff --git a/src/algo/ft_qsort.c b/src/algo/ft_qsort.c
deleted file mode 100644
index 9bcfcdf..0000000
--- a/src/algo/ft_qsort.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_qsort.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/01/19 07:25:51 by cacharle #+# #+# */
-/* Updated: 2020/02/10 02:55:14 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_algo.h"
-
-static t_ftrange ft_range_new(int lo, int hi)
-{
- t_ftrange range;
-
- range.lo = lo;
- range.hi = hi;
- return (range);
-}
-
-static int ft_qsort_partition(void *base, t_ftrange range,
- size_t width, t_ftcompar_func compar)
-{
- void *pivot;
- int p;
- int i;
-
- pivot = base + (range.hi * width);
- p = range.lo;
- i = range.lo - 1;
- while (++i < range.hi)
- {
- if (compar(base + (i * width), pivot) < 0)
- {
- ft_memswap(base + (i * width), base + (p * width), width);
- p++;
- }
- }
- ft_memswap(pivot, base + (p * width), width);
- return (p);
-}
-
-static void ft_qsort_rec(void *base, t_ftrange range,
- size_t width, t_ftcompar_func compar)
-{
- int pivot;
-
- if (range.lo >= range.hi)
- return ;
- pivot = ft_qsort_partition(base, range, width, compar);
- ft_qsort_rec(base, ft_range_new(range.lo, pivot - 1), width, compar);
- ft_qsort_rec(base, ft_range_new(pivot + 1, range.hi), width, compar);
-}
-
-void ft_qsort(void *base, size_t nel, size_t width,
- t_ftcompar_func compar)
-{
- if (width == 0 || nel < 2)
- return ;
- ft_qsort_rec(base, ft_range_new(0, nel - 1), width, compar);
-}
diff --git a/src/algo/ft_reverse.c b/src/algo/ft_reverse.c
deleted file mode 100644
index 0bc447f..0000000
--- a/src/algo/ft_reverse.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_reverse.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/10 05:07:13 by cacharle #+# #+# */
-/* Updated: 2020/02/10 05:19:22 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_algo.h"
-
-void ft_reverse(void *base, size_t nel, size_t width)
-{
- size_t i;
-
- i = 0;
- nel--;
- while (i < nel)
- {
- ft_memswap(base + i * width, base + nel * width, width);
- i++;
- nel--;
- }
-}
diff --git a/src/bt/ft_btdestroy.c b/src/bt/ft_btdestroy.c
deleted file mode 100644
index c802db0..0000000
--- a/src/bt/ft_btdestroy.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_btdestroy.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/07 21:30:53 by cacharle #+# #+# */
-/* Updated: 2020/02/07 21:35:19 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_bt.h"
-
-void ft_btdestroy(t_ftbtree *tree, void (*del)(void *data))
-{
- if (tree == NULL)
- return ;
- ft_btdestroy(tree->left, del);
- ft_btdestroy(tree->right, del);
- (*del)(tree->data);
- free(tree);
-}
diff --git a/src/bt/ft_btnew.c b/src/bt/ft_btnew.c
deleted file mode 100644
index 973e1a4..0000000
--- a/src/bt/ft_btnew.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_btnew.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/07 21:33:16 by cacharle #+# #+# */
-/* Updated: 2020/02/07 21:34:35 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_bt.h"
-
-t_ftbtree *ft_btnew(void *data)
-{
- t_ftbtree *tree;
-
- if ((tree = (t_ftbtree*)malloc(sizeof(t_ftbtree))) == NULL)
- return (NULL);
- tree->data = data;
- tree->left = NULL;
- tree->right = NULL;
- return (tree);
-}
diff --git a/src/ctype/ft_isalnum.c b/src/ctype/ft_isalnum.c
deleted file mode 100644
index 1ee1e0f..0000000
--- a/src/ctype/ft_isalnum.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_isalnum.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 09:41:40 by cacharle #+# #+# */
-/* Updated: 2019/10/07 09:41:56 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-int ft_isalnum(int c)
-{
- return (ft_isalpha(c) || ft_isdigit(c));
-}
diff --git a/src/ctype/ft_isalpha.c b/src/ctype/ft_isalpha.c
deleted file mode 100644
index 6f155b4..0000000
--- a/src/ctype/ft_isalpha.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_isalpha.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 09:54:52 by cacharle #+# #+# */
-/* Updated: 2019/10/20 13:01:13 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-int ft_isalpha(int c)
-{
- return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
-}
diff --git a/src/ctype/ft_isascii.c b/src/ctype/ft_isascii.c
deleted file mode 100644
index 12b6849..0000000
--- a/src/ctype/ft_isascii.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_isascii.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 09:54:30 by cacharle #+# #+# */
-/* Updated: 2020/02/12 23:01:02 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-int ft_isascii(int c)
-{
- return (c >= 00 && c <= 0177);
-}
diff --git a/src/ctype/ft_isblank.c b/src/ctype/ft_isblank.c
deleted file mode 100644
index def106b..0000000
--- a/src/ctype/ft_isblank.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_isblank.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/10 05:17:45 by cacharle #+# #+# */
-/* Updated: 2020/02/10 05:18:34 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-int ft_isblank(int c)
-{
- return (c == ' ' || c == '\t');
-}
diff --git a/src/ctype/ft_isdigit.c b/src/ctype/ft_isdigit.c
deleted file mode 100644
index f8a5850..0000000
--- a/src/ctype/ft_isdigit.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_isdigit.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:41:20 by cacharle #+# #+# */
-/* Updated: 2019/10/07 10:41:25 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-int ft_isdigit(int c)
-{
- return (c >= '0' && c <= '9');
-}
diff --git a/src/ctype/ft_isprint.c b/src/ctype/ft_isprint.c
deleted file mode 100644
index c311709..0000000
--- a/src/ctype/ft_isprint.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_isprint.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 09:52:09 by cacharle #+# #+# */
-/* Updated: 2019/10/20 13:03:36 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-int ft_isprint(int c)
-{
- return (c >= ' ' && c <= '~');
-}
diff --git a/src/ctype/ft_isspace.c b/src/ctype/ft_isspace.c
deleted file mode 100644
index 18b6dba..0000000
--- a/src/ctype/ft_isspace.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_isspace.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/01/15 11:33:36 by cacharle #+# #+# */
-/* Updated: 2020/01/15 11:35:07 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-int ft_isspace(int c)
-{
- return (c == ' ' || c == '\t' || c == '\n'
- || c == '\v' || c == '\f' || c == '\r');
-}
diff --git a/src/ctype/ft_todigit.c b/src/ctype/ft_todigit.c
deleted file mode 100644
index f201470..0000000
--- a/src/ctype/ft_todigit.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_todigit.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/01/15 10:37:57 by cacharle #+# #+# */
-/* Updated: 2020/02/12 23:11:55 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-int ft_todigit(int c)
-{
- if (!ft_isdigit(c))
- return (-1);
- return (c & 0x0F);
-}
diff --git a/src/ctype/ft_tolower.c b/src/ctype/ft_tolower.c
deleted file mode 100644
index 919469f..0000000
--- a/src/ctype/ft_tolower.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_tolower.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:14:26 by cacharle #+# #+# */
-/* Updated: 2019/11/20 01:04:02 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-/*
-** E: 0100 0101
-** e: 0110 0101
-** ^
-*/
-
-int ft_tolower(int c)
-{
- if (c >= 'A' && c <= 'Z')
- return (c | 0b00100000);
- return (c);
-}
diff --git a/src/ctype/ft_toupper.c b/src/ctype/ft_toupper.c
deleted file mode 100644
index 8579b91..0000000
--- a/src/ctype/ft_toupper.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_toupper.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:14:10 by cacharle #+# #+# */
-/* Updated: 2019/11/20 01:04:51 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-int ft_toupper(int c)
-{
- if (c >= 'a' && c <= 'z')
- return (c ^ 0b00100000);
- return (c);
-}
diff --git a/src/mem/ft_bzero.c b/src/ft_bzero.c
index d179af0..d179af0 100644
--- a/src/mem/ft_bzero.c
+++ b/src/ft_bzero.c
diff --git a/src/mem/ft_memcpy.c b/src/ft_memcpy.c
index d0ef008..091910f 100644
--- a/src/mem/ft_memcpy.c
+++ b/src/ft_memcpy.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/07 10:00:07 by cacharle #+# #+# */
-/* Updated: 2020/01/17 10:39:04 by cacharle ### ########.fr */
+/* Updated: 2020/09/18 16:38:48 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -22,7 +22,7 @@ void *ft_memcpy(void *dest, const void *src, size_t n)
while (n % 8 > 0)
{
n--;
- ((t_ftbyte*)dest)[n] = ((t_ftbyte*)src)[n];
+ ((uint8_t*)dest)[n] = ((uint8_t*)src)[n];
}
long_dest = dest;
long_src = src;
diff --git a/src/mem/ft_memset.c b/src/ft_memset.c
index 89f53ff..8feb3f5 100644
--- a/src/mem/ft_memset.c
+++ b/src/ft_memset.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/07 10:01:23 by cacharle #+# #+# */
-/* Updated: 2020/01/17 10:39:10 by cacharle ### ########.fr */
+/* Updated: 2020/09/18 16:37:18 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -19,7 +19,7 @@ void *ft_memset(void *s, int c, size_t n)
c = (unsigned char)c;
while (n % 8 > 0)
- *((t_ftbyte*)s + --n) = c;
+ *((uint8_t*)s + --n) = c;
buf = (long int)c | (long int)c << 8 | (long int)c << 16
| (long int)c << 24 | (long int)c << 32 | (long int)c << 40
| (long int)c << 48 | (long int)c << 56;
diff --git a/src/io/ft_putchar.c b/src/ft_putchar.c
index 2838f0a..2838f0a 100644
--- a/src/io/ft_putchar.c
+++ b/src/ft_putchar.c
diff --git a/src/io/ft_putchar_fd.c b/src/ft_putchar_fd.c
index 97d6f7a..97d6f7a 100644
--- a/src/io/ft_putchar_fd.c
+++ b/src/ft_putchar_fd.c
diff --git a/src/io/ft_putendl.c b/src/ft_putendl.c
index 880977e..880977e 100644
--- a/src/io/ft_putendl.c
+++ b/src/ft_putendl.c
diff --git a/src/io/ft_putendl_fd.c b/src/ft_putendl_fd.c
index a8077fc..a8077fc 100644
--- a/src/io/ft_putendl_fd.c
+++ b/src/ft_putendl_fd.c
diff --git a/src/io/ft_putnbr.c b/src/ft_putnbr.c
index 247df40..247df40 100644
--- a/src/io/ft_putnbr.c
+++ b/src/ft_putnbr.c
diff --git a/src/io/ft_putnbr_fd.c b/src/ft_putnbr_fd.c
index 169d1b5..169d1b5 100644
--- a/src/io/ft_putnbr_fd.c
+++ b/src/ft_putnbr_fd.c
diff --git a/src/io/ft_putstr.c b/src/ft_putstr.c
index 14b01a3..14b01a3 100644
--- a/src/io/ft_putstr.c
+++ b/src/ft_putstr.c
diff --git a/src/io/ft_putstr_fd.c b/src/ft_putstr_fd.c
index d0279ab..d0279ab 100644
--- a/src/io/ft_putstr_fd.c
+++ b/src/ft_putstr_fd.c
diff --git a/src/lst/ft_lstsize.c b/src/ft_strlen.c
index 922b581..c484500 100644
--- a/src/lst/ft_lstsize.c
+++ b/src/ft_strlen.c
@@ -1,27 +1,23 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
-/* ft_lstsize_bonus.c :+: :+: :+: */
+/* ft_strlen.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/09 09:04:28 by cacharle #+# #+# */
-/* Updated: 2019/11/20 04:01:44 by cacharle ### ########.fr */
+/* Created: 2019/10/07 10:32:48 by cacharle #+# #+# */
+/* Updated: 2020/09/18 16:38:28 by charles ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
-#include "libft_lst.h"
-int ft_lstsize(t_ftlst *lst)
+size_t ft_strlen(const char *s)
{
- int counter;
+ size_t counter;
counter = 0;
- while (lst != NULL)
- {
+ while (s[counter] != '\0')
counter++;
- lst = lst->next;
- }
return (counter);
}
diff --git a/src/ht/ft_htcontent_new.c b/src/ht/ft_htcontent_new.c
deleted file mode 100644
index 214e125..0000000
--- a/src/ht/ft_htcontent_new.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_htcontent_new.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/01/30 08:45:36 by cacharle #+# #+# */
-/* Updated: 2020/02/17 04:09:50 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_ht.h"
-
-t_ftht_content *ft_htcontent_new(char *key, void *value)
-{
- t_ftht_content *content;
-
- if (key == NULL)
- return (NULL);
- if ((content = (t_ftht_content*)malloc(sizeof(t_ftht_content))) == NULL)
- return (NULL);
- if ((content->key = ft_strdup(key)) == NULL)
- {
- free(content);
- return (NULL);
- }
- content->value = value;
- return (content);
-}
diff --git a/src/ht/ft_htdelone.c b/src/ht/ft_htdelone.c
deleted file mode 100644
index 2c54721..0000000
--- a/src/ht/ft_htdelone.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_htdelone.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/01/30 09:27:18 by cacharle #+# #+# */
-/* Updated: 2020/02/19 02:35:06 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_ht.h"
-
-void ft_htdelone(t_ftht *ht, char *key, void (*del)(t_ftht_content*))
-{
- ft_lstremove_if(ht->entries + ft_hthash(ht, key),
- ft_inter_htkey_cmp, key,
- (void (*)(void*))del);
-}
diff --git a/src/ht/ft_htdestroy.c b/src/ht/ft_htdestroy.c
deleted file mode 100644
index e0442c6..0000000
--- a/src/ht/ft_htdestroy.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_htdestroy.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/01/30 08:19:06 by cacharle #+# #+# */
-/* Updated: 2020/01/30 08:33:09 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_ht.h"
-
-void ft_htdestroy(t_ftht *ht, void (*del)(t_ftht_content*))
-{
- if (ht == NULL)
- return ;
- while (ht->size-- > 0)
- ft_lstclear(ht->entries + ht->size, (void (*)(void*))del);
- free(ht->entries);
- free(ht);
-}
diff --git a/src/ht/ft_htget.c b/src/ht/ft_htget.c
deleted file mode 100644
index 76e4fb2..0000000
--- a/src/ht/ft_htget.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_htget.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/01/30 08:33:21 by cacharle #+# #+# */
-/* Updated: 2020/02/19 01:44:41 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_ht.h"
-
-void *ft_htget(t_ftht *ht, char *key)
-{
-
- t_ftht_digest digest;
- t_ftlst *found;
-
- if (ht == NULL || key == NULL)
- return (NULL);
- digest = ft_hthash(ht, key);
- found = ft_lstlfind(ht->entries[digest], ft_inter_htkey_cmp, key);
- if (found == NULL)
- return (NULL);
- return (((t_ftht_content*)found->content)->value);
-}
diff --git a/src/ht/ft_hthash.c b/src/ht/ft_hthash.c
deleted file mode 100644
index e7e696c..0000000
--- a/src/ht/ft_hthash.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_hthash.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/01/30 09:56:01 by cacharle #+# #+# */
-/* Updated: 2020/01/30 10:34:27 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_ht.h"
-
-t_ftht_digest ft_hthash(t_ftht *ht, char *key)
-{
- t_ftht_digest digest;
-
- if (*key == '\0')
- return (0);
- digest = *key++ << 7;
- while (*key != '\0')
- {
- digest = ((1000003 * digest) ^ *key) & (1 << 16);
- key++;
- }
- return (digest % ht->size);
-}
diff --git a/src/ht/ft_htnew.c b/src/ht/ft_htnew.c
deleted file mode 100644
index d98a724..0000000
--- a/src/ht/ft_htnew.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_htnew.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/01/30 08:19:16 by cacharle #+# #+# */
-/* Updated: 2020/02/10 02:16:20 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_ht.h"
-
-t_ftht *ft_htnew(t_ftsize size)
-{
- t_ftht *ht;
-
- if (size == 0)
- return (NULL);
- if ((ht = (t_ftht*)malloc(sizeof(t_ftht))) == NULL)
- return (NULL);
- ht->entries = (t_ftht_entry*)ft_calloc(size, sizeof(t_ftht_entry));
- if (ht->entries == NULL)
- {
- free(ht);
- return (NULL);
- }
- ht->size = size;
- return (ht);
-}
diff --git a/src/ht/ft_htset.c b/src/ht/ft_htset.c
deleted file mode 100644
index c7068d5..0000000
--- a/src/ht/ft_htset.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_htset.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/01/30 08:41:52 by cacharle #+# #+# */
-/* Updated: 2020/02/19 02:44:10 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_ht.h"
-
-t_ftht_content *ft_htset(t_ftht *ht, char *key, void *value,
- void (*del)(t_ftht_content*))
-{
- t_ftht_digest digest;
- t_ftht_content *content;
- t_ftht_entry entry;
- t_ftlst *tmp;
-
- if (ht == NULL || key == NULL)
- return (NULL);
- if ((content = ft_htcontent_new(key, value)) == NULL)
- return (NULL);
- digest = ft_hthash(ht, key);
- tmp = ft_lstlfind(ht->entries[digest], ft_inter_htkey_cmp, key);
- if (tmp != NULL)
- {
- if (del != NULL)
- (*del)(tmp->content);
- tmp->content = content;
- return ((t_ftht_content*)tmp->content);
- }
-
- if ((entry = ft_lstnew(content)) == NULL)
- {
- free(content);
- return (NULL);
- }
- ft_lstadd_front(ht->entries + digest, entry);
- return (content);
-}
diff --git a/src/ht/ft_inter_htkey_cmp.c b/src/ht/ft_inter_htkey_cmp.c
deleted file mode 100644
index 6f04ecc..0000000
--- a/src/ht/ft_inter_htkey_cmp.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_internal_htkey_equal.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/01/30 09:24:39 by cacharle #+# #+# */
-/* Updated: 2020/02/19 02:03:14 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_ht.h"
-
-int ft_inter_htkey_cmp(const void *ref_key, const void *content)
-{
- if (ref_key == NULL || content == NULL)
- return (-1);
- return (ft_strcmp((char*)ref_key, ((t_ftht_content*)content)->key));
-}
diff --git a/src/io/ft_getchar.c b/src/io/ft_getchar.c
deleted file mode 100644
index 9d233c0..0000000
--- a/src/io/ft_getchar.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_getchar.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/01/18 10:29:54 by cacharle #+# #+# */
-/* Updated: 2020/02/14 02:24:56 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-char ft_getchar(void)
-{
- char c;
-
- if (read(STDIN_FILENO, &c, 1) < 0)
- return (-1);
- return (c);
-}
diff --git a/src/io/ft_next_line.c b/src/io/ft_next_line.c
deleted file mode 100644
index 0f4cc2c..0000000
--- a/src/io/ft_next_line.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_next_line.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/01/31 10:39:38 by cacharle #+# #+# */
-/* Updated: 2020/02/14 03:38:01 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-static int st_find_newline(char *str)
-{
- int i;
-
- i = -1;
- while (str[++i])
- if (str[i] == '\n')
- return (i);
- return (-1);
-}
-
-static int st_free_return(char **ptr, char **ptr2, int ret)
-{
- if (ptr != NULL)
- {
- free(*ptr);
- *ptr = NULL;
- }
- if (ptr2 != NULL)
- {
- free(*ptr2);
- *ptr2 = NULL;
- }
- return (ret);
-}
-
-static int st_read_line(int fd, char **line, char *rest)
-{
- int ret;
- int split_at;
- char *buf;
-
- if ((buf = malloc(sizeof(char) * (FTNL_BUFFER_SIZE + 1))) == NULL)
- return (st_free_return(line, NULL, FTNL_STATUS_ERROR));
- while ((ret = read(fd, buf, FTNL_BUFFER_SIZE)) > 0)
- {
- buf[ret] = '\0';
- if ((split_at = st_find_newline(buf)) != -1)
- {
- ft_strcpy(rest, buf + split_at + 1);
- buf[split_at] = '\0';
- if ((*line = ft_strjoinf(*line, buf, FT_STRJOINF_FST)) == NULL)
- return (st_free_return(&buf, NULL, FTNL_STATUS_ERROR));
- return (st_free_return(&buf, NULL, FTNL_STATUS_LINE));
- }
- if ((*line = ft_strjoinf(*line, buf, FT_STRJOINF_FST)) == NULL)
- return (st_free_return(&buf, NULL, FTNL_STATUS_ERROR));
- }
- if (ret == -1)
- return (st_free_return(&buf, line, FTNL_STATUS_ERROR));
- return (st_free_return(&buf, NULL, ret));
-}
-
-/*
-** if has rest:
-** if rest has newline:
-** push rest until newline in line, shift rest
-** return LINE_READ
-** else:
-** push rest in line
-**
-** while can read fd in buf
-** if buf has newline:
-** push buf until newline in line
-** push buf after newline in rest
-** return LINE_READ
-** push buf in line
-**
-** return FTNL_EOF
-*/
-
-int ft_next_line(int fd, char **line)
-{
- int split_at;
- static char rest[OPEN_MAX][FTNL_BUFFER_SIZE + 1] = {{0}};
-
- if (fd < 0 || fd > OPEN_MAX || line == NULL || FTNL_BUFFER_SIZE <= 0)
- return (FTNL_STATUS_ERROR);
- if ((*line = ft_strdup("")) == NULL)
- return (FTNL_STATUS_ERROR);
- if (rest[fd][0] == '\0')
- return (st_read_line(fd, line, rest[fd]));
- if ((split_at = st_find_newline(rest[fd])) != -1)
- {
- free(*line);
- if ((*line = (char*)malloc(sizeof(char) * (split_at + 1))) == NULL)
- return (FTNL_STATUS_ERROR);
- ft_strncpy(*line, rest[fd], split_at);
- (*line)[split_at] = '\0';
- ft_strcpy(rest[fd], rest[fd] + split_at + 1);
- return (FTNL_STATUS_LINE);
- }
- free(*line);
- if (!(*line = (char*)malloc(sizeof(char) * (ft_strlen(rest[fd]) + 1))))
- return (FTNL_STATUS_ERROR);
- ft_strcpy(*line, rest[fd]);
- rest[fd][0] = '\0';
- return (st_read_line(fd, line, rest[fd]));
-}
diff --git a/src/io/ft_printf/ft_asprintf.c b/src/io/ft_printf/ft_asprintf.c
deleted file mode 100644
index 5eb62d9..0000000
--- a/src/io/ft_printf/ft_asprintf.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_asprintf.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/11/21 02:30:33 by cacharle #+# #+# */
-/* Updated: 2019/11/21 03:43:08 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-int ft_asprintf(char **ret, const char *format, ...)
-{
- int vret;
- va_list ap;
-
- va_start(ap, format);
- vret = ft_vasprintf(ret, format, ap);
- va_end(ap);
- return (vret);
-}
diff --git a/src/io/ft_printf/ft_dprintf.c b/src/io/ft_printf/ft_dprintf.c
deleted file mode 100644
index 8e60970..0000000
--- a/src/io/ft_printf/ft_dprintf.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_dprintf.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/11/21 02:29:11 by cacharle #+# #+# */
-/* Updated: 2019/11/21 03:42:05 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-int ft_dprintf(int fd, const char *format, ...)
-{
- int ret;
- va_list ap;
-
- va_start(ap, format);
- ret = ft_vdprintf(fd, format, ap);
- va_end(ap);
- return (ret);
-}
diff --git a/src/io/ft_printf/ft_printf.c b/src/io/ft_printf/ft_printf.c
deleted file mode 100644
index 1b92bb2..0000000
--- a/src/io/ft_printf/ft_printf.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_printf.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/11/21 02:31:32 by cacharle #+# #+# */
-/* Updated: 2019/11/21 03:41:54 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-int ft_printf(const char *format, ...)
-{
- int ret;
- va_list ap;
-
- va_start(ap, format);
- ret = ft_vprintf(format, ap);
- va_end(ap);
- return (ret);
-}
diff --git a/src/io/ft_printf/ft_snprintf.c b/src/io/ft_printf/ft_snprintf.c
deleted file mode 100644
index e1fdfbd..0000000
--- a/src/io/ft_printf/ft_snprintf.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_snprintf.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/11/21 02:27:55 by cacharle #+# #+# */
-/* Updated: 2019/11/21 03:41:49 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-int ft_snprintf(char *str, size_t size, const char *format, ...)
-{
- int ret;
- va_list ap;
-
- va_start(ap, format);
- ret = ft_vsnprintf(str, size, format, ap);
- va_end(ap);
- return (ret);
-}
diff --git a/src/io/ft_printf/ft_sprintf.c b/src/io/ft_printf/ft_sprintf.c
deleted file mode 100644
index 31da75e..0000000
--- a/src/io/ft_printf/ft_sprintf.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_sprintf.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/11/21 02:17:21 by cacharle #+# #+# */
-/* Updated: 2019/11/21 03:42:28 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-int ft_sprintf(char *str, const char *format, ...)
-{
- int ret;
- va_list ap;
-
- va_start(ap, format);
- ret = ft_vsprintf(str, format, ap);
- va_end(ap);
- return (ret);
-}
diff --git a/src/io/ft_printf/ft_vasprintf.c b/src/io/ft_printf/ft_vasprintf.c
deleted file mode 100644
index 85f66bc..0000000
--- a/src/io/ft_printf/ft_vasprintf.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_vasprintf.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/11/21 02:49:56 by cacharle #+# #+# */
-/* Updated: 2019/11/21 03:45:39 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-int ft_vasprintf(char **ret, const char *format, va_list ap)
-{
- (void)ret;
- (void)format;
- (void)ap;
- return (0);
-}
diff --git a/src/io/ft_printf/ft_vasprintf.h b/src/io/ft_printf/ft_vasprintf.h
deleted file mode 100644
index 2d364c8..0000000
--- a/src/io/ft_printf/ft_vasprintf.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* header.h :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/29 00:06:46 by cacharle #+# #+# */
-/* Updated: 2020/01/15 11:39:15 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#ifndef FT_VASPRINTF_H
-# define FT_VASPRINTF_H
-
-# include <unistd.h>
-# include <stdlib.h>
-# include <stdarg.h>
-# include "libft.h"
-
-# define STATUS_ERROR -1
-
-# define SPECIFIERS_STR "nfcspdiuxX%"
-# define FLAGS_STR "#0- +'"
-
-# define IS_STANDALONE_FLAG(c) (ft_strchr(FLAGS_STR, c) != NULL)
-
-# define FLAG_MINUS (1 << 0)
-# define FLAG_ZERO (1 << 1)
-# define FLAG_SIGNED (1 << 2)
-# define FLAG_SPACE (1 << 3)
-# define FLAG_ALTERNATE (1 << 4)
-# define FLAG_SHORT (1 << 5)
-# define FLAG_SHORT_SHORT (1 << 6)
-# define FLAG_LONG (1 << 7)
-# define FLAG_LONG_LONG (1 << 8)
-# define FLAG_WIDTH_WILDCARD (1 << 9)
-# define FLAG_PRECISION_WILDCARD (1 << 10)
-# define FLAG_WIDTH_OVERWRITE (1 << 11)
-
-# define ITOA_HEX_LOW(x) (ft_itoa_unsigned_base(x, "0123456789abcdef"))
-# define ITOA_HEX_UP(x) (ft_itoa_unsigned_base(x, "0123456789ABCDEF"))
-# define ITOA_DEC(x) (ft_itoa_base(x, "0123456789"))
-
-typedef int t_bool;
-typedef short t_flags;
-typedef long long int t_big_int;
-typedef long long unsigned int t_big_uint;
-
-typedef struct
-{
- int precision;
- int width;
- t_flags flags;
- char specifier;
- int fmt_len;
- int size;
- long long int *written;
-} t_pformat;
-
-typedef struct s_flist
-{
- struct s_flist *next;
- t_pformat *content;
-} t_flist;
-
-typedef struct s_printf_status
-{
- va_list ap;
- t_flist *flist;
- const char *format;
- char *out;
- int out_size;
-} t_printf_status;
-
-/*
-** ft_printf.c
-*/
-
-int ft_printf(const char *format, ...);
-const char *add_conversion(t_printf_status *status,
- t_pformat *pformat);
-const char *add_between(t_printf_status *status);
-int destroy_status_error(t_printf_status *status);
-
-/*
-** parse.c
-*/
-
-int parse(const char *format, t_flist **flist);
-t_pformat *parse_reduced(const char *fmt);
-
-/*
-** printer.c
-*/
-
-char *convert(t_pformat *pformat, va_list ap);
-char *convert_specifier(va_list ap, t_pformat *pformat);
-char *handle_width(t_pformat *pformat, char *str);
-char *handle_precision(t_pformat *pformat, char *str);
-
-/*
-** utils.c
-*/
-
-char *ft_itoa_base(long long int n, char *base);
-char *ft_itoa_unsigned_base(long long unsigned int n,
- char *base);
-void *ft_memjoin_free(void *dst, int dst_size, void *src,
- int src_size);
-
-/*
-** extract.c
-*/
-
-const char *extract_flags(t_pformat *pformat, const char *fmt);
-const char *extract_width(t_pformat *pformat, const char *fmt);
-const char *extract_precision(t_pformat *pformat, const char *fmt);
-const char *extract_length_modifier(t_pformat *pformat,
- const char *fmt);
-
-/*
-** list.c
-*/
-
-t_flist *list_new(t_pformat *content);
-void *list_destroy(t_flist **lst);
-void list_push_front(t_flist **lst, t_flist *new);
-void list_pop_front(t_flist **lst);
-t_flist *list_reverse(t_flist *lst);
-
-/*
-** convert_*.c
-*/
-
-char *convert_char(va_list ap, t_pformat *pformat);
-char *convert_str(va_list ap, t_pformat *pformat);
-char *convert_ptr(va_list ap, t_pformat *pformat);
-char *convert_int(va_list ap, t_pformat *pformat);
-char *convert_uint(va_list ap, t_pformat *pformat);
-char *convert_hex(va_list ap, t_pformat *pformat);
-char *convert_percent(va_list ap, t_pformat *pformat);
-char *convert_written(va_list ap, t_pformat *pformat);
-char *convert_double(va_list ap, t_pformat *pformat);
-char *convert_none(va_list ap, t_pformat *pformat);
-
-/*
-** length_modifier.c
-*/
-
-t_big_uint length_modifier_unsigned_int(
- va_list ap, t_pformat *pformat);
-t_big_int length_modifier_int(va_list ap, t_pformat *pformat);
-
-#endif
diff --git a/src/io/ft_printf/ft_vdprintf.c b/src/io/ft_printf/ft_vdprintf.c
deleted file mode 100644
index a5e5ebf..0000000
--- a/src/io/ft_printf/ft_vdprintf.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_vdprintf.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/11/21 02:40:03 by cacharle #+# #+# */
-/* Updated: 2019/11/21 03:46:00 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-int ft_vdprintf(int fd, const char *format, va_list ap)
-{
- int out_len;
- char *out;
-
- if ((out_len = ft_vasprintf(&out, format, ap)) == -1)
- return (-1);
- write(fd, out, out_len);
- return (out_len);
-}
diff --git a/src/io/ft_printf/ft_vprintf.c b/src/io/ft_printf/ft_vprintf.c
deleted file mode 100644
index b98670b..0000000
--- a/src/io/ft_printf/ft_vprintf.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_vprintf.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/11/21 02:32:44 by cacharle #+# #+# */
-/* Updated: 2019/11/21 03:44:11 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-int ft_vprintf(const char *format, va_list ap)
-{
- return (ft_vdprintf(STDOUT_FILENO, format, ap));
-}
diff --git a/src/io/ft_printf/ft_vsnprintf.c b/src/io/ft_printf/ft_vsnprintf.c
deleted file mode 100644
index 7db988c..0000000
--- a/src/io/ft_printf/ft_vsnprintf.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_vsnprintf.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/11/21 02:36:32 by cacharle #+# #+# */
-/* Updated: 2019/11/21 03:45:14 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-int ft_vsnprintf(char *str, size_t size, const char *format, va_list ap)
-{
- int ret;
- int full_out_len;
- char *full_out;
-
- full_out_len = ft_vasprintf(&full_out, format, ap);
- ft_strncpy(str, full_out, size);
- ret = MIN((size_t)full_out_len, size);
- free(full_out);
- return (ret);
-}
diff --git a/src/io/ft_printf/ft_vsprintf.c b/src/io/ft_printf/ft_vsprintf.c
deleted file mode 100644
index 91b4815..0000000
--- a/src/io/ft_printf/ft_vsprintf.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_vsprintf.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/11/21 02:34:17 by cacharle #+# #+# */
-/* Updated: 2019/11/21 03:44:24 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-int ft_vsprintf(char *str, const char *format, va_list ap)
-{
- return (ft_vsnprintf(str, INT_MAX + 1, format, ap));
-}
diff --git a/src/io/ft_printf/internals/convert.c b/src/io/ft_printf/internals/convert.c
deleted file mode 100644
index 398c754..0000000
--- a/src/io/ft_printf/internals/convert.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* printer.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/28 23:19:24 by cacharle #+# #+# */
-/* Updated: 2019/11/14 10:22:04 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include "libft.h"
-#include "ft_vasprintf.h"
-
-char *convert(t_pformat *pformat, va_list ap)
-{
- char *str;
-
- if (pformat == NULL)
- return (NULL);
- if (pformat->flags & FLAG_WIDTH_WILDCARD)
- {
- if (pformat->flags & FLAG_WIDTH_OVERWRITE)
- (void)va_arg(ap, int);
- else
- pformat->width = va_arg(ap, int);
- if (pformat->width < 0)
- {
- pformat->flags |= FLAG_MINUS;
- pformat->width *= -1;
- }
- }
- if (pformat->flags & FLAG_PRECISION_WILDCARD)
- pformat->precision = va_arg(ap, int);
- if ((str = convert_specifier(ap, pformat)) == NULL)
- return (NULL);
- return (str);
-}
-
-char *convert_specifier(va_list ap, t_pformat *pformat)
-{
- if (pformat->specifier == 'c')
- return (convert_char(ap, pformat));
- if (pformat->specifier == 's')
- return (convert_str(ap, pformat));
- if (pformat->specifier == 'p')
- return (convert_ptr(ap, pformat));
- if (pformat->specifier == 'd' || pformat->specifier == 'i')
- return (convert_int(ap, pformat));
- if (pformat->specifier == 'u')
- return (convert_uint(ap, pformat));
- if (pformat->specifier == 'x')
- return (convert_hex(ap, pformat));
- if (pformat->specifier == 'X')
- return (convert_hex(ap, pformat));
- if (pformat->specifier == '%')
- return (convert_percent(ap, pformat));
- if (pformat->specifier == 'n')
- return (convert_written(ap, pformat));
- else
- return (convert_none(ap, pformat));
- return (NULL);
-}
-
-char *handle_width(t_pformat *pformat, char *str)
-{
- char *tmp;
- int len;
- int i;
-
- if ((len = ft_strlen(str)) >= pformat->width)
- return (str);
- if ((tmp = (char*)malloc(sizeof(char) * (pformat->width + 1))) == NULL)
- return (NULL);
- if (pformat->flags & FLAG_MINUS)
- {
- i = len;
- ft_strcpy(tmp, str);
- while (i < pformat->width)
- tmp[i++] = ' ';
- tmp[i] = 0;
- }
- else
- {
- i = 0;
- while (i <= pformat->width - len)
- tmp[i++] = pformat->flags & FLAG_ZERO ? '0' : ' ';
- ft_strcpy(tmp + i - 1, str);
- }
- free(str);
- return (tmp);
-}
-
-char *handle_precision(t_pformat *pformat, char *str)
-{
- int len;
- char *tmp;
-
- if (pformat == NULL || str == NULL)
- return (NULL);
- if (ft_strchr("diuxX", pformat->specifier) && pformat->precision >= 0)
- pformat->flags &= ~FLAG_ZERO;
- len = ft_strlen(str);
- if (pformat->precision == 0 && str[0] == '0')
- {
- free(str);
- return (ft_strdup(""));
- }
- if (!ft_strchr("diuxXp", pformat->specifier) || len >= pformat->precision)
- return (str);
- if ((tmp = (char*)malloc(sizeof(char) * (pformat->precision + 1))) == NULL)
- return (NULL);
- ft_strcpy(tmp + pformat->precision - len, str);
- while (pformat->precision-- > len)
- tmp[pformat->precision - len] = '0';
- free(str);
- return (tmp);
-}
diff --git a/src/io/ft_printf/internals/convert_char.c b/src/io/ft_printf/internals/convert_char.c
deleted file mode 100644
index c5f3a93..0000000
--- a/src/io/ft_printf/internals/convert_char.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* convert_char.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/30 23:22:29 by cacharle #+# #+# */
-/* Updated: 2019/11/05 23:44:42 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "ft_vasprintf.h"
-
-static char *handle_width_char(t_pformat *pformat, char *str)
-{
- char *tmp;
- int i;
-
- pformat->size = 1;
- if (1 >= pformat->width)
- return (str);
- if ((tmp = (char*)malloc(sizeof(char) * (pformat->width + 1))) == NULL)
- return (NULL);
- if (pformat->flags & FLAG_MINUS)
- {
- ft_memcpy(tmp, str, (i = 1) + 1);
- while (i < pformat->width)
- tmp[i++] = ' ';
- tmp[i] = 0;
- }
- else
- {
- i = 0;
- while (i <= pformat->width - 1)
- tmp[i++] = pformat->flags & FLAG_ZERO ? '0' : ' ';
- ft_memcpy(tmp + i - 1, str, 2);
- }
- free(str);
- pformat->size = pformat->width;
- return (tmp);
-}
-
-char *convert_char(va_list ap, t_pformat *pformat)
-{
- char *str;
-
- if ((str = ft_strnew(2)) == NULL)
- return (NULL);
- str[0] = va_arg(ap, int);
- str[1] = '\0';
- return (handle_width_char(pformat, str));
-}
diff --git a/src/io/ft_printf/internals/convert_hex.c b/src/io/ft_printf/internals/convert_hex.c
deleted file mode 100644
index 0464dc7..0000000
--- a/src/io/ft_printf/internals/convert_hex.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* convert_hex.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/30 23:23:06 by cacharle #+# #+# */
-/* Updated: 2019/11/05 23:58:59 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "ft_vasprintf.h"
-
-char *convert_hex(va_list ap, t_pformat *pformat)
-{
- char *str;
- long long unsigned int n;
-
- n = length_modifier_unsigned_int(ap, pformat);
- str = pformat->specifier == 'x' ? ITOA_HEX_LOW(n) : ITOA_HEX_UP(n);
- str = handle_precision(pformat, str);
- if (pformat->flags & FLAG_ZERO)
- {
- if (pformat->flags & FLAG_ALTERNATE && n != 0)
- pformat->width -= 2;
- str = handle_width(pformat, str);
- }
- if (pformat->flags & FLAG_ALTERNATE && n != 0)
- str = ft_strjoin_free_snd(pformat->specifier == 'X' ? "0X" : "0x", str);
- if (!(pformat->flags & FLAG_ZERO))
- str = handle_width(pformat, str);
- return (str);
-}
diff --git a/src/io/ft_printf/internals/convert_int.c b/src/io/ft_printf/internals/convert_int.c
deleted file mode 100644
index 2345f76..0000000
--- a/src/io/ft_printf/internals/convert_int.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* convert_int.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/30 23:29:53 by cacharle #+# #+# */
-/* Updated: 2019/11/06 00:00:09 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "ft_vasprintf.h"
-
-char *convert_int(va_list ap, t_pformat *pformat)
-{
- int is_neg;
- long long int n;
- char *str;
-
- n = length_modifier_int(ap, pformat);
- is_neg = n < 0;
- str = ITOA_DEC(n);
- if (is_neg)
- ft_strcpy(str, str + 1);
- str = handle_precision(pformat, str);
- if (pformat->flags & FLAG_ZERO)
- {
- if (is_neg || pformat->flags & (FLAG_SIGNED | FLAG_SPACE))
- pformat->width--;
- str = handle_width(pformat, str);
- }
- if (is_neg)
- str = ft_strjoin_free_snd("-", str);
- else if (pformat->flags & (FLAG_SIGNED | FLAG_SPACE))
- str = ft_strjoin_free_snd(pformat->flags & FLAG_SPACE ? " " : "+", str);
- if (!(pformat->flags & FLAG_ZERO))
- str = handle_width(pformat, str);
- return (str);
-}
diff --git a/src/io/ft_printf/internals/convert_none.c b/src/io/ft_printf/internals/convert_none.c
deleted file mode 100644
index 358ef1b..0000000
--- a/src/io/ft_printf/internals/convert_none.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* convert_none.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/11/04 19:30:25 by cacharle #+# #+# */
-/* Updated: 2019/11/05 23:44:13 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "ft_vasprintf.h"
-
-char *convert_none(va_list ap, t_pformat *pformat)
-{
- char *str;
-
- (void)ap;
- if ((str = ft_strdup("")) == NULL)
- return (NULL);
- str = handle_precision(pformat, str);
- str = handle_width(pformat, str);
- return (str);
-}
diff --git a/src/io/ft_printf/internals/convert_percent.c b/src/io/ft_printf/internals/convert_percent.c
deleted file mode 100644
index 813bb77..0000000
--- a/src/io/ft_printf/internals/convert_percent.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* convert_percent.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/30 23:23:27 by cacharle #+# #+# */
-/* Updated: 2019/11/05 23:44:07 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "ft_vasprintf.h"
-
-char *convert_percent(va_list ap, t_pformat *pformat)
-{
- char *str;
-
- (void)ap;
- str = ft_strdup("%");
- str = handle_width(pformat, str);
- return (str);
-}
diff --git a/src/io/ft_printf/internals/convert_ptr.c b/src/io/ft_printf/internals/convert_ptr.c
deleted file mode 100644
index 63babb9..0000000
--- a/src/io/ft_printf/internals/convert_ptr.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* convert_ptr.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/30 23:24:08 by cacharle #+# #+# */
-/* Updated: 2019/11/05 23:43:45 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "ft_vasprintf.h"
-
-char *convert_ptr(va_list ap, t_pformat *pformat)
-{
- char *str;
-
- str = ITOA_HEX_LOW((long long unsigned int)va_arg(ap, void*));
- str = handle_precision(pformat, str);
- if (!(pformat->flags & FLAG_ZERO))
- str = ft_strjoin_free_snd("0x", str);
- if (pformat->flags & FLAG_ZERO)
- pformat->width -= 2;
- str = handle_width(pformat, str);
- if (pformat->flags & FLAG_ZERO)
- str = ft_strjoin_free_snd("0x", str);
- return (str);
-}
diff --git a/src/io/ft_printf/internals/convert_str.c b/src/io/ft_printf/internals/convert_str.c
deleted file mode 100644
index 7d51a5e..0000000
--- a/src/io/ft_printf/internals/convert_str.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* convert_str.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/30 23:22:25 by cacharle #+# #+# */
-/* Updated: 2019/11/09 01:07:24 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "ft_vasprintf.h"
-
-char *convert_str(va_list ap, t_pformat *pformat)
-{
- char *str;
-
- str = va_arg(ap, char*);
- str = str == NULL ? ft_strdup("(null)") : ft_strdup(str);
- if (pformat->precision >= 0 && pformat->precision < (int)ft_strlen(str))
- str[pformat->precision] = '\0';
- str = handle_width(pformat, str);
- return (str);
-}
diff --git a/src/io/ft_printf/internals/convert_uint.c b/src/io/ft_printf/internals/convert_uint.c
deleted file mode 100644
index 4207165..0000000
--- a/src/io/ft_printf/internals/convert_uint.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* convert_uint.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/30 23:25:40 by cacharle #+# #+# */
-/* Updated: 2019/11/05 23:44:19 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "ft_vasprintf.h"
-
-char *convert_uint(va_list ap, t_pformat *pformat)
-{
- char *str;
- long long unsigned int n;
-
- if (pformat->flags & FLAG_SHORT)
- n = (unsigned short)va_arg(ap, int);
- else if (pformat->flags & FLAG_SHORT_SHORT)
- n = (unsigned char)va_arg(ap, int);
- else if (pformat->flags & FLAG_LONG)
- n = va_arg(ap, long unsigned int);
- else if (pformat->flags & FLAG_LONG_LONG)
- n = va_arg(ap, long long unsigned int);
- else
- n = va_arg(ap, unsigned int);
- str = ft_itoa_unsigned_base(n, "0123456789");
- str = handle_precision(pformat, str);
- str = handle_width(pformat, str);
- return (str);
-}
diff --git a/src/io/ft_printf/internals/convert_written.c b/src/io/ft_printf/internals/convert_written.c
deleted file mode 100644
index 4beeaef..0000000
--- a/src/io/ft_printf/internals/convert_written.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* convert_written.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/30 23:38:28 by cacharle #+# #+# */
-/* Updated: 2019/11/05 23:59:24 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "ft_vasprintf.h"
-
-char *convert_written(va_list ap, t_pformat *pformat)
-{
- if (pformat->flags & FLAG_SHORT)
- pformat->written = (long long int*)va_arg(ap, signed char*);
- if (pformat->flags & FLAG_SHORT_SHORT)
- pformat->written = (long long int*)va_arg(ap, short*);
- if (pformat->flags & FLAG_LONG)
- pformat->written = (long long int*)va_arg(ap, long int*);
- if (pformat->flags & FLAG_LONG_LONG)
- pformat->written = va_arg(ap, long long int*);
- else
- pformat->written = (long long int*)va_arg(ap, int*);
- return (NULL);
-}
diff --git a/src/io/ft_printf/internals/extract.c b/src/io/ft_printf/internals/extract.c
deleted file mode 100644
index c56a777..0000000
--- a/src/io/ft_printf/internals/extract.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* extract.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/29 00:10:36 by cacharle #+# #+# */
-/* Updated: 2019/11/10 10:33:33 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "ft_vasprintf.h"
-
-const char *extract_flags(t_pformat *pformat, const char *fmt)
-{
- if (*fmt == '\0')
- return (fmt);
- while (ft_strchr(FLAGS_STR, *fmt) != NULL)
- {
- if (*fmt == '0')
- pformat->flags |= FLAG_ZERO;
- if (*fmt == '-')
- pformat->flags |= FLAG_MINUS;
- if (*fmt == '+')
- pformat->flags |= FLAG_SIGNED;
- if (*fmt == ' ')
- pformat->flags |= FLAG_SPACE;
- if (*fmt == '#')
- pformat->flags |= FLAG_ALTERNATE;
- if (*fmt == '\'')
- ;
- fmt++;
- }
- if (pformat->flags & FLAG_SIGNED)
- pformat->flags &= ~FLAG_SPACE;
- return (fmt);
-}
-
-const char *extract_width(t_pformat *pformat, const char *fmt)
-{
- if (*fmt == '\0')
- return (fmt);
- if (*fmt == '*')
- {
- pformat->flags |= FLAG_WIDTH_WILDCARD;
- fmt++;
- }
- if (!ft_isdigit(*fmt))
- return (fmt);
- pformat->width = ft_atoi(fmt);
- while (*fmt && ft_isdigit(*fmt))
- fmt++;
- if (pformat->flags & FLAG_WIDTH_WILDCARD)
- pformat->flags |= FLAG_WIDTH_OVERWRITE;
- return (fmt);
-}
-
-const char *extract_precision(t_pformat *pformat, const char *fmt)
-{
- if (*fmt == '\0' || *fmt != '.')
- return (fmt);
- fmt++;
- if (*fmt == '*')
- {
- pformat->flags |= FLAG_PRECISION_WILDCARD;
- fmt++;
- }
- pformat->precision = ft_atoi(fmt);
- while (*fmt && ft_isdigit(*fmt))
- fmt++;
- return (fmt);
-}
-
-const char *extract_length_modifier(t_pformat *pformat, const char *fmt)
-{
- if (fmt[0] && fmt[0] == 'l')
- {
- if (fmt[1] && fmt[1] == 'l')
- {
- pformat->flags |= FLAG_LONG_LONG;
- return (fmt + 2);
- }
- pformat->flags |= FLAG_LONG;
- return (fmt + 1);
- }
- if (fmt[0] && fmt[0] == 'h')
- {
- if (fmt[1] && fmt[1] == 'h')
- {
- pformat->flags |= FLAG_SHORT_SHORT;
- return (fmt + 2);
- }
- pformat->flags |= FLAG_SHORT;
- return (fmt + 1);
- }
- return (fmt);
-}
diff --git a/src/io/ft_printf/internals/length_modifier.c b/src/io/ft_printf/internals/length_modifier.c
deleted file mode 100644
index 88226da..0000000
--- a/src/io/ft_printf/internals/length_modifier.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* length_modifier.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/11/05 23:56:07 by cacharle #+# #+# */
-/* Updated: 2019/11/09 00:50:06 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "ft_vasprintf.h"
-
-t_big_uint length_modifier_unsigned_int(va_list ap, t_pformat *pformat)
-{
- if (pformat->flags & FLAG_SHORT)
- return ((unsigned short)va_arg(ap, int));
- else if (pformat->flags & FLAG_SHORT_SHORT)
- return ((unsigned char)va_arg(ap, int));
- else if (pformat->flags & FLAG_LONG)
- return (va_arg(ap, long unsigned int));
- else if (pformat->flags & FLAG_LONG_LONG)
- return (va_arg(ap, long long unsigned int));
- return (va_arg(ap, unsigned int));
-}
-
-t_big_int length_modifier_int(va_list ap, t_pformat *pformat)
-{
- if (pformat->flags & FLAG_SHORT)
- return ((short)va_arg(ap, int));
- else if (pformat->flags & FLAG_SHORT_SHORT)
- return ((signed char)va_arg(ap, int));
- else if (pformat->flags & FLAG_LONG)
- return (va_arg(ap, long int));
- else if (pformat->flags & FLAG_LONG_LONG)
- return (va_arg(ap, long long int));
- return (va_arg(ap, int));
-}
diff --git a/src/io/ft_printf/internals/list.c b/src/io/ft_printf/internals/list.c
deleted file mode 100644
index 99491f4..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->content = 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)->content);
- 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);
-}
diff --git a/src/io/ft_printf/internals/parse.c b/src/io/ft_printf/internals/parse.c
deleted file mode 100644
index 33928a0..0000000
--- a/src/io/ft_printf/internals/parse.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* parse.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/29 00:11:33 by cacharle #+# #+# */
-/* Updated: 2019/11/13 08:13:02 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "ft_vasprintf.h"
-
-int parse(const char *format, t_flist **flist)
-{
- t_flist *tmp;
- t_pformat *parsed;
-
- *flist = NULL;
- while (*format)
- {
- format++;
- if (format[-1] != '%')
- continue;
- if ((parsed = parse_reduced(format)) == NULL)
- return ((int)list_destroy(flist));
- if ((tmp = list_new(parsed)) == NULL)
- return ((int)list_destroy(flist));
- list_push_front(flist, tmp);
- format += (*flist)->content->fmt_len;
- }
- *flist = list_reverse(*flist);
- return (1);
-}
-
-t_pformat *parse_reduced(const char *fmt)
-{
- t_pformat *pformat;
- const char *start;
-
- if ((pformat = (t_pformat*)malloc(sizeof(t_pformat))) == NULL)
- return (NULL);
- pformat->precision = -1;
- pformat->width = -1;
- pformat->flags = 0;
- start = fmt;
- fmt = extract_flags(pformat, fmt);
- fmt = extract_width(pformat, fmt);
- fmt = extract_precision(pformat, fmt);
- fmt = extract_length_modifier(pformat, fmt);
- pformat->fmt_len = fmt - start + 1;
- if (*fmt == '\0' || ft_strchr(SPECIFIERS_STR, *fmt) == NULL)
- {
- pformat->fmt_len--;
- pformat->specifier = '_';
- }
- else
- pformat->specifier = *ft_strchr(SPECIFIERS_STR, *fmt);
- return (pformat);
-}
diff --git a/src/io/ft_printf/internals/utils.c b/src/io/ft_printf/internals/utils.c
deleted file mode 100644
index ad44980..0000000
--- a/src/io/ft_printf/internals/utils.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* utils.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/29 00:12:40 by cacharle #+# #+# */
-/* Updated: 2019/11/13 08:49:58 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "ft_vasprintf.h"
-
-static int nbrlen_radix(long long int nbr, int radix)
-{
- int counter;
- long long unsigned int u_nbr;
-
- if (nbr == 0)
- return (1);
- counter = 0;
- u_nbr = nbr;
- if (nbr < 0)
- {
- counter++;
- u_nbr = -nbr;
- }
- while (u_nbr > 0)
- {
- u_nbr /= radix;
- counter++;
- }
- return (counter);
-}
-
-char *ft_itoa_base(long long int n, char *base)
-{
- char *str;
- int len;
- int radix;
- long long unsigned int u_nbr;
-
- radix = ft_strlen(base);
- len = nbrlen_radix(n, radix);
- if ((str = (char*)malloc(sizeof(char) * (len + 1))) == NULL)
- return (NULL);
- str[len] = '\0';
- u_nbr = n < 0 ? -n : n;
- if (n < 0)
- str[0] = '-';
- while (--len >= (n < 0 ? 1 : 0))
- {
- str[len] = base[u_nbr % radix];
- u_nbr /= radix;
- }
- return (str);
-}
-
-static int nbrlen_unsigned_radix(long long unsigned int nbr, int radix)
-{
- int counter;
-
- if (nbr == 0)
- return (1);
- counter = 0;
- while (nbr > 0)
- {
- nbr /= radix;
- counter++;
- }
- return (counter);
-}
-
-char *ft_itoa_unsigned_base(long long unsigned int n, char *base)
-{
- char *str;
- int len;
- int radix;
-
- radix = ft_strlen(base);
- len = nbrlen_unsigned_radix(n, radix);
- if ((str = (char*)malloc(sizeof(char) * (len + 1))) == NULL)
- return (NULL);
- str[len] = '\0';
- while (--len >= 0)
- {
- str[len] = base[n % radix];
- n /= radix;
- }
- return (str);
-}
-
-void *ft_memjoin_free(void *dst, int dst_size, void *src, int src_size)
-{
- void *clone;
-
- if (dst == NULL)
- {
- if ((dst = malloc(src_size)) == NULL)
- return (NULL);
- ft_memcpy(dst, src, src_size);
- return (dst);
- }
- if ((clone = malloc(dst_size)) == NULL)
- return (NULL);
- ft_memcpy(clone, dst, dst_size);
- free(dst);
- if ((dst = malloc(dst_size + src_size)) == NULL)
- return (NULL);
- ft_memcpy(dst, clone, dst_size);
- free(clone);
- ft_memcpy(dst + dst_size, src, src_size);
- return (dst);
-}
diff --git a/src/lst/ft_lstadd_back.c b/src/lst/ft_lstadd_back.c
deleted file mode 100644
index 8f39a75..0000000
--- a/src/lst/ft_lstadd_back.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_lstadd_back_bonus.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/09 09:02:03 by cacharle #+# #+# */
-/* Updated: 2019/11/20 04:01:26 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_lst.h"
-
-void ft_lstadd_back(t_ftlst **alst, t_ftlst *new)
-{
- if (alst == NULL)
- return ;
- if (*alst == NULL)
- {
- *alst = new;
- return ;
- }
- ft_lstlast(*alst)->next = new;
-}
diff --git a/src/lst/ft_lstadd_front.c b/src/lst/ft_lstadd_front.c
deleted file mode 100644
index bcd5ad9..0000000
--- a/src/lst/ft_lstadd_front.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_lstadd_front_bonus.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/09 09:02:25 by cacharle #+# #+# */
-/* Updated: 2019/10/18 12:16:06 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_lst.h"
-
-void ft_lstadd_front(t_ftlst **alst, t_ftlst *new)
-{
- if (alst == NULL || new == NULL)
- return ;
- new->next = *alst;
- *alst = new;
-}
diff --git a/src/lst/ft_lstbsearch.c b/src/lst/ft_lstbsearch.c
deleted file mode 100644
index d694209..0000000
--- a/src/lst/ft_lstbsearch.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_lstbsearch.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/01/30 09:17:51 by cacharle #+# #+# */
-/* Updated: 2020/02/17 03:03:21 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_lst.h"
-
-static t_ftlst *st_lstmiddle(t_ftlst *lst, t_ftlst *last)
-{
- t_ftlst *slow;
- t_ftlst *fast;
-
- if (lst == NULL)
- return (NULL);
- slow = lst;
- fast = lst;
- while (fast != last)
- {
- fast = fast->next;
- if (fast == last)
- break ;
- slow = slow->next;
- fast = fast->next;
- }
- return (slow);
-}
-
-static t_ftlst *st_lstbsearch_rec(t_ftlst *lst, t_ftlst *last,
- t_ftcompar_func cmp, const void *ref)
-{
- int res;
- t_ftlst *mid;
-
- if (lst == NULL)
- return (NULL);
- mid = st_lstmiddle(lst, last);
- if (mid == NULL)
- return (NULL);
- if (mid->next == NULL)
- {
- if (cmp(ref, mid->content) == 0)
- return (mid);
- return (NULL);
- }
- res = cmp(ref, mid->next->content);
- if (res < 0)
- return (st_lstbsearch_rec(lst, mid, cmp, ref));
- else if (res > 0)
- return (st_lstbsearch_rec(mid->next->next, NULL, cmp, ref));
- return (mid->next);
-}
-
-t_ftlst *ft_lstbsearch(t_ftlst *lst, t_ftcompar_func cmp,
- const void *ref)
-{
- return (st_lstbsearch_rec(lst, NULL, cmp, ref));
-}
diff --git a/src/lst/ft_lstclear.c b/src/lst/ft_lstclear.c
deleted file mode 100644
index 0bacb4f..0000000
--- a/src/lst/ft_lstclear.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_lstclear_bonus.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/09 09:02:39 by cacharle #+# #+# */
-/* Updated: 2019/11/20 04:02:37 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_lst.h"
-
-void ft_lstclear(t_ftlst **lst, void (*del)(void *))
-{
- if (lst == NULL)
- return ;
- if (*lst == NULL)
- return ;
- ft_lstclear(&((*lst)->next), del);
- ft_lstdelone(*lst, del);
- *lst = NULL;
-}
diff --git a/src/lst/ft_lstdelone.c b/src/lst/ft_lstdelone.c
deleted file mode 100644
index 63dcc35..0000000
--- a/src/lst/ft_lstdelone.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_lstdelone_bonus.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/09 09:03:02 by cacharle #+# #+# */
-/* Updated: 2019/11/20 04:02:31 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_lst.h"
-
-void ft_lstdelone(t_ftlst *lst, void (*del)(void *))
-{
- if (lst == NULL)
- return ;
- if (del != NULL)
- (*del)(lst->content);
- free(lst);
-}
diff --git a/src/lst/ft_lstiter.c b/src/lst/ft_lstiter.c
deleted file mode 100644
index 9b2895b..0000000
--- a/src/lst/ft_lstiter.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_lstiter_bonus.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/09 09:03:22 by cacharle #+# #+# */
-/* Updated: 2019/11/20 04:01:39 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_lst.h"
-
-void ft_lstiter(t_ftlst *lst, void (*f)(void *))
-{
- if (f == NULL)
- return ;
- while (lst != NULL)
- {
- (*f)(lst->content);
- lst = lst->next;
- }
-}
diff --git a/src/lst/ft_lstlast.c b/src/lst/ft_lstlast.c
deleted file mode 100644
index 728cbf2..0000000
--- a/src/lst/ft_lstlast.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_lstlast_bonus.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/09 09:03:40 by cacharle #+# #+# */
-/* Updated: 2019/11/20 04:02:26 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_lst.h"
-
-t_ftlst *ft_lstlast(t_ftlst *lst)
-{
- if (lst == NULL)
- return (NULL);
- while (lst->next != NULL)
- lst = lst->next;
- return (lst);
-}
diff --git a/src/lst/ft_lstlfind.c b/src/lst/ft_lstlfind.c
deleted file mode 100644
index 92d37d8..0000000
--- a/src/lst/ft_lstlfind.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_lstlfind.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/17 03:04:52 by cacharle #+# #+# */
-/* Updated: 2020/02/19 02:03:11 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_lst.h"
-
-t_ftlst *ft_lstlfind(t_ftlst *lst, t_ftcompar_func cmp, const void *ref)
-{
- if (lst == NULL)
- return (NULL);
- if (cmp(ref, lst->content) == 0)
- return (lst);
- return (ft_lstlfind(lst->next, cmp, ref));
-}
diff --git a/src/lst/ft_lstlsearch.c b/src/lst/ft_lstlsearch.c
deleted file mode 100644
index 8d2acc8..0000000
--- a/src/lst/ft_lstlsearch.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_lstlsearch.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/17 02:57:12 by cacharle #+# #+# */
-/* Updated: 2020/02/17 03:35:45 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_lst.h"
-
-t_ftlst *ft_lstlsearch(t_ftlst *lst, t_ftcompar_func cmp, const void *ref)
-{
- if (lst == NULL)
- return (ft_lstnew(ref));
- if (cmp(ref, lst->content) == 0)
- return (lst);
- if (lst->next == NULL)
- {
- lst->next = ft_lstnew(ref);
- return (lst->next);
- }
- return (ft_lstlsearch(lst->next, cmp, ref));
-}
diff --git a/src/lst/ft_lstmap.c b/src/lst/ft_lstmap.c
deleted file mode 100644
index dda15de..0000000
--- a/src/lst/ft_lstmap.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_lstmap_bonus.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/09 09:03:57 by cacharle #+# #+# */
-/* Updated: 2020/02/15 23:11:42 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_lst.h"
-
-t_ftlst *ft_lstmap(t_ftlst *lst, void *(*f)(void *), void (*del)(void *))
-{
- t_ftlst *mapped;
- t_ftlst *tmp;
-
- if (lst == NULL || f == NULL)
- return (NULL);
- mapped = NULL;
- while (lst != NULL)
- {
- if ((tmp = ft_lstnew((*f)(lst->content))) == NULL)
- {
- ft_lstclear(&mapped, del);
- return (NULL);
- }
- ft_lstadd_back(&mapped, tmp);
- lst = lst->next;
- }
- return (mapped);
-}
-
-/*
-** Rest in peace, my beautiful recursion.
-**
-** t_ftlst *tmp;
-**
-** if (lst == NULL)
-** return (NULL);
-** if ((tmp = ft_lstnew(lst->content)) == NULL)
-** return (NULL);
-** tmp->content = (*f)(tmp->content);
-** tmp->next = ft_lstmap(lst->next, f);
-** return (tmp);
-*/
diff --git a/src/lst/ft_lstnew.c b/src/lst/ft_lstnew.c
deleted file mode 100644
index 11cf223..0000000
--- a/src/lst/ft_lstnew.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_lstnew_bonus.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/09 09:01:16 by cacharle #+# #+# */
-/* Updated: 2019/11/20 04:01:35 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_lst.h"
-
-t_ftlst *ft_lstnew(void const *content)
-{
- t_ftlst *elem;
-
- if ((elem = (t_ftlst*)malloc(sizeof(t_ftlst))) == NULL)
- return (NULL);
- elem->content = (void*)content;
- elem->next = NULL;
- return (elem);
-}
diff --git a/src/lst/ft_lstpop_front.c b/src/lst/ft_lstpop_front.c
deleted file mode 100644
index ff386f9..0000000
--- a/src/lst/ft_lstpop_front.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_lstpop_front_bonus.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/25 03:32:51 by cacharle #+# #+# */
-/* Updated: 2020/01/15 12:46:28 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_lst.h"
-
-void ft_lstpop_front(t_ftlst **lst, void (*del)(void *))
-{
- t_ftlst *tmp;
-
- if (lst == NULL || *lst == NULL)
- return ;
- tmp = (*lst)->next;
- ft_lstdelone(*lst, del);
- *lst = tmp;
-}
diff --git a/src/lst/ft_lstremove_if.c b/src/lst/ft_lstremove_if.c
deleted file mode 100644
index 5221ae4..0000000
--- a/src/lst/ft_lstremove_if.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_lstremove_if.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/01/30 09:36:49 by cacharle #+# #+# */
-/* Updated: 2020/02/19 02:06:22 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_lst.h"
-
-void ft_lstremove_if(t_ftlst **lst, t_ftcompar_func cmp,
- const void *ref, t_ftdel_func del)
-{
- t_ftlst *saved_next;
-
- if (lst == NULL || *lst == NULL)
- return ;
- if (cmp(ref, (*lst)->content) == 0)
- {
- saved_next = (*lst)->next;
- ft_lstdelone(*lst, del);
- *lst = saved_next;
- ft_lstremove_if(lst, cmp, ref, del);
- return ;
- }
- ft_lstremove_if(&(*lst)->next, cmp, ref, del);
-}
diff --git a/src/lst/ft_lstreverse.c b/src/lst/ft_lstreverse.c
deleted file mode 100644
index 61c9daf..0000000
--- a/src/lst/ft_lstreverse.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_lstreverse.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/01/15 12:49:14 by cacharle #+# #+# */
-/* Updated: 2020/02/15 22:53:23 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_lst.h"
-
-void ft_lstreverse(t_ftlst **lst)
-{
- *lst = ft_lstreverse_ret(*lst);
-}
diff --git a/src/lst/ft_lstreverse_ret.c b/src/lst/ft_lstreverse_ret.c
deleted file mode 100644
index c115ac5..0000000
--- a/src/lst/ft_lstreverse_ret.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_lstreverse_ret.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/01/15 12:51:15 by cacharle #+# #+# */
-/* Updated: 2020/02/10 02:20:21 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_lst.h"
-
-t_ftlst *ft_lstreverse_ret(t_ftlst *lst)
-{
- t_ftlst *tmp;
-
- if (lst == NULL)
- return (NULL);
- if (lst->next == NULL)
- return (lst);
- tmp = ft_lstreverse_ret(lst->next);
- lst->next->next = lst;
- lst->next = NULL;
- return (tmp);
-}
diff --git a/src/lst/ft_lstsort.c b/src/lst/ft_lstsort.c
deleted file mode 100644
index e1c9913..0000000
--- a/src/lst/ft_lstsort.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_lstsort.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/10 01:53:55 by cacharle #+# #+# */
-/* Updated: 2020/02/16 02:18:05 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_lst.h"
-
-void ft_lstsort(t_ftlst **begin_list, t_ftcompar_func cmp)
-{
- t_ftlst *fast;
- t_ftlst *slow;
- t_ftlst *middle;
-
- if (begin_list == NULL || *begin_list == NULL
- || (*begin_list)->next == NULL)
- return ;
- fast = (*begin_list)->next;
- slow = *begin_list;
- while (fast != NULL)
- {
- fast = fast->next;
- if (fast != NULL)
- {
- fast = fast->next;
- slow = slow->next;
- }
- }
- middle = slow->next;
- slow->next = NULL;
- ft_lstsort(begin_list, cmp);
- ft_lstsort(&middle, cmp);
- *begin_list = ft_lstsorted_merge(*begin_list, middle, cmp);
-}
diff --git a/src/lst/ft_lstsorted_merge.c b/src/lst/ft_lstsorted_merge.c
deleted file mode 100644
index 4f5332c..0000000
--- a/src/lst/ft_lstsorted_merge.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_lstsorted_merge.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/10 01:58:52 by cacharle #+# #+# */
-/* Updated: 2020/02/16 02:18:11 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_lst.h"
-
-t_ftlst *ft_lstsorted_merge(t_ftlst *l1, t_ftlst *l2, t_ftcompar_func cmp)
-{
- t_ftlst *merged;
-
- merged = NULL;
- if (l1 == NULL)
- return (l2);
- if (l2 == NULL)
- return (l1);
- if (cmp(l1->content, l2->content) < 0)
- {
- merged = l1;
- merged->next = ft_lstsorted_merge(l1->next, l2, cmp);
- }
- else
- {
- merged = l2;
- merged->next = ft_lstsorted_merge(l1, l2->next, cmp);
- }
- return (merged);
-}
diff --git a/src/mem/ft_calloc.c b/src/mem/ft_calloc.c
deleted file mode 100644
index 24501bf..0000000
--- a/src/mem/ft_calloc.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_calloc.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 12:45:37 by cacharle #+# #+# */
-/* Updated: 2019/11/21 01:05:53 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-void *ft_calloc(size_t count, size_t size)
-{
- void *mem;
-
- if ((mem = malloc(count * size)) == NULL)
- return (NULL);
- ft_bzero(mem, count * size);
- return (mem);
-}
diff --git a/src/mem/ft_memalloc.c b/src/mem/ft_memalloc.c
deleted file mode 100644
index 5aab2ec..0000000
--- a/src/mem/ft_memalloc.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_memalloc.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:07:14 by cacharle #+# #+# */
-/* Updated: 2019/11/20 03:28:56 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-void *ft_memalloc(size_t size)
-{
- return (ft_calloc(size, 1));
-}
diff --git a/src/mem/ft_memccpy.c b/src/mem/ft_memccpy.c
deleted file mode 100644
index 8ce656a..0000000
--- a/src/mem/ft_memccpy.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_memccpy.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:01:53 by cacharle #+# #+# */
-/* Updated: 2020/01/17 10:54:03 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-void *ft_memccpy(void *dest, const void *src, int c, size_t n)
-{
- size_t i;
- t_ftbyte *cast_dest;
- t_ftbyte *cast_src;
-
- cast_dest = (t_ftbyte*)dest;
- cast_src = (t_ftbyte*)src;
- i = -1;
- while (++i < n)
- {
- cast_dest[i] = cast_src[i];
- if (cast_dest[i] == (unsigned char)c)
- return (cast_dest + i + 1);
- }
- return (NULL);
-}
diff --git a/src/mem/ft_memchr.c b/src/mem/ft_memchr.c
deleted file mode 100644
index 4fd8689..0000000
--- a/src/mem/ft_memchr.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_memchr.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 09:55:31 by cacharle #+# #+# */
-/* Updated: 2020/02/13 04:28:00 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-void *ft_memchr(const void *s, int c, size_t n)
-{
- size_t i;
- t_ftbyte *cast_s;
-
- cast_s = (t_ftbyte*)s;
- i = -1;
- while (++i < n)
- if (cast_s[i] == (unsigned char)c)
- return (cast_s + i);
- return (NULL);
-}
diff --git a/src/mem/ft_memcmp.c b/src/mem/ft_memcmp.c
deleted file mode 100644
index 233d796..0000000
--- a/src/mem/ft_memcmp.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_memcmp.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 09:56:44 by cacharle #+# #+# */
-/* Updated: 2020/01/17 10:54:15 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-int ft_memcmp(const void *s1, const void *s2, size_t n)
-{
- size_t i;
- t_ftbyte *cast_s1;
- t_ftbyte *cast_s2;
-
- cast_s1 = (t_ftbyte*)s1;
- cast_s2 = (t_ftbyte*)s2;
- if (n == 0)
- return (0);
- i = -1;
- while (++i < n)
- if (cast_s1[i] != cast_s2[i])
- return (cast_s1[i] - cast_s2[i]);
- return (0);
-}
diff --git a/src/mem/ft_memdel.c b/src/mem/ft_memdel.c
deleted file mode 100644
index 2b21f33..0000000
--- a/src/mem/ft_memdel.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_memdel.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:00:56 by cacharle #+# #+# */
-/* Updated: 2019/11/20 03:22:41 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-void ft_memdel(void **ap)
-{
- if (ap == NULL)
- return ;
- free(*ap);
- *ap = NULL;
-}
diff --git a/src/mem/ft_memmem.c b/src/mem/ft_memmem.c
deleted file mode 100644
index fa1446c..0000000
--- a/src/mem/ft_memmem.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_memmem.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/13 01:54:55 by cacharle #+# #+# */
-/* Updated: 2020/02/13 21:04:46 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_mem.h"
-
-#define BAD_TABLE_SIZE 256
-
-static void st_bad_table_init(size_t bad_table[BAD_TABLE_SIZE],
- const char *little, size_t little_len)
-{
- size_t i;
-
- i = 0;
- while (i < BAD_TABLE_SIZE)
- bad_table[i++] = little_len;
- i = 0;
- while (i < little_len - 1)
- {
- bad_table[(int)little[i]] = little_len - i - 1;
- i++;
- }
-}
-
-static int st_memcmp_end(const void *s1, const void *s2, size_t n)
-{
- while (n-- > 0)
- if (*(t_ftbyte*)(s1 + n) != *(t_ftbyte*)(s2 + n))
- return (*(t_ftbyte*)(s1 + n) - *(t_ftbyte*)(s2 + n));
- return (0);
-}
-
-void *ft_memmem(const void *big, size_t big_len,
- const void *little, size_t little_len)
-{
- size_t i;
- size_t bad_table[BAD_TABLE_SIZE];
-
- if (big_len < little_len || little_len == 0 || big_len == 0)
- return (NULL);
- st_bad_table_init(bad_table, little, little_len);
- i = 0;
- while (i <= big_len - little_len)
- {
- if (st_memcmp_end(big + i, little, little_len) == 0)
- return ((void*)big + i);
- i += bad_table[*(t_ftbyte*)(big + i + little_len - 1)];
- }
- return (NULL);
-}
diff --git a/src/mem/ft_memmove.c b/src/mem/ft_memmove.c
deleted file mode 100644
index 2f794fd..0000000
--- a/src/mem/ft_memmove.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_memmove.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:03:21 by cacharle #+# #+# */
-/* Updated: 2020/01/17 10:39:26 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-void *ft_memmove(void *dst, const void *src, size_t len)
-{
- long int *long_dst;
- const long int *long_src;
- void *dst_copy;
-
- if (dst >= src)
- return (ft_memcpy(dst, src, len));
- dst_copy = dst;
- while (len % 8 > 0)
- {
- len--;
- *(t_ftbyte*)dst++ = *(t_ftbyte*)src++;
- }
- long_dst = dst;
- long_src = src;
- len /= 8;
- while (len-- > 0)
- *long_dst++ = *long_src++;
- return (dst_copy);
-}
diff --git a/src/mem/ft_memset_pattern4.c b/src/mem/ft_memset_pattern4.c
deleted file mode 100644
index 112ce6d..0000000
--- a/src/mem/ft_memset_pattern4.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_memset_pattern4.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/13 03:06:41 by cacharle #+# #+# */
-/* Updated: 2020/02/13 19:58:10 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_mem.h"
-
-void ft_memset_pattern4(void *b, const void *pattern4, size_t len)
-{
- int i;
-
- i = len / 4;
- while (i-- > 0)
- ((int*)b)[i] = *(int*)pattern4;
- i = len % 4;
- len -= len % 4;
- while (i-- > 0)
- ((t_ftbyte*)b)[len + i] = ((t_ftbyte*)pattern4)[i];
-}
diff --git a/src/mem/ft_memswap.c b/src/mem/ft_memswap.c
deleted file mode 100644
index 8661fda..0000000
--- a/src/mem/ft_memswap.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_memswap.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/01/19 07:56:43 by cacharle #+# #+# */
-/* Updated: 2020/02/10 02:55:52 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-void ft_memswap(void *a, void *b, size_t size)
-{
- t_ftbyte tmp;
- t_ftbyte *cast_a;
- t_ftbyte *cast_b;
-
- cast_a = (t_ftbyte*)a;
- cast_b = (t_ftbyte*)b;
- while (size-- > 0)
- {
- tmp = cast_a[size];
- cast_a[size] = cast_b[size];
- cast_b[size] = tmp;
- }
-}
diff --git a/src/str/ft_atoi.c b/src/str/ft_atoi.c
deleted file mode 100644
index fa31407..0000000
--- a/src/str/ft_atoi.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_atoi.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 09:46:16 by cacharle #+# #+# */
-/* Updated: 2020/01/15 10:56:06 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-int ft_atoi(const char *str)
-{
- return ((int)ft_strtol(str, (char**)NULL, 10));
-}
diff --git a/src/str/ft_atoi_strict.c b/src/str/ft_atoi_strict.c
deleted file mode 100644
index 8be4c4b..0000000
--- a/src/str/ft_atoi_strict.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strict_atoi.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/01/15 10:06:29 by cacharle #+# #+# */
-/* Updated: 2020/02/14 02:46:43 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-int ft_atoi_strict(const char *s)
-{
- char *end;
- long ret;
-
- if (*s != '-' && !ft_isdigit(*s))
- {
- errno = EINVAL;
- return (0);
- }
- errno = 0;
- ret = ft_strtol(s, &end, 10);
- if (errno == ERANGE || ret > INT_MAX || ret < INT_MIN)
- {
- errno = ERANGE;
- return (0);
- }
- if (*end != '\0')
- {
- errno = EINVAL;
- return (0);
- }
- return (ret);
-}
diff --git a/src/str/ft_itoa.c b/src/str/ft_itoa.c
deleted file mode 100644
index 39b6e12..0000000
--- a/src/str/ft_itoa.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_itoa.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:19:56 by cacharle #+# #+# */
-/* Updated: 2020/02/14 03:39:11 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-char *ft_itoa(int n)
-{
- char *str;
- int len;
- unsigned int u_nbr;
-
- len = n < 0 || n == 0 ? 1 : 0;
- u_nbr = n < 0 ? -n : n;
- while (u_nbr > 0)
- {
- u_nbr /= 10;
- len++;
- }
- if ((str = (char*)malloc(sizeof(char) * (len + 1))) == NULL)
- return (NULL);
- str[len] = '\0';
- u_nbr = n < 0 ? -n : n;
- if (n < 0)
- str[0] = '-';
- while (--len >= (n < 0 ? 1 : 0))
- {
- str[len] = (u_nbr % 10) | 0x30;
- u_nbr /= 10;
- }
- return (str);
-}
diff --git a/src/str/ft_split.c b/src/str/ft_split.c
deleted file mode 100644
index 6fb5964..0000000
--- a/src/str/ft_split.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_split.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/17 08:29:02 by cacharle #+# #+# */
-/* Updated: 2019/11/20 04:08:27 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-static size_t count_segment(char const *s, char c)
-{
- size_t counter;
- int i;
-
- counter = 0;
- i = 0;
- while (s[i])
- {
- if (s[i] == c)
- {
- i++;
- continue ;
- }
- counter++;
- while (s[i] && s[i] != c)
- i++;
- }
- return (counter);
-}
-
-static void *destroy_strs(char **strs)
-{
- if (strs == NULL)
- return (NULL);
- while (*strs != NULL)
- free(*strs++);
- free(strs);
- return (NULL);
-}
-
-char **ft_split(char const *s, char c)
-{
- char **strs;
- size_t tab_counter;
- size_t i;
- size_t j;
-
- if (s == NULL)
- return (NULL);
- tab_counter = count_segment(s, c);
- if ((strs = (char**)malloc(sizeof(char*) * (tab_counter + 1))) == NULL)
- return (NULL);
- tab_counter = 0;
- j = -1;
- while (s[++j])
- {
- if (s[j] == c)
- continue ;
- i = 0;
- while (s[j + i] && s[j + i] != c)
- i++;
- if ((strs[tab_counter++] = ft_strndup(&s[j], i)) == NULL)
- return (destroy_strs(strs));
- j += i - 1;
- }
- strs[tab_counter] = NULL;
- return (strs);
-}
diff --git a/src/str/ft_strcasecmp.c b/src/str/ft_strcasecmp.c
deleted file mode 100644
index 044e6de..0000000
--- a/src/str/ft_strcasecmp.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strcasecmp.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/10 04:08:38 by cacharle #+# #+# */
-/* Updated: 2020/02/10 04:31:33 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_str.h"
-#include "libft_types.h"
-
-int ft_strcasecmp(const char *s1, const char *s2)
-{
- while (*s1 && *s2 && ft_tolower(*s1) == ft_tolower(*s2))
- {
- s1++;
- s2++;
- }
- return ((t_ftuchar)ft_tolower(*s1) - (t_ftuchar)ft_tolower(*s2));
-}
diff --git a/src/str/ft_strcat.c b/src/str/ft_strcat.c
deleted file mode 100644
index d5bc7e0..0000000
--- a/src/str/ft_strcat.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strcat.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:09:41 by cacharle #+# #+# */
-/* Updated: 2019/11/21 01:03:38 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-char *ft_strcat(char *dest, const char *src)
-{
- ft_memcpy(dest + ft_strlen(dest), src, ft_strlen(src) + 1);
- return (dest);
-}
diff --git a/src/str/ft_strchr.c b/src/str/ft_strchr.c
deleted file mode 100644
index 50bfc0a..0000000
--- a/src/str/ft_strchr.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strchr.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:14:47 by cacharle #+# #+# */
-/* Updated: 2019/11/21 01:04:52 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-char *ft_strchr(const char *s, int c)
-{
- return (ft_memchr(s, c, ft_strlen(s) + 1));
-}
diff --git a/src/str/ft_strclr.c b/src/str/ft_strclr.c
deleted file mode 100644
index 7e412fe..0000000
--- a/src/str/ft_strclr.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strclr.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:15:18 by cacharle #+# #+# */
-/* Updated: 2019/11/21 01:11:51 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-void ft_strclr(char *s)
-{
- if (s == NULL)
- return ;
- ft_bzero(s, ft_strlen(s));
-}
diff --git a/src/str/ft_strcmp.c b/src/str/ft_strcmp.c
deleted file mode 100644
index aced711..0000000
--- a/src/str/ft_strcmp.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strcmp.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:16:07 by cacharle #+# #+# */
-/* Updated: 2020/02/10 04:18:11 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-int ft_strcmp(const char *s1, const char *s2)
-{
- while (*s1 && *s2 && *s1 == *s2)
- {
- s1++;
- s2++;
- }
- return (*s1 - *s2);
-}
diff --git a/src/str/ft_strcount.c b/src/str/ft_strcount.c
deleted file mode 100644
index 87e756d..0000000
--- a/src/str/ft_strcount.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strcount.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/11/15 09:17:48 by cacharle #+# #+# */
-/* Updated: 2019/11/15 09:19:36 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-int ft_strcount(char *str, char c)
-{
- int counter;
-
- if (c == '\0')
- return (1);
- counter = 0;
- while (*str)
- if (*str++ == c)
- counter++;
- return (counter);
-}
diff --git a/src/str/ft_strcpy.c b/src/str/ft_strcpy.c
deleted file mode 100644
index ee6ff0d..0000000
--- a/src/str/ft_strcpy.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strcpy.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:38:36 by cacharle #+# #+# */
-/* Updated: 2020/01/17 11:36:19 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-char *ft_strcpy(char *dest, const char *src)
-{
- return (ft_memcpy(dest, src, ft_strlen(src) + 1));
-}
diff --git a/src/str/ft_strcspn.c b/src/str/ft_strcspn.c
deleted file mode 100644
index 7cc06a5..0000000
--- a/src/str/ft_strcspn.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strcspn.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/10 04:30:59 by cacharle #+# #+# */
-/* Updated: 2020/02/10 04:32:15 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_str.h"
-
-size_t ft_strcspn(const char *s, const char *charset)
-{
- int i;
-
- i = 0;
- while (ft_strchr(charset, s[i]) == NULL)
- i++;
- return (i);
-}
diff --git a/src/str/ft_strdel.c b/src/str/ft_strdel.c
deleted file mode 100644
index 05cf064..0000000
--- a/src/str/ft_strdel.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strdel.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:39:14 by cacharle #+# #+# */
-/* Updated: 2019/11/20 01:58:27 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-void ft_strdel(char **as)
-{
- ft_memdel((void*)as);
-}
diff --git a/src/str/ft_strdup.c b/src/str/ft_strdup.c
deleted file mode 100644
index b248272..0000000
--- a/src/str/ft_strdup.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strdup.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:18:07 by cacharle #+# #+# */
-/* Updated: 2020/02/14 03:39:56 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-char *ft_strdup(const char *s)
-{
- char *clone;
-
- if ((clone = (char*)malloc(sizeof(char) * (ft_strlen(s) + 1))) == NULL)
- return (NULL);
- return (ft_strcpy(clone, s));
-}
diff --git a/src/str/ft_strequ.c b/src/str/ft_strequ.c
deleted file mode 100644
index 75ccb81..0000000
--- a/src/str/ft_strequ.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strequ.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:18:34 by cacharle #+# #+# */
-/* Updated: 2019/11/20 02:00:22 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-int ft_strequ(char const *s1, char const *s2)
-{
- if (s1 == NULL || s2 == NULL)
- return (0);
- return (ft_strcmp(s1, s2) == 0);
-}
diff --git a/src/str/ft_striter.c b/src/str/ft_striter.c
deleted file mode 100644
index f410d24..0000000
--- a/src/str/ft_striter.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_striter.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:38:16 by cacharle #+# #+# */
-/* Updated: 2019/11/20 02:01:32 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-void ft_striter(char *s, void (*f)(char *))
-{
- if (s == NULL || f == NULL)
- return ;
- while (*s)
- (*f)(s++);
-}
diff --git a/src/str/ft_striteri.c b/src/str/ft_striteri.c
deleted file mode 100644
index 05f15d4..0000000
--- a/src/str/ft_striteri.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_striteri.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:33:09 by cacharle #+# #+# */
-/* Updated: 2019/11/20 02:01:41 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-void ft_striteri(char *s, void (*f)(unsigned int, char *))
-{
- unsigned int i;
-
- if (s == NULL || f == NULL)
- return ;
- i = 0;
- while (s[i])
- {
- (*f)(i, &s[i]);
- i++;
- }
-}
diff --git a/src/str/ft_strjoin.c b/src/str/ft_strjoin.c
deleted file mode 100644
index b65eaa2..0000000
--- a/src/str/ft_strjoin.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strjoin.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:35:26 by cacharle #+# #+# */
-/* Updated: 2020/02/14 03:40:39 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-char *ft_strjoin(char const *s1, char const *s2)
-{
- char *joined;
-
- if (s1 == NULL || s2 == NULL)
- return (NULL);
- if ((joined = (char*)malloc(sizeof(char)
- * (ft_strlen(s1) + ft_strlen(s2) + 1))) == NULL)
- return (NULL);
- return (ft_strcat(ft_strcpy(joined, s1), s2));
-}
diff --git a/src/str/ft_strjoinf.c b/src/str/ft_strjoinf.c
deleted file mode 100644
index 228a963..0000000
--- a/src/str/ft_strjoinf.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strjoinf.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/14 03:41:07 by cacharle #+# #+# */
-/* Updated: 2020/02/14 03:41:25 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include <stdlib.h>
-#include "libft.h"
-#include "libft_str.h"
-
-char *ft_strjoinf(char const *s1, char const *s2, t_ftstrjoinf_tag tag)
-{
- char *joined;
-
- if (s1 == NULL || s2 == NULL)
- return (NULL);
- if ((joined = ft_strjoin(s1, s2)) == NULL)
- return (NULL);
- if (tag == FT_STRJOINF_FST)
- free((void*)s1);
- else if (tag == FT_STRJOINF_SND)
- free((void*)s2);
- else if (tag == FT_STRJOINF_ALL)
- {
- free((void*)s1);
- free((void*)s2);
- }
- return (joined);
-}
diff --git a/src/str/ft_strlcat.c b/src/str/ft_strlcat.c
deleted file mode 100644
index ce7fa0b..0000000
--- a/src/str/ft_strlcat.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strlcat.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:31:37 by cacharle #+# #+# */
-/* Updated: 2019/11/20 03:31:08 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-size_t ft_strlcat(char *dst, const char *src, size_t size)
-{
- size_t i;
- size_t j;
- size_t dst_len;
- size_t src_len;
-
- dst_len = ft_strlen(dst);
- src_len = ft_strlen(src);
- if (size <= dst_len)
- return (src_len + size);
- i = 0;
- j = dst_len;
- while (src[i] && j < size - 1)
- dst[j++] = src[i++];
- dst[j] = '\0';
- return (dst_len + src_len);
-}
diff --git a/src/str/ft_strlcpy.c b/src/str/ft_strlcpy.c
deleted file mode 100644
index 6afb8f5..0000000
--- a/src/str/ft_strlcpy.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strlcpy.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 12:28:47 by cacharle #+# #+# */
-/* Updated: 2019/11/20 03:31:16 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-size_t ft_strlcpy(char *dst, const char *src, size_t size)
-{
- unsigned int i;
-
- if (dst == NULL || src == NULL)
- return (0);
- if (size == 0)
- return (ft_strlen(src));
- i = -1;
- while (++i < size - 1 && src[i] != '\0')
- dst[i] = src[i];
- dst[i] = '\0';
- return (ft_strlen(src));
-}
diff --git a/src/str/ft_strlen.c b/src/str/ft_strlen.c
deleted file mode 100644
index 0d593e1..0000000
--- a/src/str/ft_strlen.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strlen.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:32:48 by cacharle #+# #+# */
-/* Updated: 2020/01/17 11:13:43 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-size_t ft_strlen(const char *s)
-{
- unsigned long int *ptr;
- const char *cpy;
-
- ptr = (unsigned long int*)s;
- while (TRUE)
- {
- cpy = (const char*)ptr++;
- if (cpy[0] == '\0')
- return (cpy - s);
- if (cpy[1] == '\0')
- return (cpy + 1 - s);
- if (cpy[2] == '\0')
- return (cpy + 2 - s);
- if (cpy[3] == '\0')
- return (cpy + 3 - s);
- if (cpy[4] == '\0')
- return (cpy + 4 - s);
- if (cpy[5] == '\0')
- return (cpy + 5 - s);
- if (cpy[6] == '\0')
- return (cpy + 6 - s);
- if (cpy[7] == '\0')
- return (cpy + 7 - s);
- }
-}
diff --git a/src/str/ft_strmap.c b/src/str/ft_strmap.c
deleted file mode 100644
index 61d16f1..0000000
--- a/src/str/ft_strmap.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strmap.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:29:52 by cacharle #+# #+# */
-/* Updated: 2019/11/20 04:02:11 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-char *ft_strmap(char const *s, char (*f)(char))
-{
- size_t i;
- size_t len;
- char *mapped;
-
- if (s == NULL || f == NULL)
- return (NULL);
- len = ft_strlen(s);
- if ((mapped = (char*)malloc(sizeof(char) * (len + 1))) == NULL)
- return (NULL);
- i = 0;
- while (i < len)
- {
- mapped[i] = (*f)(s[i]);
- i++;
- }
- mapped[i] = '\0';
- return (mapped);
-}
diff --git a/src/str/ft_strmapi.c b/src/str/ft_strmapi.c
deleted file mode 100644
index 71d77e4..0000000
--- a/src/str/ft_strmapi.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strmapi.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:29:32 by cacharle #+# #+# */
-/* Updated: 2019/11/20 04:02:15 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-char *ft_strmapi(char *s, char (*f)(unsigned int, char))
-{
- size_t i;
- size_t len;
- char *mapped;
-
- if (s == NULL || f == NULL)
- return (NULL);
- len = ft_strlen(s);
- if ((mapped = (char*)malloc(sizeof(char) * (len + 1))) == NULL)
- return (NULL);
- i = 0;
- while (i < len)
- {
- mapped[i] = (*f)((unsigned int)i, s[i]);
- i++;
- }
- mapped[i] = '\0';
- return (mapped);
-}
diff --git a/src/str/ft_strncasecmp.c b/src/str/ft_strncasecmp.c
deleted file mode 100644
index aafdc8c..0000000
--- a/src/str/ft_strncasecmp.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strncasecmp.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/10 04:18:36 by cacharle #+# #+# */
-/* Updated: 2020/02/10 04:31:38 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_types.h"
-
-int ft_strncasecmp(const char *s1, const char *s2, size_t n)
-{
- size_t i;
-
- if (n == 0)
- return (0);
- i = 0;
- while (i + 1 < n && s1[i] && ft_tolower(s1[i]) == ft_tolower(s2[i]))
- i++;
- return ((t_ftuchar)ft_tolower(s1[i]) - (t_ftuchar)ft_tolower(s2[i]));
-}
diff --git a/src/str/ft_strncat.c b/src/str/ft_strncat.c
deleted file mode 100644
index d68db0a..0000000
--- a/src/str/ft_strncat.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strncat.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:28:37 by cacharle #+# #+# */
-/* Updated: 2019/11/20 03:33:22 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-char *ft_strncat(char *dest, const char *src, size_t n)
-{
- size_t i;
- size_t j;
-
- i = ft_strlen(dest);
- j = 0;
- while (j < n && src[j])
- {
- dest[i + j] = src[j];
- j++;
- }
- dest[i + j] = '\0';
- return (dest);
-}
diff --git a/src/str/ft_strncmp.c b/src/str/ft_strncmp.c
deleted file mode 100644
index caa052b..0000000
--- a/src/str/ft_strncmp.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strncmp.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:27:34 by cacharle #+# #+# */
-/* Updated: 2020/02/10 04:17:50 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-#include "libft_types.h"
-
-int ft_strncmp(const char *s1, const char *s2, size_t n)
-{
- size_t i;
-
- if (n == 0)
- return (0);
- i = 0;
- while (i + 1 < n && s1[i] == s2[i] && s1[i])
- i++;
- return ((t_ftuchar)s1[i] - (t_ftuchar)s2[i]);
-}
diff --git a/src/str/ft_strncpy.c b/src/str/ft_strncpy.c
deleted file mode 100644
index 07a4927..0000000
--- a/src/str/ft_strncpy.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strncpy.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:26:59 by cacharle #+# #+# */
-/* Updated: 2020/01/17 10:40:21 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-char *ft_strncpy(char *dest, const char *src, size_t n)
-{
- size_t len;
-
- len = ft_strlen(src);
- ft_memcpy(dest, src, n < len ? n : len);
- if (len < n)
- ft_bzero(dest + len, n - len);
- return (dest);
-}
diff --git a/src/str/ft_strndup.c b/src/str/ft_strndup.c
deleted file mode 100644
index 894ea4e..0000000
--- a/src/str/ft_strndup.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strndup.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/25 03:28:52 by cacharle #+# #+# */
-/* Updated: 2020/02/14 03:43:55 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-char *ft_strndup(const char *s1, size_t n)
-{
- char *clone;
-
- if ((clone = (char*)malloc(sizeof(char) * (n + 1))) == NULL)
- return (NULL);
- clone[n] = '\0';
- return (ft_strncpy(clone, s1, n));
-}
diff --git a/src/str/ft_strnequ.c b/src/str/ft_strnequ.c
deleted file mode 100644
index e242ee7..0000000
--- a/src/str/ft_strnequ.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strnequ.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:30:27 by cacharle #+# #+# */
-/* Updated: 2019/11/20 02:00:42 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-int ft_strnequ(char const *s1, char const *s2, size_t n)
-{
- if (s1 == NULL || s2 == NULL)
- return (0);
- return (ft_strncmp(s1, s2, n) == 0);
-}
diff --git a/src/str/ft_strnew.c b/src/str/ft_strnew.c
deleted file mode 100644
index 1bca6d5..0000000
--- a/src/str/ft_strnew.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strnew.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:17:34 by cacharle #+# #+# */
-/* Updated: 2019/11/20 03:16:14 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-char *ft_strnew(size_t size)
-{
- return ((char*)ft_calloc(size + 1, sizeof(char)));
-}
diff --git a/src/str/ft_strnlen.c b/src/str/ft_strnlen.c
deleted file mode 100644
index 5e1569c..0000000
--- a/src/str/ft_strnlen.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strnlen.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/10 05:21:04 by cacharle #+# #+# */
-/* Updated: 2020/02/10 05:23:23 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_str.h"
-
-/*
-** wrong implementation since it scans beyond maxlen
-*/
-
-size_t ft_strnlen(const char *s, size_t maxlen)
-{
- size_t len;
-
- len = ft_strlen(s);
- return (len > maxlen ? maxlen : len);
-}
diff --git a/src/str/ft_strnstr.c b/src/str/ft_strnstr.c
deleted file mode 100644
index 4995637..0000000
--- a/src/str/ft_strnstr.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strnstr.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:25:13 by cacharle #+# #+# */
-/* Updated: 2019/11/20 03:58:42 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-char *ft_strnstr(const char *haystack, const char *needle, size_t len)
-{
- size_t needle_len;
-
- needle_len = ft_strlen(needle);
- if (needle_len == 0)
- return ((char*)haystack);
- while (*haystack && len-- >= needle_len)
- {
- if (ft_strnequ(haystack, needle, needle_len))
- return ((char*)haystack);
- haystack++;
- }
- return (NULL);
-}
diff --git a/src/str/ft_strpbrk.c b/src/str/ft_strpbrk.c
deleted file mode 100644
index 753e4d9..0000000
--- a/src/str/ft_strpbrk.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strpbrk.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/10 04:39:29 by cacharle #+# #+# */
-/* Updated: 2020/02/10 04:54:13 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_str.h"
-
-char *ft_strpbrk(const char *s, const char *charset)
-{
- if (s == NULL || charset == NULL)
- return (NULL);
- while (*s && ft_strchr(charset, *s) == NULL)
- s++;
- if (*s == '\0')
- return (NULL);
- return ((char*)s);
-}
diff --git a/src/str/ft_strrchr.c b/src/str/ft_strrchr.c
deleted file mode 100644
index 4cedb76..0000000
--- a/src/str/ft_strrchr.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strrchr.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:26:24 by cacharle #+# #+# */
-/* Updated: 2019/11/21 18:46:27 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-char *ft_strrchr(const char *s, int c)
-{
- size_t i;
-
- i = ft_strlen(s) + 1;
- while (s[--i] != (char)c)
- if (i == 0)
- return (NULL);
- return ((char*)s + i);
-}
diff --git a/src/str/ft_strsep.c b/src/str/ft_strsep.c
deleted file mode 100644
index 2000706..0000000
--- a/src/str/ft_strsep.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strsep.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/10 04:44:11 by cacharle #+# #+# */
-/* Updated: 2020/02/10 04:51:15 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_str.h"
-
-char *ft_strsep(char **stringp, const char *delim)
-{
- char *tmp;
-
- if (stringp == NULL || *stringp == NULL || delim == NULL)
- return (NULL);
- tmp = ft_strpbrk(*stringp, delim);
- if (tmp == NULL)
- return (NULL);
- *tmp = '\0';
- *stringp = tmp;
- return (tmp);
-}
diff --git a/src/str/ft_strspn.c b/src/str/ft_strspn.c
deleted file mode 100644
index 81814e5..0000000
--- a/src/str/ft_strspn.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strspn.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/10 04:29:13 by cacharle #+# #+# */
-/* Updated: 2020/02/10 04:33:11 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_str.h"
-
-size_t ft_strspn(const char *s, const char *charset)
-{
- int i;
-
- i = 0;
- while (ft_strchr(charset, s[i]) != NULL)
- i++;
- return (i);
-}
diff --git a/src/str/ft_strstr.c b/src/str/ft_strstr.c
deleted file mode 100644
index 4d4d403..0000000
--- a/src/str/ft_strstr.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strstr.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:15:29 by cacharle #+# #+# */
-/* Updated: 2019/11/20 03:58:32 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-char *ft_strstr(const char *haystack, const char *needle)
-{
- size_t needle_len;
-
- needle_len = ft_strlen(needle);
- if (needle_len == 0)
- return ((char*)haystack);
- while (*haystack)
- {
- if (ft_strnequ(haystack, needle, needle_len))
- return ((char*)haystack);
- haystack++;
- }
- return (NULL);
-}
diff --git a/src/str/ft_strtol.c b/src/str/ft_strtol.c
deleted file mode 100644
index 82276d8..0000000
--- a/src/str/ft_strtol.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strtol.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/01/15 10:26:45 by cacharle #+# #+# */
-/* Updated: 2020/02/10 02:21:16 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-#define STRTOL_STD_BASE "0123456789abcdefghijklmnopqrstuvwxyz"
-
-static int st_strtol_handle_base(int base, const char **str)
-{
- if (base > 36)
- return (-1);
- if (base != 16 && base != 0)
- return (base);
- if (base == 16 && **str == '0' && (*str)[1] == 'x')
- {
- *str += 2;
- return (base);
- }
- if (**str == '0')
- {
- (*str)++;
- if (**str == 'x')
- {
- (*str)++;
- return (16);
- }
- else
- return (8);
- }
- return (10);
-}
-
-static long st_errno_return(int err)
-{
- errno = err;
- return (0);
-}
-
-/*
-** If there is no digits doesn't put str in endptr like the original,
-** instead it puts the address of the char after spaces and sign.
-** Too much lines and annoyance, I can't be bothered.
-*/
-
-long ft_strtol(const char *str, char **endptr, int base)
-{
- t_ftbool is_negative;
- long long nb;
- char base_str[37];
-
- while (ft_isspace(*str))
- str++;
- is_negative = *str == '-' ? TRUE : FALSE;
- if (*str == '-' || *str == '+')
- str++;
- if ((base = st_strtol_handle_base(base, &str)) == -1)
- return (st_errno_return(EINVAL));
- ft_strncpy(base_str, STRTOL_STD_BASE, base);
- base_str[base] = '\0';
- nb = 0;
- while (*str != '\0' && ft_strchr(base_str, *str) != NULL)
- {
- nb *= base;
- nb += ft_strchr(base_str, ft_tolower(*str++)) - base_str;
- if (((long)nb ^ (long)(nb / base)) < 0)
- errno = ERANGE;
- }
- if (endptr != NULL)
- *endptr = (char*)str;
- return (is_negative ? -nb : nb);
-}
diff --git a/src/str/ft_strtolower.c b/src/str/ft_strtolower.c
deleted file mode 100644
index 2eb34c2..0000000
--- a/src/str/ft_strtolower.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strtolower.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/10 04:10:01 by cacharle #+# #+# */
-/* Updated: 2020/02/10 04:12:21 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_str.h"
-#include "libft_ctype.h"
-
-char *ft_strtolower(char *s)
-{
- int i;
-
- if (s == NULL)
- return (NULL);
- i = -1;
- while (s[i])
- s[i] = ft_tolower(s[i]);
- return (s);
-}
diff --git a/src/str/ft_strtoupper.c b/src/str/ft_strtoupper.c
deleted file mode 100644
index 4a751d3..0000000
--- a/src/str/ft_strtoupper.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strtoupper.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/10 04:12:04 by cacharle #+# #+# */
-/* Updated: 2020/02/14 02:49:35 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_str.h"
-#include "libft_ctype.h"
-
-char *ft_strtoupper(char *s)
-{
- int i;
-
- if (s == NULL)
- return (NULL);
- i = -1;
- while (s[i])
- s[i] = ft_toupper(s[i]);
- return (s);
-}
diff --git a/src/str/ft_strtrim.c b/src/str/ft_strtrim.c
deleted file mode 100644
index aa48826..0000000
--- a/src/str/ft_strtrim.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_strtrim.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/07 10:24:16 by cacharle #+# #+# */
-/* Updated: 2019/11/20 03:52:58 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-char *ft_strtrim(char const *s1, char const *set)
-{
- size_t start;
- size_t len;
-
- if (s1 == NULL || set == NULL)
- return (NULL);
- start = 0;
- while (s1[start] && ft_strchr(set, s1[start]) != NULL)
- start++;
- len = ft_strlen(&s1[start]);
- if (len != 0)
- while (s1[start + len - 1]
- && ft_strchr(set, s1[start + len - 1]) != NULL)
- len--;
- return (ft_substr(s1, start, len));
-}
diff --git a/src/str/ft_substr.c b/src/str/ft_substr.c
deleted file mode 100644
index ad9c706..0000000
--- a/src/str/ft_substr.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* ft_substr.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2019/10/17 08:28:49 by cacharle #+# #+# */
-/* Updated: 2020/02/14 03:44:42 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft.h"
-
-char *ft_substr(char const *s, unsigned int start, size_t len)
-{
- char *sub;
-
- if (s == NULL)
- return (NULL);
- if ((sub = (char*)malloc(sizeof(char) * (len + 1))) == NULL)
- return (NULL);
- if (start > ft_strlen(s))
- return (sub);
- return (ft_strncpy(sub, s + start, len));
-}