drawio done and at norm

This commit is contained in:
Nathan Lebrun
2025-01-29 10:05:16 +01:00
parent 7f144ab089
commit 9bce0bf9cb
8 changed files with 210 additions and 126 deletions

View File

@@ -64,6 +64,7 @@ void ft_bzero(void *s, size_t n);
char **ft_split(const char *s, char *set);
char **ft_split_keep(const char *s, char *set);
char *ft_tabstr(char **tab);
int is_charset(char c, char *set);
void free_tab(char **tab);
char **free_all(char **tab, int count);

View File

@@ -0,0 +1,36 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_tabstr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nalebrun <nalebrun@student.s19.be> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/01/29 08:54:00 by nalebrun #+# #+# */
/* Updated: 2025/01/29 08:54:00 by nalebrun ### ########.fr */
/* */
/* ************************************************************************** */
#include "../../libft.h"
char *ft_tabstr(char **tab)
{
int i;
int alloc_count;
char *out;
char *tmp;
i = -1;
alloc_count = 0;
while (tab[++i])
alloc_count += ft_strlen(tab[i]) + 1;
i = 0;
out = tab[0];
while (tab[++i])
{
tmp = out;
out = ft_sprintf("%s %s", out, tab[i]);
free(tmp);
}
out[alloc_count] = 0;
return (out);
}