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

Text and JSON configuration bindings. More...

Go to the source code of this file.

Data Structures

struct  loomc_config_binding_t
 Single configuration key/value binding. More...
struct  loomc_config_options_t
 Text configuration options attached to a link or command-product operation. More...

Typedefs

typedef uint32_t loomc_config_policy_flags_t
 Bitmask of loomc_config_policy_flag_bits_t values.

Enumerations

enum  loomc_config_policy_flag_bits_t { LOOMC_CONFIG_POLICY_FLAG_REQUIRE_RESOLVED = 1u << 0 }
 Configuration validation and resolution policy bit values. More...

Detailed Description

Text and JSON configuration bindings.

Link and command-product operations accept plain borrowed key/value data plus one optional JSON/JSONC object string. Bindings without a matching config declaration are ignored so one stable config bag can serve modules that consume different subsets. Compile operations instead accept an ordinary typed module containing config.def operations; callers load that module through the normal text or bytecode module APIs.

Example
Use JSON for a framework-provided configuration file and explicit bindings for programmatic overrides:
const char* json_config = "{\"tile_m\":\"128\",\"tile_n\":\"64\"}";
loomc_config_binding_t overrides[] = {
{
.key = loomc_make_cstring_view("tile_m"),
.value = loomc_make_cstring_view("256"),
},
};
.bindings = overrides,
.binding_count = 1,
.json_object = loomc_make_cstring_view(json_config),
};
@ LOOMC_CONFIG_POLICY_FLAG_REQUIRE_RESOLVED
Require all final operation config values to be resolved.
Definition config.h:62
Single configuration key/value binding.
Definition config.h:51
Text configuration options attached to a link or command-product operation.
Definition config.h:77

Enumeration Type Documentation

◆ loomc_config_policy_flag_bits_t

Configuration validation and resolution policy bit values.

Enumerator
LOOMC_CONFIG_POLICY_FLAG_REQUIRE_RESOLVED 

Require all final operation config values to be resolved.