GNL now using libft functions

This commit is contained in:
2025-11-16 20:34:13 +01:00
parent 06d5582e88
commit a7dbd94e42
6 changed files with 14 additions and 82 deletions

View File

@@ -3,10 +3,10 @@
/* ::: :::::::: */
/* get_next_line.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aortigos <aortigos@student.42malaga.com> +#+ +:+ +#+ */
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/15 18:52:24 by aortigos #+# #+# */
/* Updated: 2024/03/15 18:52:26 by aortigos ### ########.fr */
/* Updated: 2025/11/16 20:32:59 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
@@ -16,6 +16,7 @@
# include <unistd.h>
# include <stdio.h>
# include <stdlib.h>
# include "../libft/libft.h"
# ifndef BUFFER_SIZE
# define BUFFER_SIZE 10000
@@ -23,9 +24,6 @@
char *get_next_line(int fd);
char *ft_read_to_left_str(int fd, char *left_str);
size_t ft_strlen(char *s);
char *ft_strchr(char *s, int c);
char *ft_strjoin(char *left_str, char *buff);
char *ft_get_line(char *left_str);
char *ft_new_left_str(char *left_str);

View File

@@ -3,49 +3,15 @@
/* ::: :::::::: */
/* get_next_line_utils.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aortigos <aortigos@student.42malaga.com> +#+ +:+ +#+ */
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/15 18:37:57 by aortigos #+# #+# */
/* Updated: 2024/03/15 18:56:09 by aortigos ### ########.fr */
/* Updated: 2025/11/16 20:33:54 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
#include "get_next_line.h"
size_t ft_strlen(char *s)
{
int i;
i = 0;
if (!s)
return (0);
while (s[i] != '\0')
{
i++;
}
return (i);
}
char *ft_strchr(char *s, int c)
{
int i;
i = 0;
if (!s)
return (0);
if (c == '\0')
return ((char *)&s[ft_strlen(s)]);
while (s[i] != '\0')
{
if (s[i] == (char) c)
{
return ((char *)&s[i]);
}
i++;
}
return (0);
}
char *ft_strjoin(char *left_str, char *buff)
{
size_t i;

View File

@@ -17,8 +17,6 @@ SRC = ft_strlen.c ft_strlcpy.c ft_strlcat.c ft_strchr.c \
ft_memfree.c ft_issign.c ft_isspace.c ft_iabs.c \
ft_strcmp.c
OBJ = $(SRC:.c=.o)
CC = cc