Create runtime/instance_props.kry with InstanceState as an "#extern #export" declaration — size_t and void* pass through untouched — so the tracked ui_instance_props.generated.h carries the public ABI and include/ui_instance.h is deleted. kir_emit.c, which hard-codes that include for modules borrowing instance state, now emits the props header, and the canonical surface doc gains the new module's row. Gates: generated-runtime-parity-test, fast-test, k2c/k2cpp/k2go-syntax-test, go-runtime-test, examples-syntax-test, and the refreshed public-API snapshot pass.
26 lines
823 B
C
26 lines
823 B
C
/* Generated by k2c from runtime/instance_props.kry. */
|
|
#ifndef K_RUNTIME_INSTANCE_PROPS_H
|
|
#define K_RUNTIME_INSTANCE_PROPS_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#include "kry_bounds.h"
|
|
|
|
#ifndef KIR_STRING_VALUE_DEFINED
|
|
#define KIR_STRING_VALUE_DEFINED
|
|
#include <stddef.h>
|
|
#include <string.h>
|
|
/* Immutable borrowed UTF-8 bytes; length preserves embedded nulls. */
|
|
typedef struct String { const char *data; size_t length; } String;
|
|
static inline String StringView(const char *data, size_t length) {
|
|
String value = {data, length};
|
|
return value;
|
|
}
|
|
static inline bool StringEqual(String a, String b) {
|
|
return a.length == b.length && (a.length == 0 || memcmp(a.data, b.data, a.length) == 0);
|
|
}
|
|
#endif
|
|
void* InstanceState(const char* type, uint64_t key, size_t size);
|
|
|
|
#endif /* K_RUNTIME_INSTANCE_PROPS_H */
|