From a5b068767440327f910dfa815be12ff4c0d94309 Mon Sep 17 00:00:00 2001 From: Charles Date: Sun, 19 Jan 2020 08:30:03 +0100 Subject: Added algo functions ft_qsort, ft_is_set, ft_memswap, ft_compar_int --- include/ft_algo.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 include/ft_algo.h (limited to 'include/ft_algo.h') diff --git a/include/ft_algo.h b/include/ft_algo.h new file mode 100644 index 0000000..4175cb5 --- /dev/null +++ b/include/ft_algo.h @@ -0,0 +1,32 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_algo.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/01/19 07:22:57 by cacharle #+# #+# */ +/* Updated: 2020/01/19 08:27:44 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef FT_ALGO_H +# define FT_ALGO_H + +typedef int t_bool; + +typedef struct +{ + int lo; + int hi; +} t_ftrange; + +typedef int (*t_ftcompar_func)(const void*, const void*); + +t_bool ft_is_set(void *base, size_t nel, size_t width, + t_ftcompar_func compar); +void ft_qsort(void *base, size_t nel, size_t width, + t_ftcompar_func compar); +int ft_compar_int(const void *a, const void *b); + +#endif -- cgit