/* This file is part of mailfromd. Copyright (C) 2006, 2007, 2008 Sergey Poznyakoff This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ struct optab { char *name; instr_t instr; void (*dump) (prog_counter_t i); unsigned length; }; typedef void *STKVAL; struct eval_environ; #define B2STACK(s) (s + sizeof(STKVAL) - 1) / sizeof(STKVAL) void runtime_warning(eval_environ_t env, const char *fmt, ...); void runtime_error(eval_environ_t env, const char *fmt, ...) ATTRIBUTE_NORETURN; STKVAL get_arg(eval_environ_t env, unsigned n); void get_string_arg(eval_environ_t env, unsigned n, char **ptr); void get_numeric_arg(eval_environ_t env, unsigned n, long *np); void push(eval_environ_t env, STKVAL val); STKVAL pop(eval_environ_t env); STKVAL *env_data_ref(eval_environ_t env, size_t off); size_t heap_reserve(eval_environ_t env, size_t size); size_t heap_reserve_words(eval_environ_t env, size_t size); STKVAL heap_tempspace(eval_environ_t env, size_t size); void heap_obstack_begin(eval_environ_t env); STKVAL heap_obstack_finish(eval_environ_t env); void *heap_obstack_grow(eval_environ_t env, void *ptr, size_t size); void pushs(eval_environ_t env, char *s); void advance_pc(eval_environ_t env, long cnt); void adjust_stack(eval_environ_t env, unsigned cnt); void unroll_stack(eval_environ_t env, unsigned cnt); void prog_trace(eval_environ_t env, const char *fmt, ...); void runtime_stack_trace(eval_environ_t env); void env_var_inc(eval_environ_t env, size_t off); char *env_dict_getsym(eval_environ_t env, char *string); char *env_dict_install(eval_environ_t env, char *key, char *value); const struct locus *env_get_locus(eval_environ_t env); void *env_get_builtin_priv(eval_environ_t env, int id); int builtin_priv_register(void *(*init)(void), void (*destroy)(void*)); void ensure_initialized_variable(const char *name, struct value *val); void scan_code(prog_counter_t start, prog_counter_t end, void (*fun)(prog_counter_t pc, struct optab *op, void *d), void *data); int within_loop(struct literal *lit); void enter_loop(struct literal *lit, prog_counter_t *begptr, prog_counter_t *endptr); void leave_loop(void); extern instr_t *prog; extern unsigned error_count; extern unsigned long prog_trace_option; extern STKVAL *dataseg; extern size_t datasize; extern size_t *dataseg_reloc; extern size_t dataseg_reloc_count;