4#ifndef PRISM_INTERNAL_INTEGER_H
5#define PRISM_INTERNAL_INTEGER_H
15pm_integer_uint64(uint64_t value) {
17 .
length = value == 0 ? 0 : value <= UINT32_MAX ? 1 : 2,
18 .words = { .value = { (uint32_t) value, (uint32_t) (value >> 32) } }
29 PM_INTEGER_BASE_BINARY = 2,
32 PM_INTEGER_BASE_OCTAL = 8,
35 PM_INTEGER_BASE_DECIMAL = 10,
38 PM_INTEGER_BASE_HEXADECIMAL = 16
47void pm_integer_parse(
pm_arena_t *arena,
pm_integer_t *integer, pm_integer_base_t base,
const uint8_t *start,
const uint8_t *end);
A bump allocator for the prism parser.
#define PRISM_INLINE
Old Visual Studio versions do not support the inline keyword, so we need to define it to be __inline.
This module provides functions for working with arbitrary-sized integers.
A wrapper around a contiguous block of allocated memory.
A structure represents an arbitrary-sized integer.
uint32_t length
The number of words in the magnitude, with no leading zero words.