|
Hyperon C
|
Interfaces for module loading, defining module formats, and package management. More...
Classes | |
| struct | metta_mod_ref_t |
| MettaMod C API wrapper. More... | |
| struct | module_loader_t |
| A C representation of the Rust [ModuleLoader] interface. User can provide [ModuleLoader] methods implemented in C. More... | |
| struct | module_id_t |
| Identifies a loaded module inside a specific metta_t MeTTa runner. More... | |
| struct | module_descriptor_t |
| Identifies the properties on a specific module, including its name and version. More... | |
| struct | fs_module_format_t |
| A table of functions to load MeTTa modules from an arbitrary format. More... | |
Functions | |
| void | run_context_init_self_module (struct run_context_t *run_context, struct space_t *space, const char *resource_dir_path) |
| Called within a module loader function to initialize the new module. | |
| struct module_id_t | run_context_load_module (struct run_context_t *run_context, const char *name) |
| Resolves a module name in the context of a running module, and loads that module if it's not already loaded. | |
| void | run_context_import_dependency (struct run_context_t *run_context, struct module_id_t mod_id) |
| Imports a dependency module into the currently running module. This is "import *" behavior. | |
| struct tokenizer_t | metta_mod_ref_tokenizer (const struct metta_mod_ref_t *mod_ref) |
| Returns tokenizer of the MeTTa module. | |
| struct module_descriptor_t | module_descriptor_new (const char *name) |
| Creates a new module_descriptor_t with the specified name. | |
| struct module_descriptor_t | module_descriptor_clone (const struct module_descriptor_t *descriptor) |
| Creates a new module_descriptor_t that is a clone of the argument passed. | |
| void | module_descriptor_free (struct module_descriptor_t descriptor) |
| Frees a module_descriptor_t. | |
| bool | module_id_is_valid (const struct module_id_t *mod_id) |
| Returns true is a module_id_t is valid, otherwise returns false | |
Interfaces for module loading, defining module formats, and package management.
This interface includes structures and functions to define module formats and loader functions, as well as the API for accessing the MeTTa package manager
| struct tokenizer_t metta_mod_ref_tokenizer | ( | const struct metta_mod_ref_t * | mod_ref | ) |
Returns tokenizer of the MeTTa module.
| [in] | mod_ref | A pointer to the metta_mod_ref_t |
| struct module_descriptor_t module_descriptor_clone | ( | const struct module_descriptor_t * | descriptor | ) |
Creates a new module_descriptor_t that is a clone of the argument passed.
| [in] | descriptor | The module_descriptor_t to clone |
| void module_descriptor_free | ( | struct module_descriptor_t | descriptor | ) |
Frees a module_descriptor_t.
| [in] | descriptor | The module_descriptor_t to free |
| struct module_descriptor_t module_descriptor_new | ( | const char * | name | ) |
Creates a new module_descriptor_t with the specified name.
| [in] | name | A C-style string containing the name of the module |
| bool module_id_is_valid | ( | const struct module_id_t * | mod_id | ) |
Returns true is a module_id_t is valid, otherwise returns false
| [in] | mod_id | A pointer to the module_id_t to test for validity |
| void run_context_import_dependency | ( | struct run_context_t * | run_context, |
| struct module_id_t | mod_id ) |
Imports a dependency module into the currently running module. This is "import *" behavior.
| [in] | run_context | A pointer to the run_context_t to access the runner API |
| [in] | mod_id | The loaded module_id_t of the module to import |
| void run_context_init_self_module | ( | struct run_context_t * | run_context, |
| struct space_t * | space, | ||
| const char * | resource_dir_path ) |
Called within a module loader function to initialize the new module.
| [in] | run_context | A pointer to the run_context_t to access the runner API |
| [in] | space | A pointer to a handle for the new module's space |
| [in] | resource_dir_path | A C-style string specifying a file system path to use as the module's resource directory. Passing NULL means the module does not have a resource directory |
| struct module_id_t run_context_load_module | ( | struct run_context_t * | run_context, |
| const char * | name ) |
Resolves a module name in the context of a running module, and loads that module if it's not already loaded.
| [in] | run_context | A pointer to the run_context_t to access the runner API |
| [in] | name | A C-style string containing the module name |