#include <stdbool.h>
#include <stddef.h>
#include <lbm_types.h>
#include <lbm_defines.h>
#include <heap.h>
Go to the source code of this file.
◆ CUSTOM_TYPE_DESCRIPTOR
| #define CUSTOM_TYPE_DESCRIPTOR 1 |
◆ CUSTOM_TYPE_DESTRUCTOR
| #define CUSTOM_TYPE_DESTRUCTOR 2 |
◆ CUSTOM_TYPE_LBM_MEM_SIZE
| #define CUSTOM_TYPE_LBM_MEM_SIZE 3 |
◆ CUSTOM_TYPE_VALUE
| #define CUSTOM_TYPE_VALUE 0 |
◆ custom_type_destructor
| typedef bool(* custom_type_destructor) (lbm_uint) |
◆ lbm_custom_type_create()
Create a value of a custom type with a destructor and a description
- Parameters
-
| value | The custom value. This can be a pointer to memory allocated on the C-side. |
| fptr | The destructor function. This function should free any memory allocated on the C-side. |
| desc | A description of the type that will be used for printing. |
| result | Pointer to lbm_value that will hold the value of the custom type. |
- Returns
- true on success or false otherwise.
◆ lbm_custom_type_destroy()
| bool lbm_custom_type_destroy |
( |
lbm_uint * |
lbm_mem_ptr | ) |
|
Called by garbage collector and invokes the destructor on the custom value.
/return true on success or false otherwise.
◆ lbm_get_custom_descriptor()
| static const char* lbm_get_custom_descriptor |
( |
lbm_value |
value | ) |
|
|
inlinestatic |
◆ lbm_get_custom_value()
◆ lbm_is_custom()