data_structures
type_hashset.c
Go to the documentation of this file.
1 /* ************************************************************************** */
3 /* */
4 /* ::: :::::::: */
5 /* type_hash_set.c :+: :+: :+: */
6 /* +:+ +:+ +:+ */
7 /* By: unite <marvin@42.fr> +#+ +:+ +#+ */
8 /* +#+#+#+#+#+ +#+ */
9 /* Created: 2020/07/22 00:12:57 by unite #+# #+# */
10 /* Updated: 2020/07/22 01:45:03 by unite ### ########.fr */
11 /* */
12 /* ************************************************************************** */
13 
14 #include "types.h"
15 #include "hashset.h"
16 
17 void *hashset_copy_wrapper(const void *hs)
18 {
19  return hashset_copy(hs);
20 }
21 
22 void hashset_delete_wrapper(void *hs)
23 {
24  hashset_delete(hs);
25 }
26 
27 static const t_type g_type_hashset_struct = {
28  .name = "hashset",
29  .copy = &hashset_copy_wrapper,
30  .del = &hashset_delete_wrapper,
31 };
32 
33 const t_type *g_type_hashset = &g_type_hashset_struct;
s_type::name
char * name
The name of a datatype as a string.
Definition: types.h:49
types.h
hashset.h
hashset_delete
void hashset_delete(t_hashset *hs)
Deletes this hashset and frees all its items and the associated data.
Definition: hashset_delete.c:16
s_type
A full representation of a data type, used to achieve polymorphism in the implementation of data stru...
Definition: types.h:47
hashset_copy
t_hashset * hashset_copy(const t_hashset *hs)
Copies the hashset and all it contents.
Definition: hashset_copy.c:16