LispBM
Functions
print.h File Reference
#include <stdint.h>
#include "lbm_types.h"
Include dependency graph for print.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool lbm_value_is_printable_string (lbm_value v, char **str)
 
int lbm_print_init (lbm_uint *print_stack_storage, lbm_uint print_stack_size)
 
int lbm_print_value (char *buf, unsigned int len, lbm_value t)
 

Function Documentation

◆ lbm_print_init()

int lbm_print_init ( lbm_uint *  print_stack_storage,
lbm_uint  print_stack_size 
)

Initialize the print_value subsystem. print value depends on a stack and that stack is initialized here using a storage array provided by the user.

Parameters
print_stack_storageArray to use as storage for stack data.
print_stack_sizeThe number of uint32_t elements in the array.
Returns
1 for success and 0 for failure.

◆ lbm_print_value()

int lbm_print_value ( char *  buf,
unsigned int  len,
lbm_value  t 
)

Print an lbm_value into a buffer provided by the user. If printing fails, the buffer may contain an error message.

Parameters
bufBuffer to print into.
lenThe size of the buffer in bytes.
tThe value to print.
Returns
negative number for failure and the number of printed characters on success.

◆ lbm_value_is_printable_string()

bool lbm_value_is_printable_string ( lbm_value  v,
char **  str 
)

Check if an lbm_value (very likely) is a printable string

Parameters
vValue to check stringyness of.
Returns
True if the value likely is a string, otherwise false.