aboutsummaryrefslogtreecommitdiffstats
path: root/core/module-store.c
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-09-28 10:44:19 +0100
committereunhhu <[email protected]>2026-09-28 10:44:19 +0100
commit4c4c73c30a0524cf893d813fda215199150a6934 (patch)
tree07118a2384cdc192ac881fc1008a39aca4a7d9ae /core/module-store.c
parentcff25dd387376311b09bab3a58377fecbfe818e4 (diff)
downloadpure-4c4c73c30a0524cf893d813fda215199150a6934.tar.gz
pure-4c4c73c30a0524cf893d813fda215199150a6934.zip
Keep lists as images and a log of their changes, checkpointed off the owner
Diffstat (limited to 'core/module-store.c')
-rw-r--r--core/module-store.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/module-store.c b/core/module-store.c
index 7e759fd..92200af 100644
--- a/core/module-store.c
+++ b/core/module-store.c
@@ -58,6 +58,10 @@ static PureResult save(void *context, void *const *documents, size_t document_co
return result;
}
+static const char *path_directory(void *context) { return context; }
+
+static const char *handle_directory(void *context) { return pure_store_path(context); }
+
/* Through a store handle: documents and states share its mapping. */
static PureResult open_handle_document(void *context, uint32_t collection, const char *key, void **document,
int64_t *revision) {
@@ -78,11 +82,11 @@ static PureResult handle_state(void *context, const char *name, PureDraft **out)
PureData pure_store_data(PureStore *store) {
return (PureData){.context = store, .open = open_handle_document, .version = version, .read = read,
.splice = splice, .commit = commit, .close = close_document, .state = handle_state,
- .save = save};
+ .save = save, .directory = handle_directory};
}
PureData pure_tree_data(const char *path) {
return (PureData){.context = (void *)path, .open = open_document, .version = version,
.read = read, .splice = splice, .commit = commit, .close = close_document,
- .state = state, .save = save};
+ .state = state, .save = save, .directory = path_directory};
}