diff --git a/Makefile b/Makefile index 66af7c3..dac1df4 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # By: adjoly +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2023/11/01 11:03:22 by adjoly #+# #+# # -# Updated: 2023/11/03 19:10:18 by adjoly ### ########.fr # +# Updated: 2023/11/03 23:05:37 by adjoly ### ########.fr # # # # **************************************************************************** # @@ -23,6 +23,7 @@ SRCS = ft_atoi.c \ ft_putchar_fd.c \ ft_putnbr_fd.c \ ft_putstr_fd.c \ + ft_strdup.c \ ft_memcpy.c \ ft_memset.c \ ft_strlcpy.c \ diff --git a/ft_atoi.o b/ft_atoi.o new file mode 100644 index 0000000..e244f89 Binary files /dev/null and b/ft_atoi.o differ diff --git a/ft_bzero.o b/ft_bzero.o new file mode 100644 index 0000000..6589a4d Binary files /dev/null and b/ft_bzero.o differ diff --git a/ft_isalnum.o b/ft_isalnum.o new file mode 100644 index 0000000..4d4eaf4 Binary files /dev/null and b/ft_isalnum.o differ diff --git a/ft_isalpha.o b/ft_isalpha.o new file mode 100644 index 0000000..6daee9a Binary files /dev/null and b/ft_isalpha.o differ diff --git a/ft_isascii.o b/ft_isascii.o new file mode 100644 index 0000000..57e0977 Binary files /dev/null and b/ft_isascii.o differ diff --git a/ft_isdigit.o b/ft_isdigit.o new file mode 100644 index 0000000..1e7eb73 Binary files /dev/null and b/ft_isdigit.o differ diff --git a/ft_memcpy.o b/ft_memcpy.o new file mode 100644 index 0000000..50a0c4e Binary files /dev/null and b/ft_memcpy.o differ diff --git a/ft_memset.o b/ft_memset.o new file mode 100644 index 0000000..d5aad91 Binary files /dev/null and b/ft_memset.o differ diff --git a/ft_putchar_fd.o b/ft_putchar_fd.o new file mode 100644 index 0000000..371817e Binary files /dev/null and b/ft_putchar_fd.o differ diff --git a/ft_putnbr_fd.o b/ft_putnbr_fd.o new file mode 100644 index 0000000..4a33633 Binary files /dev/null and b/ft_putnbr_fd.o differ diff --git a/ft_putstr_fd.o b/ft_putstr_fd.o new file mode 100644 index 0000000..afc7299 Binary files /dev/null and b/ft_putstr_fd.o differ diff --git a/ft_strdup.c b/ft_strdup.c new file mode 100644 index 0000000..9c194cf --- /dev/null +++ b/ft_strdup.c @@ -0,0 +1,33 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strdup.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/11/03 22:57:39 by adjoly #+# #+# */ +/* Updated: 2023/11/03 23:08:23 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +char *ft_strdup(const char *s) +{ + int i; + char *result; + int len; + + i = 0; + len = ft_strlen(s); + result = malloc(sizeof(char) * len); + if (result == NULL) + return (NULL); + while (s[i]) + { + result[i] = s[i]; + i++; + } + result[i] = '\0'; + return (result); +} diff --git a/ft_strdup.o b/ft_strdup.o new file mode 100644 index 0000000..84dbba1 Binary files /dev/null and b/ft_strdup.o differ diff --git a/ft_strlcpy.o b/ft_strlcpy.o new file mode 100644 index 0000000..8554cc0 Binary files /dev/null and b/ft_strlcpy.o differ diff --git a/ft_strlen.o b/ft_strlen.o new file mode 100644 index 0000000..2c20529 Binary files /dev/null and b/ft_strlen.o differ diff --git a/ft_substr.o b/ft_substr.o new file mode 100644 index 0000000..bfe6c07 Binary files /dev/null and b/ft_substr.o differ diff --git a/ft_tolower.o b/ft_tolower.o new file mode 100644 index 0000000..39f8ee2 Binary files /dev/null and b/ft_tolower.o differ diff --git a/ft_toupper.o b/ft_toupper.o new file mode 100644 index 0000000..9f0e61d Binary files /dev/null and b/ft_toupper.o differ diff --git a/libft.a b/libft.a new file mode 100644 index 0000000..c2d219b Binary files /dev/null and b/libft.a differ diff --git a/libft.h b/libft.h index 233bd10..66100c7 100644 --- a/libft.h +++ b/libft.h @@ -6,7 +6,7 @@ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/11/01 10:06:03 by adjoly #+# #+# */ -/* Updated: 2023/11/03 15:57:10 by adjoly ### ########.fr */ +/* Updated: 2023/11/03 23:06:30 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ @@ -29,6 +29,7 @@ void *ft_memmove(void *dest, const void *src, size_t n); void *ft_memcpy(void *dest, const void *src, size_t n); void ft_putchar_fd(char c, int fd); void ft_putnbr_fd(int n, int fd); +char *ft_strdup(const char *s); void ft_putstr_fd(char *s, int fd); char *ft_strchr(const char *s, int c); size_t ft_strlcpy(char *dst, const char *src, size_t size);