skeletton untested project

This commit is contained in:
thrieg 2025-12-11 06:18:16 +01:00
commit 6fc620e8f4
187 changed files with 6584 additions and 0 deletions

View file

@ -0,0 +1,58 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_cases_mandatory_two.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: thrieg <thrieg@student.42mulhouse.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/22 18:52:33 by thrieg #+# #+# */
/* Updated: 2025/02/16 19:07:58 by thrieg ### ########.fr */
/* */
/* ************************************************************************** */
#include "../libft.h"
#include "ft_printf.h"
int ft_case_x(t_vector *vec, va_list *args)
{
char *str_to_cat;
str_to_cat = ft_utoa_base(va_arg(*args, unsigned int), "0123456789abcdef");
if (!ft_vector_concat(vec, str_to_cat, ft_strlen(str_to_cat)))
return (free(str_to_cat), 0);
free(str_to_cat);
return (1);
}
int ft_case_upperx(t_vector *vec, va_list *args)
{
char *str_to_cat;
str_to_cat = ft_utoa_base(va_arg(*args, unsigned int), "0123456789ABCDEF");
if (!ft_vector_concat(vec, str_to_cat, ft_strlen(str_to_cat)))
return (free(str_to_cat), 0);
free(str_to_cat);
return (1);
}
int ft_case_d(t_vector *vec, va_list *args)
{
char *str_to_cat;
str_to_cat = ft_itoa(va_arg(*args, int));
if (!ft_vector_concat(vec, str_to_cat, ft_strlen(str_to_cat)))
return (free(str_to_cat), 0);
free(str_to_cat);
return (1);
}
int ft_case_i(t_vector *vec, va_list *args)
{
char *str_to_cat;
str_to_cat = ft_itoa(va_arg(*args, int));
if (!ft_vector_concat(vec, str_to_cat, ft_strlen(str_to_cat)))
return (free(str_to_cat), 0);
free(str_to_cat);
return (1);
}