From 9af2885d872de9c60b11159efe0685738031096d Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 14 Feb 2020 03:46:08 +0100 Subject: Added documentation for all functions and refactored ft_strjoin_free -> ft_strjoinf --- include/libft_ht.h | 4 ++-- include/libft_io.h | 4 +++- include/libft_str.h | 32 +++++++++++++++++++++----------- 3 files changed, 26 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/libft_ht.h b/include/libft_ht.h index 8551ddb..8eda59c 100644 --- a/include/libft_ht.h +++ b/include/libft_ht.h @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/01/31 10:36:09 by cacharle #+# #+# */ -/* Updated: 2020/01/31 10:41:24 by cacharle ### ########.fr */ +/* Updated: 2020/02/14 02:14:57 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -38,7 +38,7 @@ t_ftht *ft_htnew(t_ftsize size); void ft_htdestroy(t_ftht *ht, void (*del)(t_ftht_content*)); void ft_htdestroy_all(t_ftht *ht); void ft_htdestroy_key(t_ftht *ht); -t_ftht_content *ft_htget(t_ftht *ht, char *key); +void *ft_htget(t_ftht *ht, char *key); t_ftht_content *ft_htset(t_ftht *ht, char *key, void *value); void ft_htdelone(t_ftht *ht, char *key, void (*del)(t_ftht_content*)); diff --git a/include/libft_io.h b/include/libft_io.h index e1a2536..76bce17 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/01/31 10:35:48 by cacharle ### ########.fr */ +/* Updated: 2020/02/14 02:23:43 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -27,6 +27,8 @@ 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); + # ifndef FTNL_BUFFER_SIZE # define FTNL_BUFFER_SIZE 32 # endif diff --git a/include/libft_str.h b/include/libft_str.h index e3faeab..582ef00 100644 --- a/include/libft_str.h +++ b/include/libft_str.h @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/01/31 10:39:22 by cacharle #+# #+# */ -/* Updated: 2020/02/10 05:24:00 by cacharle ### ########.fr */ +/* Updated: 2020/02/14 03:45:15 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -16,6 +16,13 @@ # include # include "libft_ctype.h" +typedef enum +{ + FT_STRJOINF_FST, + FT_STRJOINF_SND, + FT_STRJOINF_ALL +} t_ftstrjoinf_tag; + /* ** std */ @@ -45,13 +52,12 @@ void ft_striter(char *s, void (*f)(char *)); void ft_striteri(char *s, void (*f)(unsigned int, char *)); char *ft_substr(char const *s, unsigned int start, size_t len); char *ft_strjoin(char const *s1, char const *s2); +char *ft_strjoinf(char const *s1, char const *s2, t_ftstrjoinf_tag tag); char *ft_strtrim(char const *s1, char const *set); char **ft_split(char const *s, char c); -char *ft_strjoin_free(char const *s1, char const *s2, int free_nb); -char *ft_strjoin_free_snd(char const *s1, char const *s2); int ft_strcount(char *str, char c); char *ft_itoa(int n); -int ft_strict_atoi(const char *s); +int ft_atoi_strict(const char *s); long ft_strtol(const char *s, char **endptr, int base); int ft_strcasecmp(const char *s1, const char *s2); int ft_strncasecmp(const char *s1, const char *s2, size_t n); @@ -60,17 +66,21 @@ size_t ft_strcspn(const char *s, const char *charset); char *ft_strpbrk(const char *s, const char *charset); char *ft_strsep(char **stringp, const char *delim); size_t ft_strnlen(const char *s, size_t maxlen); +char *ft_strmap(char const *s, char (*f)(char)); +char *ft_strmapi(char *s, char (*f)(unsigned int, char)); +int ft_strequ(char const *s1, char const *s2); +int ft_strnequ(char const *s1, char const *s2, size_t n); +char *ft_strtolower(char *s); +char *ft_strtoupper(char *s); /* ** bloat ? */ -char *ft_strnew(size_t size); -void ft_strdel(char **as); -void ft_strclr(char *s); -char *ft_strmap(char const *s, char (*f)(char)); -char *ft_strmapi(char *s, char (*f)(unsigned int, char)); -int ft_strequ(char const *s1, char const *s2); -int ft_strnequ(char const *s1, char const *s2, size_t n); +/* +** char *ft_strnew(size_t size); +** void ft_strdel(char **as); +** void ft_strclr(char *s); +*/ #endif -- cgit