From 8bba48a8326d9e7a703c3f6f6ab70b8a8a393473 Mon Sep 17 00:00:00 2001 From: Charles Date: Sat, 28 Mar 2020 12:07:44 +0100 Subject: Added ft_strjoin3 --- src/str/ft_strjoin3.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/str/ft_strjoin3.c (limited to 'src/str') diff --git a/src/str/ft_strjoin3.c b/src/str/ft_strjoin3.c new file mode 100644 index 0000000..69de060 --- /dev/null +++ b/src/str/ft_strjoin3.c @@ -0,0 +1,16 @@ +#include "libft.h" + +char *ft_strjoin3(char const *s1, char const *s2, char const *s3) +{ + char *joined; + + if (s1 == NULL || s2 == NULL || s3 == NULL) + return (NULL); + if ((joined = (char*)malloc(sizeof(char) + * (ft_strlen(s1) + ft_strlen(s2) + ft_strlen(s3) + 1))) == NULL) + return (NULL); + ft_strcpy(joined, s1); + ft_strcat(joined, s2); + ft_strcat(joined, s3); + return (joined); +} -- cgit From 40ed37c023627726a5c9c6928284e9f042dc0fa4 Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 30 Mar 2020 16:38:30 +0200 Subject: Added Doxygen config file --- src/str/ft_atoi.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/str') diff --git a/src/str/ft_atoi.c b/src/str/ft_atoi.c index fa31407..1b9bfc4 100644 --- a/src/str/ft_atoi.c +++ b/src/str/ft_atoi.c @@ -12,6 +12,10 @@ #include "libft.h" +/** +** Convert a string to an int +*/ + int ft_atoi(const char *str) { return ((int)ft_strtol(str, (char**)NULL, 10)); -- cgit From 9316f2063255bd4a0abd5c38d4c065969a8980bb Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 1 Apr 2020 18:10:36 +0200 Subject: Norm compliant comment format, dirty script for doxygen comments --- src/str/ft_atoi.c | 2 +- src/str/ft_strjoin3.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'src/str') diff --git a/src/str/ft_atoi.c b/src/str/ft_atoi.c index 1b9bfc4..d6fa5bb 100644 --- a/src/str/ft_atoi.c +++ b/src/str/ft_atoi.c @@ -12,7 +12,7 @@ #include "libft.h" -/** +/* ** Convert a string to an int */ diff --git a/src/str/ft_strjoin3.c b/src/str/ft_strjoin3.c index 69de060..e5e5530 100644 --- a/src/str/ft_strjoin3.c +++ b/src/str/ft_strjoin3.c @@ -1,5 +1,25 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strjoin3.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: charles +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/04/01 18:00:49 by charles #+# #+# */ +/* Updated: 2020/04/01 18:01:43 by charles ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" +/* +** \brief Join 3 strings in a new malloc'd one +** \param s1 String 1 +** \param s2 String 2 +** \param s3 String 3 +** \return The joined string +*/ + char *ft_strjoin3(char const *s1, char const *s2, char const *s3) { char *joined; -- cgit