mirror of
https://github.com/KeyZox71/ft_minipowershell.git
synced 2026-11-29 22:51:44 +01:00
「✨」 feat(builtins/export): export possibly done
This commit is contained in:
1 parent
54e01e9bc3
commit
310f26ef80
6 files changed
+135
-42
No files matched your search
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
Reference in new issue
Block a user