LispBM
Functions
lbm_custom_type.c File Reference
#include <lbm_custom_type.h>
#include <heap.h>
#include <lbm_memory.h>
Include dependency graph for lbm_custom_type.c:

Functions

bool lbm_custom_type_create (lbm_uint value, custom_type_destructor fptr, const char *desc, lbm_value *result)
 
bool lbm_custom_type_destroy (lbm_uint *lbm_mem_ptr)
 

Function Documentation

◆ lbm_custom_type_create()

bool lbm_custom_type_create ( lbm_uint  value,
custom_type_destructor  fptr,
const char *  desc,
lbm_value result 
)

Create a value of a custom type with a destructor and a description

Parameters
valueThe custom value. This can be a pointer to memory allocated on the C-side.
fptrThe destructor function. This function should free any memory allocated on the C-side.
descA description of the type that will be used for printing.
resultPointer 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.