Data Structures | |
struct | cu_bistptr_t |
Functions | |
cu_bool_t | cu_bistptr_is_weak (cu_bistptr_t *bsp) |
cu_bool_t | cu_bistptr_is_strong (cu_bistptr_t *bsp) |
void * | cu_bistptr_get_weak (cu_bistptr_t *bsp) |
void * | cu_bistptr_get_strong (cu_bistptr_t *bsp) |
void * | cu_bistptr_get (cu_bistptr_t *bsp) |
void | cu_bistptr_init_weak (cu_bistptr_t *bsp, void *obj) |
void | cu_bistptr_init_strong (cu_bistptr_t *bsp, void *obj) |
void | cu_bistptr_deinit (cu_bistptr_t *bsp) |
void | cu_bistptr_assign_weak (cu_bistptr_t *bsp, void *obj) |
void | cu_bistptr_assign_strong (cu_bistptr_t *bsp, void *obj) |
This header implements a discriminated union of a strong and a weak pointer, but with the restriction that all pointers stored must be even, e.g. due to alignment.
void cu_bistptr_assign_strong | ( | cu_bistptr_t * | bsp, | |
void * | obj | |||
) |
Reinitialise bsp to hold a strong pointer to obj.
void cu_bistptr_assign_weak | ( | cu_bistptr_t * | bsp, | |
void * | obj | |||
) |
Reinitialise bsp to hold a weak pointer to obj.
void cu_bistptr_deinit | ( | cu_bistptr_t * | bsp | ) |
Deininialise bsp. If bsp holds a weak pointer, this unregisters the corresponding disappearing link.
void* cu_bistptr_get | ( | cu_bistptr_t * | bsp | ) |
Returns the pointer stored in bsp, independent of strength.
void* cu_bistptr_get_strong | ( | cu_bistptr_t * | bsp | ) |
Returns the strong pointer of bsp.
void* cu_bistptr_get_weak | ( | cu_bistptr_t * | bsp | ) |
Returns the weak pointer held by bsp.
void cu_bistptr_init_strong | ( | cu_bistptr_t * | bsp, | |
void * | obj | |||
) |
Initialise bsp to a strong pointer to obj.
void cu_bistptr_init_weak | ( | cu_bistptr_t * | bsp, | |
void * | obj | |||
) |
Initialise bsp to a weak pointer to obj.
cu_bool_t cu_bistptr_is_strong | ( | cu_bistptr_t * | bsp | ) |
The complement of cu_bistptr_is_weak, for symmetry.
cu_bool_t cu_bistptr_is_weak | ( | cu_bistptr_t * | bsp | ) |
True iff bsp is a weak pointer. The NULL
pointer counts as strong.