7#ifndef LOOMC_ARTIFACT_H_
8#define LOOMC_ARTIFACT_H_
44#define LOOMC_ARTIFACT_FORMAT_LOOM_TEXT "loom-text"
47#define LOOMC_ARTIFACT_FORMAT_LOOM_BYTECODE "loombc"
50#define LOOMC_ARTIFACT_FORMAT_JSON "json"
53typedef enum loomc_artifact_kind_e {
loomc_status_t loomc_artifact_write_to_file(const loomc_artifact_t *artifact, FILE *file)
Writes artifact bytes to an open C FILE*.
loomc_status_t loomc_artifact_create_source(const loomc_artifact_t *artifact, loomc_source_format_t format, loomc_allocator_t allocator, loomc_source_t **out_source)
Creates an immutable source handle from an artifact.
loomc_artifact_kind_t
Artifact category.
Definition artifact.h:53
@ LOOMC_ARTIFACT_KIND_REPORT
Machine-readable report artifact.
Definition artifact.h:61
@ LOOMC_ARTIFACT_KIND_LAUNCH_CONFIG
Compiled kernel launch-configuration program.
Definition artifact.h:67
@ LOOMC_ARTIFACT_KIND_EXECUTABLE
Executable or loadable binary artifact.
Definition artifact.h:55
@ LOOMC_ARTIFACT_KIND_TEXT
Human-readable textual artifact.
Definition artifact.h:58
@ LOOMC_ARTIFACT_KIND_MODULE
Loom module artifact. The format indicates text or bytecode.
Definition artifact.h:64
void(* loomc_artifact_release_fn_t)(void *user_data, loomc_byte_span_t contents)
Callback used to release artifact contents transferred to a consumer.
Definition artifact.h:97
loomc_status_t loomc_artifact_write_to_path(const loomc_artifact_t *artifact, loomc_string_view_t path, loomc_allocator_t allocator)
Writes artifact bytes to a filesystem path.
#define LOOMC_API_EXPORT
Exports a public Loom C API symbol from a shared library build.
Definition base.h:34
#define LOOMC_API_PTR
Marks a public callback function pointer type.
Definition base.h:38
struct iree_status_handle_t * loomc_status_t
Opaque status handle.
Definition base.h:55
Immutable source handles used by parsing, indexing, linking, and compiling.
struct loomc_source_t loomc_source_t
Immutable source handle.
Definition source.h:80
loomc_source_format_t
Source byte format.
Definition source.h:83
Host allocator used for persistent Loom object storage.
Definition base.h:375
Borrowed artifact view owned by a result object.
Definition artifact.h:75
loomc_string_view_t format
Stable format string, such as vmfb, spirv, LOOMC_ARTIFACT_FORMAT_LOOM_TEXT, or LOOMC_ARTIFACT_FORMAT_...
Definition artifact.h:81
loomc_artifact_kind_t kind
Artifact kind.
Definition artifact.h:77
loomc_byte_span_t contents
Artifact bytes.
Definition artifact.h:87
loomc_string_view_t identifier
Human-readable artifact identifier.
Definition artifact.h:84
Non-owning view over immutable bytes.
Definition base.h:128
Non-owning string view over bytes that need not be NUL-terminated.
Definition base.h:63