1/* $OpenBSD: extern.h,v 1.4 2014/12/01 13:13:00 deraadt Exp $ */ 2 3/* 4 * Copyright (c) 2003, Otto Moerbeek <otto@drijf.net> 5 * 6 * Permission to use, copy, modify, and distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19#include <stdbool.h> 20#include "bcode.h" 21 22 23/* inout.c */ 24void src_setstream(struct source *, FILE *); 25void src_setstring(struct source *, char *); 26struct number *readnumber(struct source *, u_int, u_int); 27void printnumber(FILE *, const struct number *, u_int); 28char *read_string(struct source *); 29void print_value(FILE *, const struct value *, const char *, u_int); 30void print_ascii(FILE *, const struct number *); 31 32/* mem.c */ 33struct number *new_number(void); 34void free_number(struct number *); 35struct number *div_number(struct number *, struct number *, u_int scale); 36struct number *dup_number(const struct number *); 37void *bmalloc(size_t); 38void *breallocarray(void *, size_t, size_t); 39char *bstrdup(const char *p); 40void bn_check(int); 41void bn_checkp(const void *); 42 43/* stack.c */ 44void stack_init(struct stack *); 45void stack_free_value(struct value *); 46struct value *stack_dup_value(const struct value *, struct value *); 47void stack_swap(struct stack *); 48size_t stack_size(const struct stack *); 49void stack_dup(struct stack *); 50void stack_pushnumber(struct stack *, struct number *); 51void stack_pushstring(struct stack *stack, char *); 52void stack_push(struct stack *, struct value *); 53void stack_set_tos(struct stack *, struct value *); 54struct value *stack_tos(const struct stack *); 55struct value *stack_pop(struct stack *); 56struct number *stack_popnumber(struct stack *); 57char *stack_popstring(struct stack *); 58void stack_clear(struct stack *); 59void stack_print(FILE *, const struct stack *, const char *, 60 u_int base); 61void frame_assign(struct stack *, size_t, const struct value *); 62struct value *frame_retrieve(const struct stack *, size_t); 63/* void frame_free(struct stack *); */ 64