Reduct  v4.0.5-1-g4851deb
A functional and immutable language.
Loading...
Searching...
No Matches
stringify.h
Go to the documentation of this file.
1#ifndef REDUCT_STRINGIFY_H
2#define REDUCT_STRINGIFY_H 1
3
4#include <reduct/core.h>
5#include <reduct/handle.h>
6
7/**
8 * @file stringify.h
9 * @brief Stringification.
10 * @defgroup stringify Stringification
11 *
12 * @{
13 */
14
15/**
16 * @brief Converts a Reduct handle to its string representation.
17 *
18 * @param reduct Pointer to the Reduct structure.
19 * @param handle The handle to stringify.
20 * @param buffer The destination buffer.
21 * @param size The size of the destination buffer.
22 * @return The number of characters that would have been written if the buffer was large enough, excluding the null
23 * terminator.
24 */
25REDUCT_API size_t reduct_stringify(reduct_t* reduct, reduct_handle_t handle, char* buffer, size_t size);
26
27/**
28 * @brief Converts a Reduct handle to its string representation, allocating a new buffer.
29 *
30 * @param reduct Pointer to the Reduct structure.
31 * @param handle The handle to stringify.
32 * @return A null-terminated string that must be freed with `free()`.
33 */
35
36/** @} */
37
38#endif
Core definitions and structures.
#define REDUCT_API
Definition defs.h:24
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.
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.
Handle management.
Handle type.
Definition defs.h:119
Per-thread state structure.
Definition core.h:133