2 * $OpenBSD: bcode.h,v 1.7 2012/11/07 11:06:14 otto Exp $
3 * $DragonFly: src/usr.bin/dc/bcode.h,v 1.1 2004/09/20 04:20:39 dillon Exp $
7 * Copyright (c) 2003, Otto Moerbeek <otto@drijf.net>
9 * Permission to use, copy, modify, and distribute this software for any
10 * purpose with or without fee is hereby granted, provided that the above
11 * copyright notice and this permission notice appear in all copies.
13 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 #include <sys/types.h>
23 #include <openssl/bn.h>
71 int (*readchar
)(struct source
*);
72 void (*unreadchar
)(struct source
*);
73 char *(*readline
)(struct source
*);
74 void (*free
)(struct source
*);
78 struct vtable
*vtable
;
89 void init_bmachine(bool);
90 void reset_bmachine(struct source
*);
91 u_int
bmachine_scale(void);
92 void scale_number(BIGNUM
*, int);
93 void normalize(struct number
*, u_int
);
95 void pn(const char *, const struct number
*);
96 void pbn(const char *, const BIGNUM
*);
97 void negate(struct number
*);
98 void split_number(const struct number
*, BIGNUM
*, BIGNUM
*);
99 void bmul_number(struct number
*, struct number
*,
100 struct number
*, u_int scale
);