|
Loom C API
Public Loom compiler C API
|
Reusable Loom API context. More...
Go to the source code of this file.
Data Structures | |
| struct | loomc_context_options_t |
| Context creation options. More... | |
Typedefs | |
| typedef struct loomc_context_t | loomc_context_t |
| Immutable Loom API context. | |
Enumerations | |
| enum | loomc_source_retention_t { LOOMC_SOURCE_RETENTION_EXACT = 0 , LOOMC_SOURCE_RETENTION_METADATA_ONLY = 1 } |
| Retention policy for source contents used to enrich diagnostics. More... | |
Functions | |
| loomc_status_t | loomc_context_create (const loomc_context_options_t *options, loomc_allocator_t allocator, loomc_context_t **out_context) |
| Creates a reusable Loom API context. | |
| void | loomc_context_retain (loomc_context_t *context) |
| Retains context for another owner. | |
| void | loomc_context_release (loomc_context_t *context) |
| Releases context from one owner. | |
Reusable Loom API context.
A context owns process-local Loom language registration state used by parsing, bytecode indexing, linking, and compilation. Embedders normally create one context for a process or toolchain instance and share it with prepared linkers, compilers, and link-index builders.
| typedef struct loomc_context_t loomc_context_t |
Immutable Loom API context.
Retention policy for source contents used to enrich diagnostics.
| loomc_status_t loomc_context_create | ( | const loomc_context_options_t * | options, |
| loomc_allocator_t | allocator, | ||
| loomc_context_t ** | out_context ) |
Creates a reusable Loom API context.
| options | Context options, or NULL for defaults. |
| allocator | Host allocator used for context-owned storage. |
| out_context | Receives one retained context on success. |
| void loomc_context_release | ( | loomc_context_t * | context | ) |
Releases context from one owner.
| context | Context to release. Passing NULL is allowed. |
| void loomc_context_retain | ( | loomc_context_t * | context | ) |
Retains context for another owner.
| context | Context to retain. |