2#ifndef REDUCT_STRINGIFY_IMPL_H
3#define REDUCT_STRINGIFY_IMPL_H 1
63 size > written ? size - written : 0);
66 if (_iter.index < item->
length)
69 size > written ? size - written : 0,
" ");
101 buffer[copyLen] =
'\0';
#define REDUCT_MEMCPY(_dest, _src, _size)
reduct_uint64_t reduct_handle_t
Handle type.
#define REDUCT_ASSERT(_cond)
#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_TO_INT(_handle)
Get the integer value of a handle.
#define REDUCT_HANDLE_TO_ITEM(_handle)
Get the item pointer of a handle.
#define REDUCT_HANDLE_TO_FLOAT(_handle)
Get the float value of a handle.
#define REDUCT_HANDLE_NONE
Invalid handle constant.
REDUCT_API void reduct_handle_get_string_params(struct reduct *reduct, reduct_handle_t *handle, char **outStr, reduct_size_t *outLen)
Get the string pointer and length from an atom handle.
#define REDUCT_HANDLE_IS_FLOAT(_handle)
Check if a handle is a float.
#define REDUCT_HANDLE_IS_ATOM(_handle)
Check if a handle is an atom.
#define REDUCT_ITEM_TYPE_LIST
A list.
#define REDUCT_ITEM_TYPE_ATOM
An atom.
#define REDUCT_ITEM_TYPE_FUNCTION
A function.
#define REDUCT_ITEM_FLAG_INT_SHAPED
Item is an integer shaped atom.
#define REDUCT_ITEM_FLAG_FLOAT_SHAPED
Item is a float shaped atom.
#define REDUCT_ITEM_TYPE_CLOSURE
A closure.
REDUCT_API reduct_size_t reduct_stringify(reduct_t *reduct, reduct_handle_t *handle, char *buffer, reduct_size_t size)
Converts a Reduct handle to its string representation.
#define REDUCT_LIST_FOR_EACH(_handle, _list)
Macro for iterating over all elements in a list.
static reduct_size_t reduct_stringify_internal(reduct_t *reduct, reduct_handle_t *handle, char *buffer, reduct_size_t size)
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.
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.