|
Reduct
v4.0.5-1-g4851deb
A functional and immutable language.
|
Data Structures | |
| struct | reduct_input_t |
| Input structure. More... | |
| struct | reduct_input_global_t |
| Global input-related state structure. More... | |
| struct | reduct_import_global_t |
| Global import-related state structure. More... | |
| struct | reduct_lib_global_t |
| Global library-related state structure. More... | |
| struct | reduct_global_t |
| Global state structure. More... | |
| struct | reduct_t |
| Per-thread state structure. More... | |
Macros | |
| #define | REDUCT_IMPORT_PATHS_INITIAL 4 |
| Initial size of the import path array. | |
| #define | REDUCT_IMPORT_PATHS_GROWTH 2 |
| Growth factor of the import path array. | |
| #define | REDUCT_SCHEMA_INITIAL 4 |
| Initial size of the schema array. | |
| #define | REDUCT_SCHEMA_GROWTH 2 |
| Growth factor of the schema array. | |
| #define | REDUCT_CONSTANTS_MAX 8 |
| Maximum amount of predefined constants. | |
| #define | REDUCT_SCRATCH_INITIAL 128 |
| Initial scratch buffer size. | |
| #define | REDUCT_SCRATCH_MAX 16 |
| The maximum number of scratch buffers. | |
| #define | REDUCT_LIBS_INITIAL 4 |
| Initial size of the library array. | |
| #define | REDUCT_LIBS_GROWTH 2 |
| Growth factor of the library array. | |
Enumerations | |
| enum | reduct_input_flags_t { REDUCT_INPUT_FLAG_NONE = 0 , REDUCT_INPUT_FLAG_OWNED = 1 } |
| Input flags. More... | |
Functions | |
| 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_global_lib_add (reduct_t *reduct, reduct_lib_t lib) |
| Add a loaded library handle to the global state. | |
| REDUCT_API void | reduct_userdata_set (reduct_t *reduct, void *userdata) |
| Set the user data pointer for the Reduct structure. | |
| REDUCT_API void * | reduct_userdata_get (reduct_t *reduct) |
| Get the user data pointer from 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_add_import_path (reduct_t *reduct, const char *path) |
| Add a path to search when importing modules. | |
| 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 reduct_input_t * | reduct_input_lookup (reduct_t *reduct, reduct_input_id_t id) |
| Lookup an input structure by its ID. | |
| 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. | |
| #define REDUCT_IMPORT_PATHS_INITIAL 4 |
| #define REDUCT_IMPORT_PATHS_GROWTH 2 |
| #define REDUCT_SCHEMA_INITIAL 4 |
| #define REDUCT_SCHEMA_GROWTH 2 |
| #define REDUCT_CONSTANTS_MAX 8 |
| #define REDUCT_SCRATCH_INITIAL 128 |
| #define REDUCT_SCRATCH_MAX 16 |
| #define REDUCT_LIBS_INITIAL 4 |
| #define REDUCT_LIBS_GROWTH 2 |
| enum reduct_input_flags_t |
| REDUCT_API reduct_t * reduct_new | ( | void | ) |
Create a new Reduct environment.
NULL. | REDUCT_API void reduct_free | ( | reduct_t * | reduct | ) |
Free the Reduct structure.
| reduct | Pointer to the Reduct structure to free. |
| REDUCT_API void reduct_global_lib_add | ( | reduct_t * | reduct, |
| reduct_lib_t | lib | ||
| ) |
Add a loaded library handle to the global state.
| reduct | Pointer to the Reduct structure. |
| lib | The library handle. |
| REDUCT_API void reduct_userdata_set | ( | reduct_t * | reduct, |
| void * | userdata | ||
| ) |
Set the user data pointer for the Reduct structure.
| reduct | Pointer to the Reduct structure. |
| userdata | The user data pointer. |
| REDUCT_API void * reduct_userdata_get | ( | reduct_t * | reduct | ) |
Get the user data pointer from the Reduct structure.
| reduct | Pointer to 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.
Will be utilized by the (args!) native.
| reduct | Pointer to the Reduct structure. |
| argc | The number of arguments. |
| argv | The argument strings. |
| REDUCT_API void reduct_add_import_path | ( | reduct_t * | reduct, |
| const char * | path | ||
| ) |
Add a path to search when importing modules.
| reduct | Pointer to the Reduct structure. |
| path | The directory path, will be copied. |
| 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 | Pointer to the Reduct structure. |
| buffer | The input buffer. |
| length | The length of the input buffer. |
| path | The path to the input file. |
| flags | 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 | Pointer to the Reduct structure. |
| id | The ID of the input structure. |
NULL if not found. | 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.
| reduct | Pointer to the Reduct structure. |
| path | The path string to resolve. |
| pathLen | The length of the path string. |
| outPath | Pointer to the buffer where the resolved path will be stored. |
| maxLen | The maximum length of the output buffer. |
| checkExistence | Whether to check if the file exists when resolving relative paths. |
|
inlinestatic |