LispBM
|
#include "lbm_c_interop.h"
lbm_cid eval_cps_load_and_define | ( | lbm_char_channel_t * | tokenizer, |
char * | symbol, | ||
bool | program | ||
) |
lbm_cid eval_cps_load_and_eval | ( | lbm_char_channel_t * | tokenizer, |
bool | program, | ||
bool | incremental, | ||
char * | name | ||
) |
void lbm_clear_env | ( | void | ) |
Clear the global environment.
Create an array to access from both LBM and C. This function should be called while the evaluator is paused and the array should be bound to something before un-pausing. Send the array in a message with lbm_send_message or define it in the global with lbm_define. The data is stored in lbm_memory as C values (not encoded as lbm values).
value | Result array value. |
num_elt | Number of bytes in the array. |
int lbm_define | ( | char * | symbol, |
lbm_value | value | ||
) |
Add a definition to the global environment
symbol | Name to bind the data to. |
value | The data. |
lbm_cid lbm_eval_defined | ( | char * | symbol, |
bool | program | ||
) |
lbm_cid lbm_eval_defined_expression | ( | char * | symbol | ) |
Create a context for a bound expression and schedule it for execution
symbol | The name of the binding to schedule for execution. |
lbm_cid lbm_eval_defined_program | ( | char * | symbol | ) |
Create a context for a bound program and schedule it for execution
symbol | The name of the binding to schedule for execution. |
Flattens one of the fields of the environment hash-map. Evaluator should be paused when calling this. All processing of data and size should be performed before unpausing the evaluator. Unpausing the evaluator enables reclamation of data by GC.
index | Value between 0 and GLOBAL_ENV_ROOTS-1 |
data | Result data pointer is returned here. |
size | Result size is returned here. |
lbm_cid lbm_load_and_define_expression | ( | lbm_char_channel_t * | tokenizer, |
char * | symbol | ||
) |
Load an expression and bind it to a symbol in the environment.
tokenizer | The tokenizer to read the expression from. |
symbol | A string with the name you want the binding to have in the environment. |
lbm_cid lbm_load_and_define_program | ( | lbm_char_channel_t * | tokenizer, |
char * | symbol | ||
) |
Load a program and bind it to a symbol in the environment.
tokenizer | The tokenizer to read the program from. |
symbol | A string with the name you want the binding to have in the environment. |
lbm_cid lbm_load_and_eval_expression | ( | lbm_char_channel_t * | tokenizer | ) |
Load and schedule an expression for execution.
tokenizer | The tokenizer to read the expression from. |
lbm_cid lbm_load_and_eval_program | ( | lbm_char_channel_t * | tokenizer, |
char * | name | ||
) |
Load and schedule a program for execution.
tokenizer | The tokenizer to read the program from. |
name | Name of thread (or NULL) thread doing the load and eval. |
lbm_cid lbm_load_and_eval_program_incremental | ( | lbm_char_channel_t * | tokenizer, |
char * | name | ||
) |
Load a program while evaluating incrementally.
tokenizer | The tokenizer to read the program from. |
name | Name of the thread (or NULL) that performs the incremental load. |
Send a message to a process running in the evaluator.
cid | Context id of the process to send a message to. |
msg | lbm_value that will be sent to the process. |
Share a C array with LBM. The array should be created while the evaluator is paused and the array should be bound to something before un-pausing. Send the array in a message with lbm_send_message or define it in the global with lbm_define. The data is stored in the array as C values (not encoded as lbm values).
value | Result array value. |
data | Pointer to the C array |
num_elt | Number of bytes in the array. |
Share a C array stored in flash with LBM.
value | Pointer to a heap-cell allocated in flash. |
data | Pointer to the C array. |
num_elt | Number of bytes in the array. |
int lbm_undefine | ( | char * | symbol | ) |
Remove a definition from the global environment.
symbol | Name of symbol to undefine in the environment. |