aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libft_ht.h6
-rw-r--r--include/libft_lst.h19
2 files changed, 14 insertions, 11 deletions
diff --git a/include/libft_ht.h b/include/libft_ht.h
index 8eda59c..0873e7d 100644
--- a/include/libft_ht.h
+++ b/include/libft_ht.h
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/31 10:36:09 by cacharle #+# #+# */
-/* Updated: 2020/02/14 02:14:57 by cacharle ### ########.fr */
+/* Updated: 2020/02/16 02:23:06 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -50,7 +50,7 @@ t_ftht_content *ft_htcontent_new(char *key, void *value);
*/
void ft_inter_htdelcontent_key(t_ftht_content *content);
-t_ftbool ft_inter_htkey_equal(char *ref_key,
- t_ftht_content *content);
+int ft_inter_htkey_equal(const void *ref_key,
+ const void *content);
#endif
diff --git a/include/libft_lst.h b/include/libft_lst.h
index d092e59..f92067d 100644
--- a/include/libft_lst.h
+++ b/include/libft_lst.h
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/31 10:36:39 by cacharle #+# #+# */
-/* Updated: 2020/02/10 02:12:26 by cacharle ### ########.fr */
+/* Updated: 2020/02/16 02:15:26 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -15,6 +15,7 @@
# include <stdlib.h>
# include "libft_types.h"
+# include "libft_algo.h"
typedef struct s_ftlst
{
@@ -22,6 +23,8 @@ typedef struct s_ftlst
struct s_ftlst *next;
} t_ftlst;
+typedef void (*t_ftdel_func)(void *);
+
t_ftlst *ft_lstnew(void const *content);
void ft_lstadd_front(t_ftlst **alst, t_ftlst *new);
int ft_lstsize(t_ftlst *lst);
@@ -31,17 +34,17 @@ void ft_lstdelone(t_ftlst *lst, void (*del)(void *));
void ft_lstclear(t_ftlst **lst, void (*del)(void *));
void ft_lstiter(t_ftlst *lst, void (*f)(void *));
t_ftlst *ft_lstmap(t_ftlst *lst, void *(*f)(void *),
- void (*del)(void *));
+ t_ftdel_func del);
void ft_lstpop_front(t_ftlst **lst, void (*del)(void *));
t_ftlst *ft_lstreverse_ret(t_ftlst *lst);
void ft_lstreverse(t_ftlst **lst);
void ft_lstremove_if(t_ftlst **lst,
- t_ftbool (*equal)(void *ref, void *content), void *ref,
- void (*del)(void *content));
-t_ftlst *ft_lstbsearch(t_ftlst *lst,
- t_ftbool (*equal)(void *ref, void *content), void *ref);
-void ft_lstsort(t_ftlst **begin_list, int (*cmp)(void *, void*));
+ t_ftcompar_func cmp, const void *ref,
+ t_ftdel_func del);
+t_ftlst *ft_lstbsearch(t_ftlst *lst, t_ftcompar_func cmp,
+ const void *ref);
+void ft_lstsort(t_ftlst **begin_list, t_ftcompar_func cmp);
t_ftlst *ft_lstsorted_merge(t_ftlst *l1, t_ftlst *l2,
- int (*cmp)(void *, void *));
+ t_ftcompar_func cmp);
#endif