」 feat(builtins/export): export possibly done

This commit is contained in:
yosyo
2024-07-11 19:08:49 +02:00
parent 54e01e9bc3
commit 310f26ef80
6 changed files with 135 additions and 42 deletions

View File

@ -6,7 +6,7 @@
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/30 23:06:24 by mmoussou #+# #+# */
/* Updated: 2024/05/25 14:24:29 by adjoly ### ########.fr */
/* Updated: 2024/07/08 14:45:20 by mmoussou ### ########.fr */
/* */
/* ************************************************************************** */
@ -57,6 +57,7 @@ char *ft_ltoa(long long n);
/* STRINGS */
uint ft_strlen(char const *s);
uint ft_vstrlen(int len, ...);
char *ft_strchr(const char *s, int c);
char *ft_strrchr(const char *s, int c);
int ft_strcmp(const char *s1, const char *s2);

View File

@ -6,7 +6,7 @@
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/31 12:42:36 by mmoussou #+# #+# */
/* Updated: 2024/04/30 11:03:32 by mmoussou ### ########.fr */
/* Updated: 2024/07/11 15:25:29 by mmoussou ### ########.fr */
/* */
/* ************************************************************************** */
@ -14,10 +14,27 @@
uint ft_strlen(const char *s)
{
const char *endptr;
uint result;
endptr = s;
while (*endptr)
endptr++;
return (endptr - s);
result = 0;
if (!s)
return (0);
while (s[result])
result++;
return (result);
}
uint ft_vstrlen(int len, ...)
{
va_list argsl;
int total_len;
va_start(argsl, len);
total_len = 0;
while (len)
{
total_len += ft_strlen(va_arg(argsl, const char *));
len--;
}
return (total_len);
}