aboutsummaryrefslogtreecommitdiffstats
path: root/core/log.h
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-09-28 11:12:37 +0100
committereunhhu <[email protected]>2026-09-28 11:12:37 +0100
commit3c8cc4e887c861c392223a54fd5be2b49db29874 (patch)
treefccb4588cf17b2adaa0fa5ff9e20e716c8489ac7 /core/log.h
parent4c4c73c30a0524cf893d813fda215199150a6934 (diff)
downloadpure-3c8cc4e887c861c392223a54fd5be2b49db29874.tar.gz
pure-3c8cc4e887c861c392223a54fd5be2b49db29874.zip
Write list images a chunk at a time, and keep the log within the lists' size
Diffstat (limited to 'core/log.h')
-rw-r--r--core/log.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/log.h b/core/log.h
index 44dbdfb..3edf4e9 100644
--- a/core/log.h
+++ b/core/log.h
@@ -37,10 +37,11 @@ uint64_t pure_log_bytes(const PureLog *);
/* A list's image: a file of directory named after the list, replaced whole
* (written beside it, synced, renamed over it): pure_image_write writes the
- * bytes of parts one after another, pure_image_read gives them back (malloc'd;
+ * chunks next gives, one after another, until an empty one (next false:
+ * ALLOCATION, nothing replaced); pure_image_read gives them back (malloc'd;
* NOT_FOUND when there is none, STORE_ERROR when damaged). The bytes of the
* image are digested: a file cut short or changed is refused. */
-PureResult pure_image_write(const char *directory, const char *name, const PureSpan *parts, size_t count);
+PureResult pure_image_write(const char *directory, const char *name, bool (*next)(void *, PureSpan *chunk), void *context);
PureResult pure_image_read(const char *directory, const char *name, unsigned char **bytes, size_t *size);
PureResult pure_image_remove(const char *directory, const char *name);
#endif