diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/libft_ht.h | 10 | ||||
| -rw-r--r-- | include/libft_lst.h | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/include/libft_ht.h b/include/libft_ht.h index b890316..8dff87a 100644 --- a/include/libft_ht.h +++ b/include/libft_ht.h @@ -1,8 +1,9 @@ -#ifndef FT_HT -# define FT_HT +#ifndef LIBFT_HT +# define LIBFT_HT # include "libft.h" +# include "libft_lst.h" typedef struct { @@ -10,7 +11,7 @@ typedef struct void *value; } t_ftht_content; -typedef t_list* t_ftht_entry; +typedef t_ftlst* t_ftht_entry; typedef struct { @@ -21,11 +22,12 @@ typedef struct typedef t_ftuint t_ftht_digest; +t_ftht_digest ft_hthash(t_ftht *ht, char *key); + 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); -void ft_htdestroy_value(t_ftht *ht); t_ftht_content *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_lst.h b/include/libft_lst.h index 8f77233..b9475f9 100644 --- a/include/libft_lst.h +++ b/include/libft_lst.h @@ -26,5 +26,7 @@ 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); #endif |
