diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-05-09 12:31:50 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-05-09 12:31:50 +0200 |
| commit | 02abc030a68cb2fdd2f21c96db830ec8cb9176ad (patch) | |
| tree | 0c2d67c94a3618639fc2cd29d8bc78820e41c254 /include/libft_algo.h | |
| parent | b5124347359833fcde33452978c62133879c6c9e (diff) | |
| parent | 3a2d19df9e509d0b015c786eb02f8315ff0ad91c (diff) | |
| download | libft-02abc030a68cb2fdd2f21c96db830ec8cb9176ad.tar.gz libft-02abc030a68cb2fdd2f21c96db830ec8cb9176ad.tar.bz2 libft-02abc030a68cb2fdd2f21c96db830ec8cb9176ad.zip | |
Merge remote-tracking branch 'origin/minishell'
Diffstat (limited to 'include/libft_algo.h')
| -rw-r--r-- | include/libft_algo.h | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/include/libft_algo.h b/include/libft_algo.h index 7223e7b..e859de5 100644 --- a/include/libft_algo.h +++ b/include/libft_algo.h @@ -1,24 +1,33 @@ /* ************************************************************************** */ /* */ /* ::: :::::::: */ -/* ft_algo.h :+: :+: :+: */ +/* libft_algo.h :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/01/19 07:22:57 by cacharle #+# #+# */ -/* Updated: 2020/02/10 05:58:26 by cacharle ### ########.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 # include <stdlib.h> -# include <stddef.h> # include "libft_mem.h" -# include "libft_types.h" +# include "libft_def.h" +# include "libft_str.h" -typedef int (*t_ftcompar_func)(const void*, const void*); +/* +** \brief Range struct +** \param lo Lower bound +** \param hi Upper bound +*/ typedef struct { @@ -26,6 +35,14 @@ typedef struct 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; @@ -33,15 +50,20 @@ struct s_merge_sorted_arrays void *right; }; +/* +** remove this horror +*/ + typedef struct s_ft_search_const { const void *key; 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); +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, |
