55 lines
1.3 KiB
C
55 lines
1.3 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_split_utils.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: nalebrun <nalebrun@student.s19.be> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2025/01/21 11:31:30 by nalebrun #+# #+# */
|
|
/* Updated: 2025/01/21 11:31:30 by nalebrun ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "../../libft.h"
|
|
|
|
int is_charset(char c, char *set)
|
|
{
|
|
int i;
|
|
|
|
i = 0;
|
|
while (set[i])
|
|
{
|
|
if (c == set[i])
|
|
return (1);
|
|
i++;
|
|
}
|
|
return (0);
|
|
}
|
|
|
|
void free_tab(char **tab)
|
|
{
|
|
int i;
|
|
|
|
i = 0;
|
|
while (tab[i])
|
|
{
|
|
free(tab[i]);
|
|
i++;
|
|
}
|
|
free(tab);
|
|
}
|
|
|
|
char **free_all(char **tab, int count)
|
|
{
|
|
int i;
|
|
|
|
i = 0;
|
|
while (i < count)
|
|
{
|
|
free(tab[i]);
|
|
i++;
|
|
}
|
|
free(tab);
|
|
return (NULL);
|
|
}
|