1#ifndef REDUCT_HANDLE_IMPL_H
2#define REDUCT_HANDLE_IMPL_H 1
255 if (a == b || *a == *b)
292 else if (va.
group == 1)
Core definitions and structures.
reduct_bool_t
Boolean type.
#define REDUCT_CONTAINER_OF(_ptr, _type, _member)
Container of macro.
reduct_uint64_t reduct_handle_t
Handle type.
#define REDUCT_ASSERT(_cond)
Virtual machine evaluation.
REDUCT_API reduct_atom_t * reduct_atom_lookup_int(struct reduct *reduct, reduct_int64_t value)
Lookup an atom by integer value.
REDUCT_API reduct_atom_t * reduct_atom_lookup_float(struct reduct *reduct, reduct_float_t value)
Lookup an atom by float value.
#define REDUCT_ERROR_RUNTIME(_reduct,...)
Throw a runtime error using the jump buffer in the error structure.
#define REDUCT_HANDLE_IS_ITEM(_handle)
Check if a handle is an item.
#define REDUCT_HANDLE_IS_INT(_handle)
Check if a handle is an integer.
#define REDUCT_HANDLE_GET_FLAGS(_handle)
Get flags from an item handle.
#define REDUCT_HANDLE_IS_NUMBER_SHAPED(_handle)
Check if a handle is a number or references a number shaped item.
#define REDUCT_HANDLE_TO_INT(_handle)
Get the integer value of a handle.
#define REDUCT_HANDLE_TO_ITEM(_handle)
Get the item pointer of a handle.
REDUCT_API void reduct_handle_promote(struct reduct *reduct, reduct_handle_t *a, reduct_handle_t *b, reduct_promotion_t *out)
Promote two handles to a common numeric type.
#define REDUCT_HANDLE_TO_FLOAT(_handle)
Get the float value of a handle.
#define REDUCT_HANDLE_FROM_ATOM(_atom)
Create a handle from an atom pointer.
#define REDUCT_HANDLE_FROM_ITEM(_ptr)
Create a handle from an item pointer.
#define REDUCT_HANDLE_IS_FLOAT(_handle)
Check if a handle is a float.
@ REDUCT_PROMOTION_TYPE_INT
@ REDUCT_PROMOTION_TYPE_FLOAT
#define REDUCT_ITEM_TYPE_LIST
A list.
REDUCT_API const char * reduct_item_type_str(reduct_item_type_t type)
Get the string representation of an Reduct item type.
#define REDUCT_ITEM_TYPE_ATOM
An atom.
#define REDUCT_ITEM_FLAG_INT_SHAPED
Item is an integer shaped atom.
#define REDUCT_ITEM_FLAG_FLOAT_SHAPED
Item is a float shaped atom.
REDUCT_API reduct_handle_t reduct_handle_pi(reduct_t *reduct)
REDUCT_API reduct_handle_t reduct_handle_e(reduct_t *reduct)
REDUCT_API void reduct_handle_get_string_params(reduct_t *reduct, reduct_handle_t *handle, char **outStr, reduct_size_t *outLen)
static void reduct_handle_unpack(reduct_handle_t *handle, reduct_cmp_val_t *out)
REDUCT_API reduct_bool_t reduct_handle_is_equal(reduct_t *reduct, reduct_handle_t *a, reduct_handle_t *b)
REDUCT_API reduct_int64_t reduct_handle_compare(reduct_t *reduct, reduct_handle_t *a, reduct_handle_t *b)
REDUCT_API reduct_handle_t reduct_handle_nil(reduct_t *reduct)
REDUCT_API reduct_item_t * reduct_handle_item(reduct_t *reduct, reduct_handle_t *handle)
REDUCT_API void reduct_handle_ensure_item(reduct_t *reduct, reduct_handle_t *handle)
#define REDUCT_LIST_ITER(_list)
Create a initializer for a list iterator.
REDUCT_API reduct_bool_t reduct_list_iter_next(reduct_list_iter_t *iter, reduct_handle_t *out)
Get the next element from the iterator.
reduct_int64_t integerValue
Pre-computed integer value, item must have REDUCT_ITEM_FLAG_INT_SHAPED.
reduct_uint32_t length
The length of the string (must be first, check the reduct_item_t structure).
char * string
Pointer to the string.
reduct_float_t floatValue
Pre-computed float value, item must have REDUCT_ITEM_FLAG_FLOAT_SHAPED.
union reduct_cmp_val_t::@6 num
reduct_list_t list
A list.
reduct_uint32_t length
Common length for the item. (Stored in the union to save space due to padding rules....
reduct_item_flags_t flags
Flags for the item.
reduct_atom_t atom
An atom.
reduct_item_type_t type
The type of the item.
reduct_uint32_t length
Total number of elements.