data_structures
|
A full representation of a data type, used to achieve polymorphism in the implementation of data structures. More...
#include <types.h>
Data Fields | |
char * | name |
The name of a datatype as a string. More... | |
void *(* | copy )(const void *) |
A function pointer used to copy the data type. More... | |
void(* | del )(void *) |
A function pointer used to free the memory taken by the data type. More... | |
int(* | cmp )(const void *, const void *) |
(optional) A function ponter used to compare members of this data type More... | |
size_t(* | hash )(const void *, size_t) |
(optional) A function pointer used to get a hash value of this data type More... | |
A full representation of a data type, used to achieve polymorphism in the implementation of data structures.
void
pointers, primitive data types, such as int
and char
, must be converted to pointers. data2ptr.c
ptr2data.c
It contains pointers to all the functions needed to work with this data type. New type
's can be defined to extend the types that the data structures in this library can work with.
s_type::cmp |
s_type::del |
s_type::hash |