diff options
Diffstat (limited to 'include/bh/internal/bigint.h')
| -rw-r--r-- | include/bh/internal/bigint.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/include/bh/internal/bigint.h b/include/bh/internal/bigint.h new file mode 100644 index 0000000..96377cf --- /dev/null +++ b/include/bh/internal/bigint.h @@ -0,0 +1,31 @@ +#ifndef BH_INTERNAL_BIGINT_H +#define BH_INTERNAL_BIGINT_H + +#include "bh.h" +#include <bh/bigint.h> + +#if defined(BH_BIGINT_LONG) +#define BH_BIGINT_BITS 31 +#define BH_BIGINT_MASK 0x7FFFFFFF +#define BH_BIGINT_TYPE bh_uint32_t +#define BH_BIGINT_TMP bh_uint64_t +#else +#define BH_BIGINT_BITS 15 +#define BH_BIGINT_MASK 0x7FFF +#define BH_BIGINT_TYPE bh_uint16_t +#define BH_BIGINT_TMP bh_uint32_t +#endif + +struct bh_bigint_s +{ + BH_BIGINT_TYPE *data; + size_t size; + size_t capacity; + int type; + int error; +}; + +void bh_bigint_init(bh_bigint_t *bigint); +void bh_bigint_destroy(bh_bigint_t *bigint); + +#endif /* BH_INTERNAL_BIGINT_H */ |
