From d2feec1f97e9f8f201e56ad33662bb663c328a0a Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 3 Apr 2020 07:19:25 +0200 Subject: Changing hash table del function to regular one with a first order internal function, removing a few typedef to instead use standard types --- include/libft_algo.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'include/libft_algo.h') diff --git a/include/libft_algo.h b/include/libft_algo.h index 7223e7b..04191e6 100644 --- a/include/libft_algo.h +++ b/include/libft_algo.h @@ -1,12 +1,12 @@ /* ************************************************************************** */ /* */ /* ::: :::::::: */ -/* ft_algo.h :+: :+: :+: */ +/* libft_algo.h :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/01/19 07:22:57 by cacharle #+# #+# */ -/* Updated: 2020/02/10 05:58:26 by cacharle ### ########.fr */ +/* Updated: 2020/04/03 07:05:04 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,11 +14,8 @@ # define LIBFT_ALGO_H # include -# include # include "libft_mem.h" -# include "libft_types.h" - -typedef int (*t_ftcompar_func)(const void*, const void*); +# include "libft_def.h" typedef struct { @@ -39,7 +36,7 @@ typedef struct s_ft_search_const t_ftcompar_func compar; } t_ftsearch_const; -t_ftbool ft_is_set(void *base, size_t nel, size_t width, +bool ft_is_set(void *base, size_t nel, size_t width, t_ftcompar_func compar); int ft_compar_int(const void *a, const void *b); void ft_qsort(void *base, size_t nel, size_t width, -- cgit From 51b845a6a202b50966f50e166cfb11bcbdccbe33 Mon Sep 17 00:00:00 2001 From: Charles Date: Sat, 4 Apr 2020 15:58:24 +0200 Subject: Added ft_strsjoin, ft_strsjoinf, ft_compar_str, ft_vecsort, ft_vecpush_safe --- include/libft_algo.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/libft_algo.h') diff --git a/include/libft_algo.h b/include/libft_algo.h index 04191e6..e726d1f 100644 --- a/include/libft_algo.h +++ b/include/libft_algo.h @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/01/19 07:22:57 by cacharle #+# #+# */ -/* Updated: 2020/04/03 07:05:04 by charles ### ########.fr */ +/* Updated: 2020/04/04 15:46:10 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -16,6 +16,7 @@ # include # include "libft_mem.h" # include "libft_def.h" +# include "libft_str.h" typedef struct { @@ -39,6 +40,7 @@ typedef struct s_ft_search_const bool ft_is_set(void *base, size_t nel, size_t width, t_ftcompar_func compar); int ft_compar_int(const void *a, const void *b); +int ft_compar_str(const void *s1_p, const void *s2_p); void ft_qsort(void *base, size_t nel, size_t width, t_ftcompar_func compar); int ft_mergesort(void *base, size_t nel, size_t width, -- cgit From 65cf641e9533b190db870d0cc46f2f852239ebf6 Mon Sep 17 00:00:00 2001 From: Charles Date: Sat, 4 Apr 2020 23:36:19 +0200 Subject: Added test for ft_strsjoin, ft_strsjoinf, ft_vecpush_safe, Added doc for algo functions, tested functions --- include/libft_algo.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'include/libft_algo.h') diff --git a/include/libft_algo.h b/include/libft_algo.h index e726d1f..e859de5 100644 --- a/include/libft_algo.h +++ b/include/libft_algo.h @@ -6,10 +6,15 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/01/19 07:22:57 by cacharle #+# #+# */ -/* Updated: 2020/04/04 15:46:10 by charles ### ########.fr */ +/* Updated: 2020/04/04 23:33:51 by charles ### ########.fr */ /* */ /* ************************************************************************** */ +/* +** \file libft_algo.h +** \brief Algorithms +*/ + #ifndef LIBFT_ALGO_H # define LIBFT_ALGO_H @@ -18,12 +23,26 @@ # include "libft_def.h" # include "libft_str.h" +/* +** \brief Range struct +** \param lo Lower bound +** \param hi Upper bound +*/ + typedef struct { int lo; int hi; } t_ftrange; +/* +** \brief Merge sort consts struct +** \param base Array to sort +** \param left Left subarray +** \param right Right subarray +** \note Only used internaly by ft_mergesort +*/ + struct s_merge_sorted_arrays { void *base; @@ -31,6 +50,10 @@ struct s_merge_sorted_arrays void *right; }; +/* +** remove this horror +*/ + typedef struct s_ft_search_const { const void *key; -- cgit