From 8a65fd032e6f74938caf84d6f6fcda6314e76a01 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Fri, 25 Sep 2026 09:32:46 +0100 Subject: Move document key listing behind the store API The terminal editor listed documents by reading the flat store's obj- file names, so a UI host depended on one storage layout. pure_store_keys now lists keys through the selected store; per-object file stores share store-keys.c, linked only by hosts that browse documents, so the default CLI and HTTP hosts are unchanged. The source TUI ceiling reviews the measured 368-byte cost. --- prototypes/connections/store.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'prototypes/connections/store.h') diff --git a/prototypes/connections/store.h b/prototypes/connections/store.h index 6896360..dbfa8f8 100644 --- a/prototypes/connections/store.h +++ b/prototypes/connections/store.h @@ -37,6 +37,12 @@ PureResult pure_store_splice(const char *path, const char *key, int64_t expected size_t offset, size_t remove, PureSpan insert, size_t max_size, int64_t *revision); +/* Visit each stored key once; the order is store-defined. Returning false + * from visit stops early. key is valid only during the call. Hosts that + * browse documents use this instead of reading a store's file layout. */ +PureResult pure_store_keys(const char *path, bool (*visit)(void *, const char *key), + void *context); + /* Fault hooks exist only in the separately built unit-test binary. */ typedef enum { PURE_AFTER_HEADER, PURE_BEFORE_FILE_SYNC, PURE_BEFORE_RENAME, PURE_BEFORE_DIR_SYNC, -- cgit v1.2.3