aboutsummaryrefslogtreecommitdiffstats
path: root/core/module-save.h
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-09-28 09:37:36 +0100
committereunhhu <[email protected]>2026-09-28 09:37:36 +0100
commita8232abe41cc168fb1596eb16047133fddd7a9ad (patch)
tree42ae607a4e748f7493ec8336684b363254c37fe9 /core/module-save.h
parenta557178f92a0b54fd33b9a7aa14ce66a8c45c060 (diff)
downloadpure-a8232abe41cc168fb1596eb16047133fddd7a9ad.tar.gz
pure-a8232abe41cc168fb1596eb16047133fddd7a9ad.zip
Save a list as its items and a journal of its changes since
Diffstat (limited to 'core/module-save.h')
-rw-r--r--core/module-save.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/core/module-save.h b/core/module-save.h
index bc7adcc..f83e294 100644
--- a/core/module-save.h
+++ b/core/module-save.h
@@ -4,23 +4,25 @@
/* App states a data host keeps (docs/design/008-module-format.md), internal
* to the module executor. Each text state is a stored draft, each list state
- * a stored draft its list mirrors, and numbers, cursors and indices are one
- * stored value by name. A save publishes what changed, all or nothing. */
+ * a stored draft of its items and the records of its changes since, and
+ * numbers, cursors and indices are one stored value by name. A save
+ * publishes what changed, all or nothing. */
bool pure_save_enabled(const PureApp *);
/* A text state of m: its stored value, or its initial constant when none. */
PureResult pure_save_open_text(PureApp *, const PureModule *m, uint32_t state, PureDraft **out, PureVersion *saved);
-/* A list state of m: its stored items, fields moved by name when the stored
- * record differs from m's. */
+/* A list state of m: its stored items with its stored changes made again,
+ * fields moved by name when the stored record differs from m's; journaled is
+ * the bytes of the records stored after its items. */
PureResult pure_save_open_list(PureApp *, const PureModule *m, uint32_t state, PureList **out, PureDraft **draft,
- PureVersion *saved);
+ PureVersion *saved, size_t *journaled);
/* Open the stored numbers, cursors and indices, and put each stored one of the
* same name and kind that still fits into values, for the states of m that
* kept marks as new (-1); texts and lists are m's. */
PureResult pure_save_open_values(PureApp *, const PureModule *m, double *values, const int *kept,
PureDraft *const *texts, PureList *const *lists);
-/* Store a list whose record changed in its draft, header and items anew. */
-PureResult pure_save_rewrite_list(const PureModule *m, uint32_t state, PureList *list, PureDraft *draft);
+/* Store a list in its draft anew: header and items, no records. */
+PureResult pure_save_rewrite_list(const PureModule *m, uint32_t state, const PureList *list, PureDraft *draft);
/* The stored links of a starting app (module.h, PureApp); CONFLICT when an
* output with sends left is missing or has other fields. */
PureResult pure_save_open_links(PureApp *, const PureModule *m);