24 #include "lbm_flat_value.h"
30 #define EVAL_CPS_STATE_INIT 0
31 #define EVAL_CPS_STATE_PAUSED 1
32 #define EVAL_CPS_STATE_RUNNING 2
33 #define EVAL_CPS_STATE_STEP 3
34 #define EVAL_CPS_STATE_KILL 4
36 #define EVAL_CPS_DEFAULT_MAILBOX_SIZE 10
38 #define EVAL_CPS_CONTEXT_FLAG_NOTHING (uint32_t)0x0
39 #define EVAL_CPS_CONTEXT_FLAG_TRAP (uint32_t)0x1
40 #define EVAL_CPS_CONTEXT_FLAG_CONST (uint32_t)0x2
41 #define EVAL_CPS_CONTEXT_FLAG_CONST_SYMBOL_STRINGS (uint32_t)0x4
42 #define EVAL_CPS_CONTEXT_FLAG_INCREMENTAL_READ (uint32_t)0x8
47 #define LBM_THREAD_STATE_READY (uint32_t)0
48 #define LBM_THREAD_STATE_BLOCKED (uint32_t)1
49 #define LBM_THREAD_STATE_TIMEOUT (uint32_t)2
50 #define LBM_THREAD_STATE_SLEEPING (uint32_t)3
51 #define LBM_THREAD_STATE_GC_BIT (uint32_t)(1 << 31)
58 uint32_t mailbox_size;
80 LBM_EVENT_FOR_HANDLER = 0,
81 LBM_EVENT_UNBLOCK_CTX,
85 lbm_event_type_t type;
339 bool create_string_channel(
char *str,
lbm_value *res);
bool lbm_wait_ctx(lbm_cid cid, lbm_uint timeout_ms)
lbm_cid lbm_eval_program(lbm_value lisp)
void lbm_set_timestamp_us_callback(uint32_t(*fptr)(void))
bool lbm_event(lbm_flat_value_t *fv)
lbm_value(* fundamental_fun)(lbm_value *, lbm_uint, eval_context_t *)
Definition: eval_cps.h:92
lbm_cid lbm_get_event_handler_pid(void)
void lbm_continue_eval(void)
void lbm_set_error_reason(char *error_str)
void lbm_critical_error(void)
void lbm_set_dynamic_load_callback(bool(*fptr)(const char *, const char **))
bool lbm_eval_init_events(unsigned int num_events)
bool lbm_unblock_ctx_unboxed(lbm_cid cid, lbm_value unboxed)
void lbm_blocked_iterator(ctx_fun f, void *, void *)
void lbm_set_critical_error_callback(void(*fptr)(void))
void lbm_undo_block_ctx_from_extension(void)
void lbm_set_ctx_done_callback(void(*fptr)(eval_context_t *))
void lbm_set_event_handler_pid(lbm_cid pid)
bool lbm_event_handler_exists(void)
lbm_value lbm_find_receiver_and_send(lbm_cid cid, lbm_value msg)
bool lbm_mailbox_change_size(eval_context_t *ctx, lbm_uint new_size)
bool lbm_unblock_ctx(lbm_cid cid, lbm_flat_value_t *fv)
lbm_cid lbm_create_ctx(lbm_value program, lbm_value env, lbm_uint stack_size, char *name)
void lbm_set_usleep_callback(void(*fptr)(uint32_t))
bool lbm_event_unboxed(lbm_value unboxed)
void lbm_set_printf_callback(int(*prnt)(const char *,...))
lbm_value eval_cps_get_env(void)
void lbm_pause_eval_with_gc(uint32_t num_free)
int lbm_remove_done_ctx(lbm_cid cid, lbm_value *v)
void(* ctx_fun)(eval_context_t *, void *, void *)
Definition: eval_cps.h:102
void lbm_set_verbose(bool verbose)
eval_context_t * lbm_get_current_context(void)
void lbm_toggle_verbose(void)
void lbm_set_eval_step_quota(uint32_t quota)
lbm_cid lbm_eval_program_ext(lbm_value lisp, unsigned int stack_size)
uint32_t lbm_get_eval_state(void)
void lbm_block_ctx_from_extension(void)
void lbm_pause_eval(void)
lbm_cid lbm_get_current_cid(void)
void lbm_block_ctx_from_extension_timeout(float s)
void lbm_running_iterator(ctx_fun f, void *, void *)
void lbm_set_error_suspect(lbm_value suspect)
uint32_t lbm_value
Definition: lbm_types.h:43
Definition: eval_cps.h:53
Definition: lbm_channel.h:68
Definition: eval_cps.h:84
Definition: lbm_flat_value.h:25