#ifndef RUNTIME_SCOPE_H_ #define RUNTIME_SCOPE_H_ #include "../script-block.h" #include "var-map.h" #include #include #include #include struct bshell_runtime; enum runtime_scope_type { RUNTIME_SCOPE_OTHER = 0, RUNTIME_SCOPE_SCRIPT, RUNTIME_SCOPE_GLOBAL, }; struct runtime_scope { enum runtime_scope_type s_type; fx_queue_entry s_entry; struct var_map s_vars; fx_hashtable *s_functions; FX_VECTOR_DECLARE(fx_value, s_stack); size_t s_ip; bshell_scriptblock *s_block; bshell_instruction *s_instr; size_t s_nr_instr; fx_value *s_pool; size_t s_nr_pool; }; extern struct runtime_scope *runtime_push_scope( struct bshell_runtime *rt, enum runtime_scope_type type, bshell_scriptblock *block); extern void runtime_pop_scope(struct bshell_runtime *rt); extern struct runtime_scope *runtime_get_scope(struct bshell_runtime *rt); extern void runtime_scope_push_value( struct runtime_scope *scope, const fx_value *value); extern fx_value runtime_scope_pop_value(struct runtime_scope *scope); extern void runtime_scope_set_block( struct runtime_scope *scope, bshell_scriptblock *block); #endif