2 * Copyright (c) 2021 Omar Polo <op@omarpolo.com>
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
85 TAILQ_HEAD(procs, proc);
87 TAILQ_ENTRY(proc) entry;
97 TAILQ_HEAD(tests, test);
99 TAILQ_ENTRY(test) entry;
111 void global_set(char *, struct op *);
113 struct op *newop(int);
114 void free_op(struct op *);
115 struct op *op_assign(char *, struct op *);
116 struct op *op_assert(struct op *);
117 struct op *op_var(char *);
118 struct op *op_lit_str(char *);
119 struct op *op_lit_num(uint64_t);
120 struct op *op_cmp_eq(struct op *, struct op *);
121 struct op *op_cast(struct op *, int);
123 void pp_val(struct value *);
124 int val_trueish(struct value *);
125 int val_eq(struct value *, struct value *);
126 void pp_op(struct op *);
127 void pp_block(struct op *);
128 int eval(struct op *);
131 void prepare_funcall(struct op *);
132 void push_arg(struct op *);
133 struct op *op_funcall(struct proc *, struct op *);
136 void add_builtin_proc(const char *name, int (*)(int));
137 void prepare_proc(char *);
138 /* push_arg works on procs too */
139 void proc_setup_body(void);
140 void proc_done(void);
141 void block_push(struct op *);
142 struct proc *proc_by_name(const char *);
145 void prepare_test(char *, char *);
146 void test_done(void);
149 void loadfile(const char *);