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 --- src/algo/ft_compar_str.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/algo/ft_compar_str.c (limited to 'src/algo/ft_compar_str.c') diff --git a/src/algo/ft_compar_str.c b/src/algo/ft_compar_str.c new file mode 100644 index 0000000..0d3e6ff --- /dev/null +++ b/src/algo/ft_compar_str.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_compar_str.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: charles +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/04/04 15:44:24 by charles #+# #+# */ +/* Updated: 2020/04/04 15:46:28 by charles ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft_algo.h" + +int ft_compar_str(const void *s1_p, const void *s2_p) +{ + return (ft_strcmp(*(const char**)s1_p, *(const char**)s2_p)); +} -- 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 --- src/algo/ft_compar_str.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/algo/ft_compar_str.c') diff --git a/src/algo/ft_compar_str.c b/src/algo/ft_compar_str.c index 0d3e6ff..6749ab0 100644 --- a/src/algo/ft_compar_str.c +++ b/src/algo/ft_compar_str.c @@ -6,12 +6,19 @@ /* By: charles +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/04 15:44:24 by charles #+# #+# */ -/* Updated: 2020/04/04 15:46:28 by charles ### ########.fr */ +/* Updated: 2020/04/04 22:31:15 by charles ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft_algo.h" +/* +** \brief String comparison function +** \param s1_p Pointer to first string +** \param s2_p Pointer to second string +** \return `strcmp` of both strings +*/ + int ft_compar_str(const void *s1_p, const void *s2_p) { return (ft_strcmp(*(const char**)s1_p, *(const char**)s2_p)); -- cgit