18struct reduct_eval_frame;
32#define REDUCT_IMPORT_PATHS_INITIAL 4
33#define REDUCT_IMPORT_PATHS_GROWTH 2
35#define REDUCT_SCHEMA_INITIAL 4
36#define REDUCT_SCHEMA_GROWTH 2
38#define REDUCT_CONSTANTS_MAX 8
53typedef struct reduct_input
99#define REDUCT_SCRATCH_INITIAL 128
100#define REDUCT_SCRATCH_MAX 16
102#define REDUCT_LIBS_INITIAL 4
103#define REDUCT_LIBS_GROWTH 2
109typedef struct reduct_global
234 bool checkExistence);
246 for (
size_t i = 0; i < len; i++)
248 hash ^= (
unsigned char)str[i];
Atom representation and operations.
uint16_t reduct_input_id_t
Identifies a reduct_input_t within a Reduct structure.
#define REDUCT_ALWAYS_INLINE
#define REDUCT_PATH_MAX
Maximum path length for Reduct.
Error handling and reporting.
Virtual machine evaluation.
#define REDUCT_FNV_PRIME
FNV-1a 32-bit prime.
#define REDUCT_FNV_OFFSET
FNV-1a 32-bit offset basis.
REDUCT_API reduct_input_t * reduct_input_new(reduct_t *reduct, const char *buffer, size_t length, const char *path, reduct_input_flags_t flags)
Create a new input structure and push it onto the input stack.
REDUCT_API void * reduct_userdata_get(reduct_t *reduct)
Get the user data pointer from the Reduct structure.
REDUCT_API void reduct_add_import_path(reduct_t *reduct, const char *path)
Add a path to search when importing modules.
REDUCT_API void reduct_userdata_set(reduct_t *reduct, void *userdata)
Set the user data pointer for the Reduct structure.
REDUCT_API void reduct_resolve_path(reduct_t *reduct, const char *path, size_t pathLen, char *outPath, size_t maxLen, bool checkExistence)
Resolve a path relative to the current execution frame or import paths.
static REDUCT_ALWAYS_INLINE uint32_t reduct_hash(const char *str, size_t len)
Hash a string.
reduct_input_flags_t
Input flags.
REDUCT_API reduct_input_t * reduct_input_lookup(reduct_t *reduct, reduct_input_id_t id)
Lookup an input structure by its ID.
REDUCT_API reduct_t * reduct_new(void)
Create a new Reduct environment.
REDUCT_API void reduct_free(reduct_t *reduct)
Free the Reduct structure.
REDUCT_API void reduct_args_set(reduct_t *reduct, int argc, char **argv)
Set the command line arguments for the Reduct structure.
REDUCT_API void reduct_global_lib_add(reduct_t *reduct, reduct_lib_t lib)
Add a loaded library handle to the global state.
@ REDUCT_INPUT_FLAG_OWNED
The input buffer is owned by the input structure and should be freed.
Native function and intrinsic registration.
Scratch buffer allocation.
Per-thread arena-related state structure.
Global atom-related environment structure.
Per-thread eval-related state structure.
Global garbage collection-related state structure.
reduct_task_global_t task
reduct_optimize_global_t optimize
reduct_input_global_t input
reduct_atom_global_t atom
reduct_item_global_t item
reduct_native_global_t native
reduct_schema_global_t schema
Global import-related state structure.
Global item-related state structure.
Per-thread item-related state structure.
Global library-related state structure.
Global native-related state structure.
Global optimization-related state structure.
Read-Write Mutex structure.
Global schema-related state structure.
Per-thread scratch-related state structure.
Per-thread state structure.
reduct_arena_local_t arena
reduct_scratch_local_t scratch
Global thread-related state structure.