Loom C API
Public Loom compiler C API
Loading...
Searching...
No Matches
compiler.h File Reference

Reusable command compilation over one immutable source catalog. More...

Go to the source code of this file.

Data Structures

struct  loomc_cmd_compiler_options_t
 Command compiler storage policy. More...

Typedefs

typedef struct loomc_cmd_compiler_t loomc_cmd_compiler_t
 Concurrent command compiler retaining a frozen index and prepared native sources and staged plans.

Functions

loomc_status_t loomc_cmd_compiler_create (loomc_link_index_t *link_index, const loomc_cmd_compiler_options_t *options, loomc_allocator_t allocator, loomc_cmd_compiler_t **out_compiler)
 Creates a compiler retaining |link_index|.
void loomc_cmd_compiler_retain (loomc_cmd_compiler_t *compiler)
 Retains a compiler.
void loomc_cmd_compiler_release (loomc_cmd_compiler_t *compiler)
 Releases a compiler.

Detailed Description

Reusable command compilation over one immutable source catalog.

Typedef Documentation

◆ loomc_cmd_compiler_t

Concurrent command compiler retaining a frozen index and prepared native sources and staged plans.

Each invocation supplies its own workspace, roots, configuration, targets, and publication sink. Published products and requests own their contents independently of the compiler.

Function Documentation

◆ loomc_cmd_compiler_create()

loomc_status_t loomc_cmd_compiler_create ( loomc_link_index_t * link_index,
const loomc_cmd_compiler_options_t * options,
loomc_allocator_t allocator,
loomc_cmd_compiler_t ** out_compiler )

Creates a compiler retaining |link_index|.

Creation inspects no source bodies. Passing NULL options selects the default storage policy.

The compiler supports concurrent invocations with independent workspaces; callers hold a reference until each synchronous invocation has returned.

Parameters
link_indexImmutable source index retained by the compiler.
optionsStorage policy, or NULL for defaults. Borrowed for this call.
allocatorHost allocator used for compiler and retained source storage.
out_compilerReceives one owned compiler reference on success and NULL on failure. Release it with loomc_cmd_compiler_release.
Returns
OK when the compiler was created.

◆ loomc_cmd_compiler_release()

void loomc_cmd_compiler_release ( loomc_cmd_compiler_t * compiler)

Releases a compiler.

Passing NULL is allowed. Thread-safe. The final release destroys staged plans and prepared sources before releasing their index and context.

Parameters
compilerCompiler reference to release, or NULL.

◆ loomc_cmd_compiler_retain()

void loomc_cmd_compiler_retain ( loomc_cmd_compiler_t * compiler)

Retains a compiler.

Passing NULL is allowed. Thread-safe.

Parameters
compilerCompiler to retain, or NULL.