From 8131a5d26441c5152ab151b4bb49b561e5ca6e81 Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 31 Jan 2020 10:44:30 +0100 Subject: hash table unit testing, norming --- include/libft_io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/libft_io.h') diff --git a/include/libft_io.h b/include/libft_io.h index 76bce17..418b230 100644 --- a/include/libft_io.h +++ b/include/libft_io.h @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/01/31 10:35:43 by cacharle #+# #+# */ -/* Updated: 2020/02/14 02:23:43 by cacharle ### ########.fr */ +/* Updated: 2020/02/28 12:09:11 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ -- cgit From d3fb362c2e0b83cc9754a05ae5bc4a68a5f9269d Mon Sep 17 00:00:00 2001 From: Charles Date: Sun, 10 May 2020 22:01:15 +0200 Subject: Added ft_strtof, ft_atof, ft_vectobuf32, ft_split_len (not tested) --- include/libft_io.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'include/libft_io.h') diff --git a/include/libft_io.h b/include/libft_io.h index 418b230..e59d70c 100644 --- a/include/libft_io.h +++ b/include/libft_io.h @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/01/31 10:35:43 by cacharle #+# #+# */ -/* Updated: 2020/02/28 12:09:11 by cacharle ### ########.fr */ +/* Updated: 2020/05/09 11:16:36 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -29,18 +29,18 @@ void ft_putnbr_fd(int n, int fd); char ft_getchar(void); -# ifndef FTNL_BUFFER_SIZE -# define FTNL_BUFFER_SIZE 32 +# ifndef FT_GETLINE_BUFFER_SIZE +# define FT_GETLINE_BUFFER_SIZE 32 # endif -# define FTNL_STATUS_LINE 1 -# define FTNL_STATUS_EOF 0 -# define FTNL_STATUS_ERROR -1 +# define FT_LINE 1 +# define FT_EOF 0 +# define FT_ERROR -1 /* -** get_next_line.c +** getline.c */ -int ft_next_line(int fd, char **line); +int ft_getline(int fd, char **line); #endif -- cgit From a4b9cda7d6733f2b077f8586e3b3e69351e7dfba Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 11 May 2020 10:54:58 +0200 Subject: Added ft_getfile --- include/libft_io.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include/libft_io.h') diff --git a/include/libft_io.h b/include/libft_io.h index e59d70c..ce3c632 100644 --- a/include/libft_io.h +++ b/include/libft_io.h @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/01/31 10:35:43 by cacharle #+# #+# */ -/* Updated: 2020/05/09 11:16:36 by charles ### ########.fr */ +/* Updated: 2020/05/11 09:57:42 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -29,8 +29,14 @@ void ft_putnbr_fd(int n, int fd); char ft_getchar(void); +# ifndef FT_GETFILE_BUFFER_SIZE +# define FT_GETFILE_BUFFER_SIZE 64 +# endif + +char *ft_getfile(int fd); + # ifndef FT_GETLINE_BUFFER_SIZE -# define FT_GETLINE_BUFFER_SIZE 32 +# define FT_GETLINE_BUFFER_SIZE 64 # endif # define FT_LINE 1 -- cgit From b9f000a80cbba38b8f21c9737a42f07573ec7b91 Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 11 May 2020 16:14:38 +0200 Subject: Moved util/ft_split* in str, Added ft_memjoin and ft_memjoinf1, Modified ft_getfile so that it can read non-ascii file --- include/libft_io.h | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'include/libft_io.h') diff --git a/include/libft_io.h b/include/libft_io.h index ce3c632..b64603b 100644 --- a/include/libft_io.h +++ b/include/libft_io.h @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/01/31 10:35:43 by cacharle #+# #+# */ -/* Updated: 2020/05/11 09:57:42 by charles ### ########.fr */ +/* Updated: 2020/05/11 16:12:41 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -17,23 +17,30 @@ # include # include # include "libft.h" +# include "libft_def.h" -void ft_putendl(char *s); -void ft_putchar(char c); -void ft_putstr(char const *s); -void ft_putnbr(int n); -void ft_putchar_fd(char c, int fd); -void ft_putstr_fd(char *s, int fd); -void ft_putendl_fd(char *s, int fd); -void ft_putnbr_fd(int n, int fd); +void ft_putendl(char *s); +void ft_putchar(char c); +void ft_putstr(char const *s); +void ft_putnbr(int n); +void ft_putchar_fd(char c, int fd); +void ft_putstr_fd(char *s, int fd); +void ft_putendl_fd(char *s, int fd); +void ft_putnbr_fd(int n, int fd); -char ft_getchar(void); +char ft_getchar(void); # ifndef FT_GETFILE_BUFFER_SIZE # define FT_GETFILE_BUFFER_SIZE 64 # endif -char *ft_getfile(int fd); +typedef struct s_ftmem +{ + void *data; + size_t size; +} t_ftmem; + +int ft_getfile(int fd, t_ftmem *mem); # ifndef FT_GETLINE_BUFFER_SIZE # define FT_GETLINE_BUFFER_SIZE 64 @@ -47,6 +54,6 @@ char *ft_getfile(int fd); ** getline.c */ -int ft_getline(int fd, char **line); +int ft_getline(int fd, char **line); #endif -- cgit From 966eb29634a84496e0851ef2b5a7d64f413d33ed Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 12 May 2020 19:10:14 +0200 Subject: Added ft_veciter_ret --- include/libft_io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/libft_io.h') diff --git a/include/libft_io.h b/include/libft_io.h index b64603b..faeade4 100644 --- a/include/libft_io.h +++ b/include/libft_io.h @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/01/31 10:35:43 by cacharle #+# #+# */ -/* Updated: 2020/05/11 16:12:41 by charles ### ########.fr */ +/* Updated: 2020/05/12 18:00:55 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -43,7 +43,7 @@ typedef struct s_ftmem int ft_getfile(int fd, t_ftmem *mem); # ifndef FT_GETLINE_BUFFER_SIZE -# define FT_GETLINE_BUFFER_SIZE 64 +# define FT_GETLINE_BUFFER_SIZE 1 # endif # define FT_LINE 1 -- cgit From d4aeabeac0a8bd1665b14aacf487df17198c1ab9 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 12 May 2020 21:40:41 +0200 Subject: Fixing/refactoring ft_getline, fixed/normed ft_memchr, added ft_strmove --- include/libft_io.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include/libft_io.h') diff --git a/include/libft_io.h b/include/libft_io.h index faeade4..ab40875 100644 --- a/include/libft_io.h +++ b/include/libft_io.h @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/01/31 10:35:43 by cacharle #+# #+# */ -/* Updated: 2020/05/12 18:00:55 by charles ### ########.fr */ +/* Updated: 2020/05/12 20:36:36 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -33,6 +33,9 @@ char ft_getchar(void); # ifndef FT_GETFILE_BUFFER_SIZE # define FT_GETFILE_BUFFER_SIZE 64 # endif +# if FT_GETFILE_BUFFER_SIZE <= 0 +# error "FT_GETFILE_BUFFER_SIZE must be > 0" +# endif typedef struct s_ftmem { @@ -43,7 +46,10 @@ typedef struct s_ftmem int ft_getfile(int fd, t_ftmem *mem); # ifndef FT_GETLINE_BUFFER_SIZE -# define FT_GETLINE_BUFFER_SIZE 1 +# define FT_GETLINE_BUFFER_SIZE 64 +# endif +# if FT_GETLINE_BUFFER_SIZE <= 0 +# error "FT_GETLINE_BUFFER_SIZE must be > 0" # endif # define FT_LINE 1 -- cgit