Reduct  v4.0.5-1-g4851deb
A functional and immutable language.
Loading...
Searching...
No Matches
Stringification

Detailed Description

Functions

REDUCT_API size_t reduct_stringify (reduct_t *reduct, reduct_handle_t handle, char *buffer, size_t size)
 Converts a Reduct handle to its string representation.
 
REDUCT_API char * reduct_stringify_alloc (reduct_t *reduct, reduct_handle_t handle)
 Converts a Reduct handle to its string representation, allocating a new buffer.
 

Function Documentation

◆ reduct_stringify()

REDUCT_API size_t reduct_stringify ( reduct_t reduct,
reduct_handle_t  handle,
char *  buffer,
size_t  size 
)

Converts a Reduct handle to its string representation.

Parameters
reductPointer to the Reduct structure.
handleThe handle to stringify.
bufferThe destination buffer.
sizeThe size of the destination buffer.
Returns
The number of characters that would have been written if the buffer was large enough, excluding the null terminator.

◆ reduct_stringify_alloc()

REDUCT_API char * reduct_stringify_alloc ( reduct_t reduct,
reduct_handle_t  handle 
)

Converts a Reduct handle to its string representation, allocating a new buffer.

Parameters
reductPointer to the Reduct structure.
handleThe handle to stringify.
Returns
A null-terminated string that must be freed with free().