|
Libft
Custom implementation of core libc functions with additional utility helpers.
|

Functions | |
| void | bucket_free (void *bucket_ptr, void(*del)(void *)) |
| Frees a single bucket chain and its pairs. | |
| bool | buckets_init (t_vector *buckets, size_t init_cap) |
| Initializes the bucket array. | |
| void | buckets_free (t_vector *buckets, void(*del)(void *)) |
| Frees the bucket array and every pair it contains. | |
| void bucket_free | ( | void * | bucket_ptr, |
| void(*)(void *) | del | ||
| ) |
Frees a single bucket chain and its pairs.
Frees every pair in the chain (key and, through del, value) and removes all list nodes. Shaped to be used as a buckets_foreach() callback.
| bucket_ptr | Address of the bucket slot (a t_list *) to free (borrowed). |
| del | Optional destructor applied to each stored value (may be NULL). |


| void buckets_free | ( | t_vector * | buckets, |
| void(*)(void *) | del | ||
| ) |
Frees the bucket array and every pair it contains.
Frees each bucket chain (every pair's key and, through del, its value) and then frees the underlying vector. The vector is left in a freed state.
| buckets | Pointer to the bucket vector to free (borrowed). |
| del | Optional destructor applied to each stored value (may be NULL). |


| bool buckets_init | ( | t_vector * | buckets, |
| size_t | init_cap | ||
| ) |
Initializes the bucket array.
Allocates a vector of init_cap t_list slots and zeroes it, so every bucket starts as an empty (NULL) chain.
| buckets | Pointer to the vector to initialize (uninitialized). |
| init_cap | Number of buckets to allocate. |

