24 lines
527 B
C
24 lines
527 B
C
// Simple in-process registry to map canonical primitives to versions/handles
|
|
#ifndef REGISTRY_H
|
|
#define REGISTRY_H
|
|
|
|
#include <stddef.h>
|
|
|
|
typedef struct RegistryEntry {
|
|
const char* key;
|
|
const char* value;
|
|
int version;
|
|
} RegistryEntry;
|
|
|
|
typedef struct Registry {
|
|
RegistryEntry* entries;
|
|
size_t count;
|
|
size_t capacity;
|
|
} Registry;
|
|
|
|
void registry_init(Registry* r);
|
|
int registry_register(Registry* r, const char* key, const char* value, int version);
|
|
const char* registry_lookup(Registry* r, const char* key);
|
|
|
|
#endif
|