|
Loom C API
Public Loom compiler C API
|
Applying and inspecting configuration on in-memory modules. More...
Go to the source code of this file.
Data Structures | |
| struct | loomc_module_config_options_t |
| Configuration bindings and resolution policy for a module operation. More... | |
Functions | |
| loomc_status_t | loomc_module_apply_config (loomc_module_t *module, loomc_workspace_t *workspace, const loomc_module_config_options_t *options, loomc_allocator_t allocator, loomc_result_t **out_result) |
| Applies text/JSON bindings to the module's existing configuration symbols. | |
| loomc_status_t | loomc_module_query_config_schema (loomc_module_t *module, loomc_allocator_t allocator, loomc_result_t **out_result) |
| Returns the module's configuration schema as a JSON REPORT artifact. | |
Applying and inspecting configuration on in-memory modules.
| loomc_status_t loomc_module_apply_config | ( | loomc_module_t * | module, |
| loomc_workspace_t * | workspace, | ||
| const loomc_module_config_options_t * | options, | ||
| loomc_allocator_t | allocator, | ||
| loomc_result_t ** | out_result ) |
Applies text/JSON bindings to the module's existing configuration symbols.
Explicit bindings override JSON entries, and unmatched keys are ignored. Applied values become module-owned; no borrowed binding storage escapes the call. Successful application preserves continuing compilation facts and records the applied values alongside them. Configuration changes affect the current IR; they do not undo transformations that have already consumed it.
With no bindings, REQUIRE_RESOLVED checks that no unresolved declarations remain after pipeline execution. This check does not mutate IR or discard retained compilation facts, including when unresolved declarations remain.
| module | Module to configure; its IR must satisfy input invariants. |
| workspace | Workspace providing transient configuration scratch. |
| options | Bindings and policy, or NULL for an admission-only check. |
| allocator | Host allocator used for result and transient storage. |
| out_result | Receives one owned result on an OK return. |
| loomc_status_t loomc_module_query_config_schema | ( | loomc_module_t * | module, |
| loomc_allocator_t | allocator, | ||
| loomc_result_t ** | out_result ) |
Returns the module's configuration schema as a JSON REPORT artifact.
A successful result contains one artifact named config-schema.json with format LOOMC_ARTIFACT_FORMAT_JSON. It describes unresolved declarations and resolved definitions, including their types, values, and constraints, using the same JSON schema as loom-opt --print-config-schema.
| module | Module to inspect; admission may populate verification caches. |
| allocator | Host allocator used for result and report storage. |
| out_result | Receives one owned result on an OK return. |