19 #ifndef LBM_CUSTOM_TYPE_H_
20 #define LBM_CUSTOM_TYPE_H_
25 #include <lbm_defines.h>
33 #define CUSTOM_TYPE_VALUE 0
34 #define CUSTOM_TYPE_DESCRIPTOR 1
35 #define CUSTOM_TYPE_DESTRUCTOR 2
36 #define CUSTOM_TYPE_LBM_MEM_SIZE 3
45 typedef bool (*custom_type_destructor)(lbm_uint);
66 static inline const char *lbm_get_custom_descriptor(
lbm_value value) {
69 return (
const char*)m[CUSTOM_TYPE_DESCRIPTOR];
74 static inline lbm_uint lbm_get_custom_value(
lbm_value value) {
76 return m[CUSTOM_TYPE_VALUE];
lbm_uint lbm_dec_custom(lbm_value val)
static lbm_type lbm_type_of(lbm_value x)
Definition: heap.h:657
bool lbm_custom_type_destroy(lbm_uint *lbm_mem_ptr)
bool lbm_custom_type_create(lbm_uint value, custom_type_destructor fptr, const char *desc, lbm_value *result)
uint32_t lbm_value
Definition: lbm_types.h:43