diff options
| author | eunhhu <[email protected]> | 2026-09-25 09:32:46 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-09-25 09:32:46 +0100 |
| commit | 8a65fd032e6f74938caf84d6f6fcda6314e76a01 (patch) | |
| tree | f587047d42854049c68310cab409ad69eee0d5b5 /prototypes/connections/store.h | |
| parent | c63d70d535be7cf4b8c0a5739a7e623e51d2ebf0 (diff) | |
| download | pure-8a65fd032e6f74938caf84d6f6fcda6314e76a01.tar.gz pure-8a65fd032e6f74938caf84d6f6fcda6314e76a01.zip | |
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.
Diffstat (limited to 'prototypes/connections/store.h')
| -rw-r--r-- | prototypes/connections/store.h | 6 |
1 files changed, 6 insertions, 0 deletions
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, |
